Hello, I am quite new in homeassistant. I add many devices in my home via many different integrations.
I set some simple automations like one light trigger other and so on, really simple, dont laugh pls
but, i am very enthusiastic about it.
Can you please tell me, how to set my bathroom light on warm white and 1% brightness if they are turned on between 23:00 - 5:00? I dont event know where I should paste or use any code…
I know that i am newbie, but if u have time for little explanation or any kind of help, I would appreciate that so hard.
this will do it assuming your light supports setting the color. however a big caveat is that this detects when the light is turned on and triggers quickly after it is turned on. if your light bulb is connected to a physical switch, i don’t know of a way for homeassistant to catch and set the brightness and color before it actually turns on.
in terms of where to put this, go to settings->automations->create automation->edit in yaml
then paste this code in there replacing the default empty automation. be sure to replace the light.your_light_entity_name with the actual name of your light entity.
description: ""
mode: single
trigger:
- platform: state
entity_id:
- light.your_light_entity_name
from: "off"
to: "on"
condition:
- condition: time
after: "23:00:00"
before: "05:00:00"
action:
- service: light.turn_on
metadata: {}
data:
brightness_pct: 1
rgb_color: [255,241, 224]
target:
entity_id: light.your_light_entity_name