though very basic, I must confess I am struggling to find a way how to compress this into 1 automation using a trigger.below and trigger.above on the -3.5…
can we do that at all since the trigger cant be both below and above? or should I write it verbosely
trigger:
- platform: numeric_state
entity_id: sun.sun
attribute: elevation
below: -3.5
- platform: numeric_state
entity_id: sun.sun
attribute: elevation
below: -3.5
- alias: Sun elevation sets outside motion sensors
id: Sun elevation sets outside motion sensors
trigger:
platform: numeric_state
entity_id: sun.sun
attribute: elevation
below: -3.5
action:
service: homeassistant.turn_on
entity_id: group.philips_buiten_motion_sensor_switches
- alias: Outside motion sensors off when light outside
id: Outside motion sensors off when light outside
trigger:
platform: numeric_state
entity_id: sun.sun
attribute: elevation
above: -3.5
action:
service: homeassistant.turn_off
entity_id: group.philips_buiten_motion_sensor_switches
goal is obvious: turn_on when below -3.5, turn_off when above -3.5 … so how to write the service template
service: homeassistant.turn_{{'off' if trigger.above else 'on'))
please have a look?
thanks