I have an automation that is supposed to turn off all the lights unless the entity is listed as an exclusion. However, it doesn’t turn off two of the lights “light.downstairs_ceiling_light” and “light.entry_light” for some reason. I checked the script trace and the lights are listed there so I would expect they should turn off. I can manually toggle them on and off individually so I’m confused why the script can’t turn them off.
Core: 2024.9.3
Frontend: 20240909.1
Any ideas on how I can fix this? Thanks!
Script:
alias: All Lights Off
sequence:
- target:
entity_id: |
{{
states.light
| selectattr('state', 'eq', 'on')
| rejectattr('entity_id', 'in', exclude_entity_ids)
| map(attribute='entity_id')
| join(', ')
}}
action: light.turn_off
description: Turn all lights off except an exclude list
mode: single
fields:
exclude_entity_ids:
description: entity_ids to exclude
Automation:
alias: All Lights Off
description: All lights off except for exclusions
trigger: []
condition: []
action:
- action: script.all_lights_off
data:
exclude_entity_ids:
- light.garage_exterior_light_1
- light.garage_exterior_light_2
- light.garage_exterior_lights
mode: single
Script trace (step details) - I can see the “light.downstairs_ceiling_light” and “light.entry_light” in the list of entities and all of the others listed turned off as expected.
Executed: September 25, 2024 at 3:20:54 PM
Result:
params:
domain: light
service: turn_off
service_data: {}
target:
entity_id:
- light.main_floor_group
- light.lower_floor_group
- light.garage_group
- light.upper_floor_group
- light.kitchen_pot_lights
- light.living_room_pot_lights
- light.bookcase_lights
- light.garage_bench_lights
- light.dining_table_lights
- light.kitchen_pendant_lights
- light.kitchen_ceiling_lights
- light.kitchen_valence_lights
- light.kitchen_cabinet_lights
- light.downstairs_ceiling_light
- light.garage_bench_lights_2
- light.entry_light
- light.oven_light
- light.microwave_light
- light.livingroom_dimmer
- light.office_floor_lamp
- light.couch_lamp
- light.sliding_door_floor_lamp
- light.living_room
- light.office
running_script: false