Hi everybody,
I am trying to create an automation to switch on a certain light when (a) there is motion and (b) illuminance is beneath a certain value.
trigger:
- platform: state
entity_id: binary_sensor.motion_kueche_occupancy
to: "on"
condition:
# what goes here?
action:
- delay: 00:00:02
- service: switch.turn_on
entity_id: switch.kueche_schranklicht
I would like the light to only turn on when {{ state_attr('binary_sensor.motion_kueche_occupancy', 'illuminance') | int < 12}}
is true. How can I implement this in my condition?
This is difficult to test because the sensor will keep occupancy = on
for ~2min before resetting. So each time I change and test something, I have to wait… even if I manually change the value in development tools, the sensor itself will not transmit again until the timeout has been reached.
Thank you for your help