Hello, community! I’m new to Home Assistant, I just started my smart home automation project about a month ago. So far I’ve managed to accomplish a few interesting things by doing research, following tutorials, and thanks to this community. However, I recently encountered a problem that exceeds my understanding (I should mention that I’ve tried looking for solutions to this issue here, but it hasn’t been successful).
In short, I have installed ambient LED strips in the bathroom and in the entrance hallway of the house. For these I created two automations that turn on the LED strips at 60% brightness only at night (based on sunset/sunrise) and only when motion is detected (motion sensor in the hallway and presence sensor in the bathroom). Everything works perfectly.
In addition, I created two more automations, one for each room, where, if someone turns on the main light (separate from the LED strip), the LED strip turns off, and when the main light is turned off, the LED strip returns to its previous setting. I achieved this using “Scene Create” and “Scene Activate”.
In the bathroom, this last automation using Scene Create/Activate works perfectly. However, in the hallway, it only works partially. When I turn on the main light, the LED strip turns off. When I turn off the main light, the LED strip remains off (in the logs, I can see that Scene Activate has been triggered, but nothing happens). I should mention that the two automations are identical (I only changed the switch, sensor and LED strip entities). I can’t understand why the same automation works in one place but not in the other. Below, I’ll share the YAML code for the two automations.
alias: Bathroom Main/Night Light
description: ""
triggers:
- trigger: state
entity_id:
- switch.bathroom
conditions: []
actions:
- if:
- condition: state
entity_id: switch.bathroom
state: "on"
then:
- action: scene.create
data:
scene_id: bathroomwhled2
snapshot_entities:
- light.wh_led_controller
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.wh_led_controller
else:
- action: scene.turn_on
target:
entity_id: scene.bathroomwhled2
data: {}
mode: single
alias: Entrance Main//Night Light
description: ""
triggers:
- trigger: state
entity_id:
- switch.entrance
conditions: []
actions:
- if:
- condition: state
entity_id: switch.entrance
state: "on"
then:
- action: scene.create
data:
scene_id: entrancewhled
snapshot_entities:
- light.wh_led_controller_2
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.wh_led_controller_2
else:
- action: scene.turn_on
data: {}
target:
entity_id: scene.entrancewhled
mode: single
If you need any additional details, please let me know. Thank you so much!