Hey all,
So I have an automation set up that will turn on my lights with a Phillips Hue motion sensor, and also turn them off when there is no motion detected for 5 minutes. This is working great and is really useful, however, I want to add another layer of complexity.
I’ve got another automation that will turn on the lights with a button press of an Aqara button, however, the lights will still turn off with no motion being detected. This is ran as 3 separate automation (1 for motion turn on, 1 for motion turn off, 1 for turn on with button).
What I’m looking to do is create a statement of some kind which is something to the effect of “if x light is turned on with button press, turn off lights after 1 hour of no motion instead of 5 minutes, or with toggle press of button” and I’m not sure how to achieve this.
I’ve read some people use input booleans but I wanted to get some more specific advice.
Below are my automations that I have currently.
Button Press;
alias: Button - Toggle Landing Light
description: ""
trigger:
- platform: device
domain: mqtt
device_id: c0b83b571d9a64ec8b7cd5c56dba4887
type: action
subtype: single
discovery_id: 0x00158d000705142c action_single
condition: []
action:
- service: light.toggle
data:
rgb_color:
- 255
- 217
- 120
brightness_pct: 90
transition: 1
target:
entity_id:
- light.landing
mode: single
Turn On with Motion;
alias: Landing Light - Turn Light On - 7am to 7:59pm
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.stairs_sensors
to: "on"
condition:
- condition: and
conditions:
- type: is_illuminance
condition: device
device_id: 43951e2239f123987f9180c373597527
entity_id: 1fb93710c431cd3ac2eda9282aab50e3
domain: sensor
below: 40
- condition: time
after: "07:00:00"
before: "19:59:59"
action:
- service: light.turn_on
data:
rgb_color:
- 255
- 217
- 120
brightness_pct: 90
transition: 1
target:
entity_id:
- light.landing
mode: restart
Turn off with no motion;
alias: Landing Light - Turn Light Off when No Motion
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.stairs_sensors
to: "off"
for:
hours: 0
minutes: 2
seconds: 0
condition:
- condition: state
entity_id: light.landing
state: "on"
action:
- service: light.turn_off
data:
transition: 1
target:
entity_id:
- light.landing
mode: restart
Thanks in advance.