Go to the EVENTS tab of the Developer Tools page. Enter “rhasspy_SetLight” (without quotes) where it says “Event to subscribe to”. Then click START LISTENING. Now, cause the event to happen. It should be printed out, with all the details. That will help you understand what is contained in the event. You can post what you get here if you like and I can help you further.
I allready do what you recommand, and in fact I see/get all the details.
My problem is I don’t understand how to handle the data (slot values …) in script inside automation.yaml (or another file …).
For example :
if I get (in HA) the following
{
"event_type": "rhasspy_SetLight",
"data": {
"piece": "bureau",
"_text": "allume le bureau",
"_raw_text": "allume le bureau"
},
"origin": "REMOTE",
"time_fired": "2020-03-22T07:10:48.852114+00:00",
"context": {
"id": "148ebe9e20bd48cd915439f6d7d938ef",
"parent_id": null,
"user_id": "d2c36efd2ee24987ac996426821a428b"
}
}
I can see I have “piece”:“bureau” (It’s what I expect …)
In the script I use :
event_data:
piece : rhasppy_SetLight.piece
Is this syntax correct to have ‘a kind of variable’ named ‘piece’ ?
And if yes, how to use it to make test or to send it back to rhasspy ?
I’ve tryied kind of something like the now.hour() example (that works…) but it’s not ok.
Maybe it’s the {{…}} that is not correct ?
Do you have an up2date link to documentation for this kind of usage ?
BTW : when I use as above ‘event_data’ the action seems to be ignored. If I remove it, the action is executed, I can hear “I switch on …”
I try what you gave as example …
for example #2 it’s OK for me, #1 with ‘event_data’ hangs HA … (intent not processed to the end …)
Also (if I may …)
I’m trying the example available on ‘templating’ at the HA site,
- alias: 'rhasspy 2'
trigger:
platform: event
event_type: rhasspy_SetLight
#event_data:
# piece2: piece
action:
- service: light.turn_on
entity_id: light.bureau
- service: rest_command.tts
data_template: >
{% if is_state('device_tracker.paulus', 'home') %}
{payload: "Ha, Paulus is home!"}
{% else %}
{payload:"Paulus is at {{ states('device_tracker.paulus') }}"
{% endif %} }
(2 space identation after ‘data_template: >’ )
but I get an : Invalid config for [automation]: expected a dictionary for dictionary value @ data['action'][1]['data_template']. Got None
error
I’ve read somes posts and docs … tryied the solutions provided … nope !
this #{|^[|#~{~{ syntax is not easy (for me !)
Thanks in advance for your answer, and for the time spent