New to all this and looking to make my first automation but unsure how.
I’m all set up with my devices and I want to make an automation to do the following using aeotec multisensor and lifx light bulb (which i have all working).
If lux level <20 lux and bulb is off and motion is sensed then I want to bulb to turn on for 1 minute.
If the bulb is already on then I want it to do nothing.
Can anyone point me in the right direction or link an example as i dont know where to start.
I don’t have an Aeotec multisensor, so I don’t know about the specifics. It would help if you shared some of those, such as what are the entity’s involved (for the sensor and the light), what do their states mean, are there any attributes of those entities that are important to this (e.g., where is lux reported, and how is motion indicated.)
Generically speaking, though:
automation:
- alias: Turn on light if off, it is dark, and motion is sensed
trigger:
platform: state
entity_id: sensor.my_motion_sensor
to: 'whatever_means_motion'
condition:
- condition: numeric_state
entity_id: sensor.my_lux_sensor
below: 20
- condition: state
entity_id: light.my_light
state: 'off'
action:
- service: light.turn_on
entity_id: light.my_light
- delay: 60
- service: light.turn_off
entity_id: light.my_light
Note that if motion is sensed again during the one minute the light is on the delay will not restart. I.e., the light will turn off one minute after it goes on (after motion is first sensed.) If you want the light to go on when motion is first sensed, and to stay on until one minute after motion is no longer sensed, that is also possible, but depends on some of the specifics I asked about above.