I am trying to implement a default turn on state for some RGB LED strips.
I have some effects setup that I can access from the dashboard and work well.
I want to setup a default effect (Slow Random Colours) when the strips are turned on but having trouble with the on_turn_on action.
I have tried various combinations of code but cant get it to validate.
light:
- platform: rgb
name: "LED Strip"
id: led_strip
red: red
green: green
blue: blue
effects:
- random:
name: "Slow Random Colours"
transition_length: 30s
update_interval: 30s
- random:
name: "Fast Random Colours"
transition_length: 4s
update_interval: 5s
on_turn_on:
- random:
name: "Fast_Random_Colours"
transition_length: 4s
update_interval: 5s
ERROR Error while reading config: Invalid YAML syntax:
while parsing a block mapping
in "/config/esphome/RGB Feature Light.yaml", line 90, column 9:
name: "FastRandomColours"
^
expected <block end>, but found '<block mapping start>'
in "/config/esphome/RGB Feature Light.yaml", line 91, column 10:
transition_length: 4s
^
An old post, but on the same topic: is there an easy way of setting a default colour/brightness etc after the initial turn on (eg ESPxxxx module reboot) only?
I’m successfully using on_turn_on to set colour and brightness. I would like to be able to turn the LED strip off/on from HA without altering settings but have a module boot-up default to a standard setting - on_turn_on appears to execute under both scenarios. Possibly there’s a lambda option but either there isn’t or I haven’t got the syntax correct.
Ah - thankyou, as simple as that! I searched everywhere under the light component options and tried complicated lambdas, but logically it’s part of the ESPxxxx core config not light control.