petro
(Petro)
November 28, 2019, 2:42pm
21
it is. This config should work after you make changes and restart (or reload automations):
- id: '1574917260819'
alias: Kitchen Motion to MQTT
description: ''
trigger:
entity_id: binary_sensor.kitchen_motion_motion
platform: state
condition: []
action:
data_template:
payload_template: '{{ trigger.to_state.state }}'
topic: home/kitchen/motion
service: mqtt.publish
Well, itās a kitchen motion sensor and it is Thanksgiving so I should get plenty of data points to test!
BINGO! So, all along it was because I didnāt restart the server. I was fooled by the fact that it seemed to accept the changes on-to-fly. At least changes to labels and such would be reflected in the web UI immediately. Lesson learned. Thanks!
petro
(Petro)
November 28, 2019, 2:47pm
24
Haha, donāt worry, the nuances will come in time
Hello.
What could be the problem?
Automation does not work.
I get an error
This text will be hiddenError rendering template for call_service at pos 1: UndefinedError: 'trigger' is undefined
Here is the automation.
- id: '1587827'
alias: Send message, when devices conect to 2.4GHz
description: ''
trigger:
- entity_id: sensor.router_connected_chip2
platform: state
condition: []
action:
- data:
message: '{{trigger.to_state.state}}'
service: notify.cannel
Automation and the server restarted.
The question is removed.
My mistake:
Need
action:
- data_template:
not
action:
- data: