I have this automation, which sends a telegram message when a light was turned on or off.
But the automation doesn’t work, I always receive “Error for satus”
Has anybody an idea what I am doing wrong?
This is my automation:
- alias: notify_1_mqtt_light_status
initial_state: True
hide_entity: False
trigger:
- platform: state
entity_id:
- light.kitchen_node_1_led_light_1
- light.sonoff_basic_1_relay
- light.sonoff_s20_1_relay
action:
- service: notify.notify_1
data_template:
title: "{{ trigger.from_state.attributes.friendly_name }}"
message: >
{% if is_state('trigger.to_state', 'on') %} \ud83d\udca1 ON
{% elif is_state('trigger.to_state', 'off') %} \u26ab OFF
{% else %} Error for status
{% endif %}
{{ states.sensor.current_date_time.state }}