I have an automation that works but has a an issue I am not sure how to resolve.
I have a Qubino Flush Relay 1 controlling a light in my Foyer between sunset and sunrise.
It has two triggers. One being an AEOTEC MS6 sensor where I get it to sense motion. This would be someone walking down the stairs to the foyer at night. The other is a door/window sensor that detects if my front door is open or closed. I want it to switch the light on on at night when we open the door.
A delay action keeps the light on for 5 minutes
- if someone walks down the stairs to the foyer at night the light switches on.
- If someone opens the door at night the light switches on.
However if someone walks down the stairs, the light switches on and then opens the door within a short time the light switches off.
The outcome that I want is:
- between sunset and sunrise
- when motion is detected on the stairwell switch the light on
- when door is opened at night, switch light on
for the light to stay on for the 5 minutes after being switched on, the switch off.
Can anyone please enlighten me on how to achieve this outcome.
I have used the Automations proforma to generate this code
- id: '1573809638998' alias: Foyer Lighting at night description: Turn on Foyer Light after door switch is opened or MS6 detects motion trigger: - entity_id: sensor.aeon_labs_zw120_door_window_sensor_gen5_access_control_2 from: '23' platform: state to: '22' - entity_id: sensor.aeon_labs_zw100_multisensor_6_burglar from: '0' platform: state to: '8' condition: - condition: or conditions: - after: sunset condition: sun - before: sunrise condition: sun action: - data: entity_id: switch.qubino_foyer_relay_switch service: switch.turn_on - delay: 00:05:00 - data: entity_id: switch.qubino_foyer_relay_switch service: switch.turn_off