I defined in automations.yaml
a trigger and an action
- id: test telegram
trigger:
- platform: state
entity_id: sensor.fuite_cuisine
to: "true"
action:
service: notify.telegram
data:
title: '*Send a message*'
message: "That's an example that _sends_ a *formatted* message with a custom inline keyboard."
data:
inline_keyboard:
- 'Task 1:/command1, Task 2:/command2'
- 'Task 3:/command3, Task 4:/command4'
I now would like to switch the state of sensor.fuite_cuisine
to test the message delivery. How to do that?
I went to Dev Tools - Events and chose state_changed
as the Event Type but do not know what to actually put in the JSON payload?
I tried {"entity_id":"sensor.fuite_cuisine","new_state":{"state":true}}
which triggered the following event, visible in the listener on the same page:
{
"event_type": "state_changed",
"data": {
"entity_id": "sensor.fuite_cuisine",
"new_state": {
"state": true
}
},
"origin": "REMOTE",
"time_fired": "2019-06-10T11:51:54.414455+00:00",
"context": {
"id": "fae9a2eb47ba4c89ba91c6506a9c449d",
"parent_id": null,
"user_id": "7f8306dc8dff43db960be270adfcdfee"
}
}
but this did not trigger the automation.
I believe the issue is with the test payload (I do not have right now access to the actual device which i could put on some water to physically trigger an event). Any help is appreciated.
Note: the telegram
notification seems to be correctly set up as sending a predefined event (DevTools - Services - telegram_bot.send_message
) works.