Hi.
I have an PWM led components with an RGB led strip on a raspberry pi3. In the interface I can turn on and off anche change the light and color.
With the service panel I can turn on and off with a 5second transition. But I don’t know how to setup the interface switch to turn on and off with the transition. Can anyone help me?
Thank you very much.
Assuming you mean this …
It doesn’t mention transitions so I would guess not but there is no harm in trying.
The only other way of doing it is to do multiple calls to light turn_on with different brightness levels over however long you want but it will be a bit jerky compared to a transition.
Yes the component is correct. But I mean the transition in the service pages, like the pictute
How can I implement that? With some type of automation? Thank you.
Yep same as normal…
action:
- service: light.turn_on
data_template:
entity_id: light.rfl_bedroom_ceiling_light
brightness: 255
transition: 60
Not sure if you can do it with turn off tho’, best to try it
Umh…ok, but hot to trigger when I use the ui switch?
Well if you already have a UI switch use that!
Umh, sorry, can you explain me how to do? I’m newbie
OK, I think I know what you want, so create an …
input_boolean: desktop_lightstrip_switch
then create an automation…
- alias: "Turn On Lightstrip"
initial_state: 'on'
trigger:
- platform: state
entity_id: input_boolean.desktop_lightstrip_switch
to: 'on'
action:
- service: homeassistant.turn_on
data:
entity_id: light.lightstrip_desktop
brightness: 255
transition: 60
So now when you click on the input_boolean in the frontend the light will come on over a 60second period
Ok,thank you. This is the only solution, because with this I need 2 switch to turn off and change color and light
You could perhaps use .toggle rather than .turn_on, not sure if that will work tho’.
The thing you should be thinking about is how to do it automatically based on presence, time and date, darkness etc. The usual reason for Home AUTOmation is to let the computer do the work rather than reaching for a tablet/computer to switch a light on - you might as well just use a wall switch, it’s much more convenient and quicker.