good morning guys;
i’m trying to set this automation up but for some reason i can’t seem to get it to work, would you guys be able to help me with it please.
- id: '1703677342247'
alias: Turn On/Off Master Bath Light Day and Night
description: Turn On/Off Master Bath Light Day and Night
trigger:
- platform: state
entity_id:
- binary_sensor.mbath_all_motion_sensors
from: 'off'
to: 'on'
condition:
- condition: time
after: 07:00:00
before: '21:59:00'
- condition: or
conditions:
- condition: time
after: '22:00:00'
before: 06:58:00
action:
- service: light.turn_on
target:
entity_id: light.mbath_vanity_lights
data:
transition: 1
brightness_pct: 100
- wait_for_trigger:
- platform: state
entity_id:
- binary_sensor.mbath_all_motion_sensors
for:
hours: 0
minutes: 0
seconds: 30
- service: light.turn_off
target:
entity_id: light.mbath_vanity_lights
data:
transition: 20
- service: light.turn_on
target:
entity_id: light.mbath_vanity_lights
data:
transition: 2
brightness_pct: 49
- wait_for_trigger:
- platform: state
entity_id:
- binary_sensor.mbath_all_motion_sensors
for:
hours: 0
minutes: 0
seconds: 30
- service: light.turn_off
target:
entity_id: light.mbath_vanity_lights
data:
transition: 30
mode: single
Which light.turn_on vs light.turn_off, do you expect the action to execute, you have double of both
I suggest you start with a simple automation, and “add” conditions/actions until it “fails to work”
Yes that was also what i thought, but it wasn’t specified in the “action” , however AceIndys “solution” seems much more “elegant” than what i could have come up with
I tend to end up with 2 automations, but eventually i might go through them, when i see better/more simple solutions, i save them in a text-file … for boring days
It’s actually first time i “noticed” the " default: " feature , which is often my reasons for 2 “solution”
Most of my motion-sensors (the aqara) has a default timeout, about 1 min , enough for most places i use them(lead-lights etc), the others (Tapo) i use them where i need lights-on for specified time
Is it possible to use - delay, under " Default: " ?
Yes, but i only want the delay for the “default” action
… or the choose/conditions … never mind, ill check my self
… just have to "merged (2) of my simple automations, so i can try out “default:”