Would someone be kind enough to look over this automaiton?
The lights come on, some on at the requested brightness, others at full. The double plug switch option never comes on. The lights do not turn off after any amount of time, I have to manually turn them off.
I don’t see anything wrong with the automation as such. You say the lights always turn on so your trigger is working as you want.
My experience of switching several (I assume zigbee bulbs?) at the same time is it is unreliable, you may benefit from creating a zigbee light group so the automation can send one command to the group rather than several to each device.
You say the plug never turns on, not teaching you to suck eggs but have you confirmed the plug turns on and off correctly by using the same command in developer tools, service? Just to rule out any issues independently of the automation.
Are you sure that all the lights support brightness_pct? Some smart bulbs require you to use a brightness value (1-255).
Are you like me and tend to mess around with your automations in the evening? Every time you edit and save any automation it will reload all autoamtions and any waits or delays will stop. With an automation like this, I would set multiple triggers and use a choose action.
- id: '1640321742258'
alias: Front Door Triggered Lights
description: Turn on most lights after 2045
trigger:
- id: Door Open
type: opened
platform: device
device_id: 67c71e4256c239940d1ce93d2dea9cba
entity_id: binary_sensor.front_door
domain: binary_sensor
- id: Door Closed 5
platform: state
entity_id: binary_sensor.front_door
to: "off"
for: "00:05:00"
- id: Door Closed 8
platform: state
entity_id: binary_sensor.front_door
to: "off"
for: "00:08:00"
condition:
- condition: time
after: '20:45:00'
action:
- choose
- conditions:
condition: trigger
id: Door Open
sequence:
- service: light.turn_on
target:
entity_id:
- light.hallway
- light.livingroom
- light.pc
data:
brightness: 75
- conditions:
condition: trigger
id: Door Closed 5
sequence:
- service: light.turn_off
target:
entity_id:
- light.hallway
- light.livingroom
- light.pc
- service: switch.turn_on
target:
entity_id: switch.double_plug_left
- conditions:
condition: trigger
id: Door Closed 8
sequence:
- service: switch.turn_off
target:
entity_id: switch.double_plug_left
default: {}
mode: restart