Yeelight Default Colour

Is there any way of setting the default colour of a light? So it will always reset to the give colour unless its turned on by a script that specifies colour

I believe you can with in the Yeelight app its self

I don’t think so.

Normally it uses the same color that was last picked, except when you turn it off completely.

Perhaps use an automation that triggers when the light turns on. In a script, temporarily switch off the automation, set color, then re-enable the automation.

I actually do mine the other way around, setting them to my ‘default’ as part of a bedtime turn off automation.

@gambit2552 I’ve looked in the app and you are correct there is an option in there, however it doesn’t seem to work :frowning:

@LarsNorgaard Yes I see that, which is why im asking. There’s always a way round these things :wink:

@Emphyrio Don’t you get it turning on the wrong colour first for a short time? It’s a good call though

@Bobby_Nobble I guess in your bedtime turn off automation you are turning it on to set the colour then turning it off? i guess if its not on it would cause it to flash?

Thanks for your help guys its certainly given me some options to play around with

They come on just before sunset and go off at ‘bedtime’ as well as partaking in some media player related automations along the way but otherwise yes, that would happen.

You could just turn it on by triggering a scene with the required values instead of a light on command and you won’t see the previous state at all.

Can we see what your code looks like for this?

Looks like this is a common issue

Did some more research and I think what you will want to use is the profile option under Service light.turn_on

It’s triggered from the ‘bedtime’ activity on my Harmony using emulated_roku, the actual scene is this…

- name: Normal
  entities:
    light.lounge_lamps:
      state: on
      brightness: 255
      color_temp: 330

…followed by light.turn_off, light.lounge_lamps is a light group of two yeelights.

I also have an automation in HA that senses the ‘bedtime’ activity and then sets the Harmony back to my default activity ready for anyone to pick up the next day though that has nothing to do with the light.

1 Like

Ah that’s what I thought your flashing all the lights in the house on then off.

No, if you read what I posted you’d see it’s only two lamps in my lounge and they’re already on but may or may not be on different settings to my ‘normal’ set up so they just change if necessary. The rest of the ‘bedtime’ activity runs and they turn off at the end of that. Others in the house are turned on using their ‘normal’ scene which in effect resets them.

I get that for your settings but if you wanted to reset a full house for example using your method you would need to turn on all the lights set the colour then turn them off. Which I mean would work but could be annoying. were as using the profile option to set the colour as your turning the light on seams to me to be a simpler option as its a single line you need to add to your light.turn_on

After having a think about it I think the best 2 options I’ve got from this;

  1. Take what @Bobby_Nobble has and stick it in a automation that triggers when the light is turned off. - This does mean the light will flash every time its turned off

automation:

- alias: 'Reset Light Colour'
  trigger:
    platform: state
    entity_id: light.yeelight
    to: 'off'
  action:
    - service: light.turn_on
      entity_id: light.yeelight
      data:
        brightness: 255
        color_temp: 330
        #may need to add a small delay here?
    - service: light.turn_off
      entity_id: light.yeelight
  1. Take @Emphyrio suggestion and stick it in an automation when its turned on - removes the flash
    automation:

    - alias: 'Reset Light Colour'
      trigger:
        platform: state
        entity_id: light.yeelight
        to: 'on'
      action:
        service: light.turn_on
        entity_id: light.yeelight
        data:
          brightness: 255
          color_temp: 330
    

And then if you ever want to turn it on without the default colour with script you just turn off the automation first to stop it triggering
script snippet

- service: automation.turn_off
  entity_id: automation.reset_light_colour
- service: light.turn_on
  entity_id: light.yeelight
  data:
    #whatever settings you want here
- service: automation.turn_on
  entity_id: automation.reset_light_colour

I’ve not tested any of this code just wrote it in here so apologies if its wrong. Not in a position to have a play for myself at the moment

If you really did get it you’d see I actually just made a comment that I do the reverse of what someone else did for a specific use I have BUT my suggestion to the OP was to turn them on by triggering a scene.