Dang-- you went and did it.
I spent 3 hours last night trying to get the action to accept something like ' {{ trigger.event.data.args[0]}} '
so that the action would just ingest the value of the brightness/color button and could never get it to work. I toyed with the idea of doing what you did and but reallllllly didn’t want to write 216 lines of automatons. Thanks for sharing! I’m going to use your code, but still want to get automation templating to work
yea I went down that road before and never could get it to work… had a slow day and work and did a bunch of copy and paste to gen the code, wasn’t too bad.
I started implementing this and decided to learn node red. it just made managing the automations a lot easier and scalable. I bought a bunch of these, so i wanted to be able to reuse my work as much as possible
it is set up so that i have two remotes that both control on/off, brightness, and temp for a single light group. I can add another comperator to the first switch out of the events trigger so that I can add other remotes for other things
I’d say it’s worth a shot! Everything is working very well with ZHA on 0.104.x for me! I love that I can get these remotes to do whatever I want, now that they’re paired with HA! The remote downstairs randomizes the light colour of my lamps and bias lighting. The kids love it.
Yes and no. I was doing a lot of fiddling before 0.104.x was released. In fact, I never got the remotes to work until I started playing with one of the beta versions of 0.104.x. I believe it’s related to zha-quirks. So, if your remote was paired using the wrong quirk in 0.103.x, then it might make sense that it’s not working. Just speculating a little, but I’d wager your issue will be resolved by repairing.
Okay, grabbed a remote that hadn’t been paired, reset the remote and paired to HA…now I’m seeing events fired. So maybe if the remote was already paired you have to remote and re-pair.
Doubt this matters, but I also rebooted my HA VM too…figured it wouldn’t hurt to re-initialize my HUSBZB USB stick. After that with the new unpaired remote, once paired I saw events.
I can confirm that it’s necessary to remove the device from HA by using the zha control panel, factory reset the remote then pair to HA again.
after that you should see the events.
the power button sends two commands - it will send an on and an off command alternating on every button push. So the remote remembers the last command that was sent it doesn’t simply send a “toggle” command and let the light figure it out. I can see that causing some issues if the light state & the remote states get out of sync. Kind of like when using both the remote and HA to toggle the light. hopefully it will not be too hard to program around.
Each push of the dimmer button sends sends a cycling argument value in the order - 13 - 64 - 127 - 191 - 254 - 191 - 127 - 64 - 13 - 64 - etc
It also has a press & hold that sends a different argument (0 or 1) as its held to probably tell the light to dim or brighten. Once released it sends a “stop” command.
the kelvin button also cycles thru values on every press - 153 - 181 - 222 - 285 - 370 - 285 - 222 - 181 - 153 - 181 - etc
It has no hold command that I can tell
the memory button is very dynamic and so it’s hard to explain exactly what it does.
Generally, if held for more than three seconds it will store the state of the light (up to three memory locations).
then when pressed it will cycle thru those saved commands one after the other.
I don’t have mine paired with a light so it looks like there are “default” memory settings.
it always sends two commands on ever press - the first is a ‘on-off’ command (which might actually be a dim setting) and the next is a “move to color temp” command. the arguments for this part of the command for mine were 153 - 222 - 370 so it looks like those are the default values.
And each button (except the memory button) sends it’s own unique_id on every press. the memory button sends both the unique_ids for the dim & color temp buttons.
I’m not sure how useful any of that is but it might help to know how much data the remote sends and what to look for when reading the zha_event log.