initial commit
This commit is contained in:
22
configuration/automation/conversation_test.yaml
Normal file
22
configuration/automation/conversation_test.yaml
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
- alias: '[Conversation] Test'
|
||||
initial_state: "true"
|
||||
condition:
|
||||
condition: template
|
||||
value_template: '{%- set t = trigger.event.data.messages | map(attribute="content") | list | last -%}{%- set a = namespace(value=false) -%}{%- for w in ["need", "confirm", "?"] -%}{%- if w in t -%}{%- set a.value=true -%}{%- endif -%}{%- endfor -%}{{ a.value }}'
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: extended_openai_conversation.conversation.finished
|
||||
# event_data:
|
||||
# user_input:
|
||||
# device_id:
|
||||
# condition:
|
||||
# condition: template
|
||||
# value_template: '{{ trigger.event.data.node_id == 23 or trigger.event.data.node_id == 24 or trigger.event.data.node_id == 25 }}'
|
||||
action:
|
||||
- service: switch.turn_on
|
||||
target:
|
||||
entity_id: "{% set entities = device_entities(trigger.event.data.user_input.device_id) | expand | map(attribute='entity_id') | list %}{%- for e in entities %}{%- if 'switch' in e and 'continued' in e %}{{e}}{%- endif %}{%- endfor %}"
|
||||
- service: notify.telegram_alex
|
||||
data_template:
|
||||
message: 'Finished a conversation on the Onju Voice ID ({{ trigger.event.data.user_input.device_id }})\n Response: {{ trigger.event.data.messages | map(attribute="content") | list | last }}'
|
Reference in New Issue
Block a user