Hey Keith. I’ve been after this, too. I can’t offer a pretty UI, but I did write a Pyscript module that implements a HA service for long-running Philips Hue-based animations. It comes with some pre-canned color/timing schemes, but you can add more by modifying a simple JSON-like structure embedded in the script.
I use this in combination with a Lovelace widget that lets me pick the room and the color scheme and start/stop the animation. (See below.) Note that this requires the Pyscript integration, which is available in HACS.
One issue is with Node-Red if I restart the container for an update or something I get knocked out of my loop.
I know I could add a input bool to check on startup maybe but it’s all so tiresome…
I’ll look at this later, like I said in our other chat if I could get something a bit more hands off going then I’d switch my bulbs over to deCONZ entirely.
I absolutely love your approach.
Installing pyscript and importing the script, works well.
But I’m struggling building the LoveLace and the scripts.
Maybe you could give me some help, getting this running?
The Lovelace widget is just a couple of input_select helpers and two scripts that call the pyscript.color_swarm_turn_on and pyscript.color_swarm_turn_off services, respectively. This is the YAML for it:
The first input_select is a list of rooms/zones exactly as they appear in the Philips Hue app. The second is a list of color swarm names from the JSON file. Ideally, I’d populate both of these lists automatically, but I haven’t found a simple way to do that so I just update them manually. They don’t change very often.
The scripts are also simple. They just call the pyscript services. Here’s the start script:
Note that starting a new color swarm in the same room will interrupt any previously running swarm so you don’t need to worry about conflicts. Good luck!
This looks like a really great idea. I have been using an Android app called Hue Pro that has a GUI for achieving similar effects in the same way by setting color, length of transition, brightness etc. However you have to let the android app run which is a huge downside.
Since I updated HA to version 2021.12.4 the color-swarm script stopped working.
I got the error in the log:
This error originated from a custom integration.
Logger: custom_components.pyscript.file.color_swarm
Source: custom_components/pyscript/global_ctx.py:337
Integration: Pyscript Python scripting (documentation, issues)
First occurred: 12:20:20 PM (2 occurrences)
Last logged: 12:22:22 PM
Exception in </config/pyscript/color_swarm.py> line 7: from aiohue.bridge import Bridge ^ ModuleNotFoundError: No module named ‘aiohue.bridge’
Do you have any idea about that?
I didn’t have any success searching for the module ‘aiohue.bridge’
I was using the same script and ran into similar situation.
I manually installed the aiohue using the SSH & Web Terminal integration. I got it pre-compiled from https://pypi.org/project/aiohue/
Checking the aiohue repo I saw that they changed the functions structure, so I edited my scripts to update the calls.
So, in the past, I tried the hass-animated-scenes integration to control a group of Wiz bulbs I have around the exterior of my house with little success.
The colorswarm idea struck me as interesting, so I modified the existing pyscript so that it should (theoretically) work with any color changing bulb.
Instead of a room_id or whatever the param was, supply the script with an “area_id” param instead, which is obv. the area id of the area containing the lights you want to control.
This should also do away with the requirement for the aiohue library, as I’ve just hacked the device registry to supply area ID’s for entities when not present, which then lets us find all entities in the light domain which have the “hs” flag in supported color modes.
Mileage may vary, but it definitly works with my Wiz bulbs, so mission accomplished on my end.
Also, added a “Halloween” swarm, as this was my main goal in getting it working in the first place.
One more time. Now I’ve added a schedule function where I can define what times of the year I want what swarms to run, and then just define a routine that starts and stops the swarms at a specific time:
Does this still work for you? I am using the first built of 2023 of HA and it seems that due to some changes related to the configuration of bridge credentials it does no longer work. Did you perform some additional adjustments?
I’m going to bump this. I’m surprised there isn’t more interest in creating a way to automate colors and animations directly in Home Assistant.
I used to use iConnectHue but that’s limited to Hue lights and requires a Hue hub.
Here’s an example of what the UI looks like.
It’s pretty intuitive, just pigeonholed into the Hue ecosystem.
So am i, the demand must be kinda big? Im using Hypfers custom component and have started making a view with presets. Unfortunately they are bound to specific lights. So much better if i could choose what lights or group of lights i wanna start the scene on and then just pick the scene of my choice. Maybe it’s not that hard to fix something like that?