Hello,
Started to move from YAML to Node-Red couple a days ago, and I bumped into something I can't resolve, but it looks so easy, yet it does not work for me.
I want to use a group of lights from Home Assistant to determine turn off or ON, but in the debug I get Xiaomi_aqara.click off in the end (instead of group.light on/off).
Xiaomi switch -> Single Click -> Group.light current state (from HA) -> Turn OFF or ON.
This is the YAML code I'm using right now and what I want to implement to Node-RED
- alias: Étkező Lámpa - Single
trigger:
platform: event
event_type: xiaomi_aqara.click
event_data:
entity_id: binary_sensor.switch_158d00016c0a97
click_type: single
action:
service_template: >
{% if is_state('group.light_etkezo','off') %}
homeassistant.turn_on
{% else %}
homeassistant.turn_off
{% endif %}
entity_id: group.light_etkezo
What am I missing?