Any ideas as to what is wrong here with the below.
Automation is triggered by either one of two entities air quality, but want the “Room” value to send to a script to send a notification but HA isn’t liking something here.
Config is saying it is ok, but reloading the automations get an error to check.
Thanks!
- alias: 'Bedroom VOCs'
mode: single
trigger:
- platform: state
entity_id: sensor.aarlo_air_quality_small_bedroom
- platform: state
entity_id: sensor:aarlo_air_quality_large_bedroom
condition:
- condition: state
entity_id: input_boolean.kids_bedtime
state: true
- condition: state
entity_id: input_boolean.night_mode
state: false
- condition: numeric_state
entity_id: "{{ trigger.entity_id }}"
above: input_number.abnormal_voc
action:
- service: script.environment
data:
Room: >
{% if trigger.to_state.entity_id == aarlo_air_quality_large_bedroom %} Large
{% else %} Small {% endif %}