Problem after changing scenes to scripts

Hi there,

Hopefully someone can help with this, as I’ve been driving myself mad for a few days now trying to get it to work.

Recently upgraded from an older version of hassio (around 0.9x) to version 0.103.4 and all my scenes that worked perfectly stopped working. Did some research with Google and realised things had changed in the update, and I needed to migrate them to scripts.

I have done this, but they just don’t work as expected, and by that I mean my puny brain can’t get them to work.

test123:
  alias: script_test
  sequence:
  - data:
      brightness: 255
      color_name: snow
    entity_id: group.kitchen_lights
    service: homeassistant.turn_on
  - data:
      brightness: 255
      color_name: snow
    entity_id: group.kitchen_spotlights
    service: homeassistant.turn_on
  - data:
      brightness: 255
      color_name: snow
    entity_id: group.kitchen_cooker_lights
    service: homeassistant.turn_on

This is how I have one of the scripts setup. In the old scene setup, I changed colors using RGB values, but I tried color_name for this particular example as RGB didn’t seem to work either. They are Tuya lightbulbs (GU10 spotlights) that are setup as groups if that makes any difference.

In this example, I setup 3 different groups of lights in the kitchen as in some scenes I change the color / brightness of individual areas so they each need their own properties.

Problems :

  • If the light is turned off, the light does come on, but there is a long delay. If I have 3 groups to turn on in the script, then they are turned on one after the other, but there is a 3-6 second delay between each group making it seem clumsy and slow

  • The other problem is, the light color is not altered by the script. As an example, if I manually changed the light colour to red, the above script would not change the colour from red to white as expected

I’ve tried creating the scripts in the GUI, as well as in scripts.yaml, as well as different ways of formatting from here, Google and Reddit and I just can’t seem to make progress

Please can someone tell me what I’m doing wrong? This seems way more difficult than before, I setup all of my old scenes in about 20 mins and they all worked reliably until now.

Thanks for taking the time to read, any help or criticism would be welcome and appreciated.

For the next time, you should not update so many versions in one step, and also not google for any changes. Instead read the release notes from the next higher version, check for any breaking changes, adapt your setup as needed, then update. Repeat until you arrived at the newest version.

Some of them may need to be migrated to scripts, but I don’t see a reason to migrate the one you posted as there are no transitions in there.

I don’t own any Tuya bulbs, is color_name supported for them? Is “snow” a valid color? I always use “white”.

Are the individual bulbs light.xxx or switch.xxx entities? If they are light.xxx entities, if would be better to create a light group instead of a normal group.

Thanks very much for taking the time to reply.

Yes you’re absolutely right. This was pretty naive of me, I stupidly thought it would be mostly UI upgrades and not removed/changed functionality. I won’t make that mistake again.

The reason I migrated them, as I read this was the best thing to do. Maybe this was a mistake on part, but just assumed as they’d completely stopped working as scenes since the update, I should move them to scripts.

I read in the documentation that all CSS3 colour names were supported by the ‘color_name’ attribute, so I just gave it a shot. I have tried white, and blue etc and they work, but only first time as mentioned above. I’ve also tried RGB values too, and they only work on the first shot.

They are all light.xxx, I wasn’t aware that light groups were even a thing I will take a look into them now.