<TL/DR> What’s the simplest way to set up the interaction between a light switch and lights?
Hi there!
I used to run all my light switches and bulbs through Deconz, which let me just say “Switch X controls light group Y” and I would instantly have the switch turn the light on, off, raise and lower brightness.
My Deconz stick died though and I switched to a Sonoff USB 3 Zigbee dongle.
Now I’m figuring out how to get light switches to control the lights. The only way I can see how to do it (with my limited knowledge) is to create separate automations for 1) switching the light on 2) switching it off 3) raising the illumination 4) lowering the illumination.
4 automations for every single light group, just seems very complex and time consuming to set up for something so simple and commonplace.
Is there a simpler way to associate light switches with light groups with default behaviors?
You didn’t say what you are using in HA to manage your Zigbee devices are you still using Deconz with the Sonoff or are you using ZHA or Zigbee2MQTT? I know in Z2M there is the capability to configure this.
I didn’t know there were options! When I plugged my Sonoff in it was autodetected by HA and set up. It seems it’s using ZHA from the configuration url ( http://mydomain.tld:port/config/zha/dashboard?config_entry=xxxxxxxxxxxxxxxxxxx ) I’m not using Deconz at all any more.
I think that would be useful, although my main question is if there’s a simpler way to set up having my switch turn it off/on/change the brightness than setting up 4 automations for each group. I’ve edited my original TLDR to clarify.
OK, I use Zigbee2MQTT so I’m not sure ZHA also has this capability, my guess is not. I would try a Group or you can have your switch control a Scene as well that has all of the lights in it. I have a Zigbee button that I use to turn on 3 lights right now but I have a bit of a complicated setup as my Zigbee button has Single Press/Double Press/Hold options which I use as a way to turn on 1-3 bulbs at once.
OK, thanks for your reply @timnolte . My main question though isn’t really about groups at all. It’s whether there’s an easy way to get:
The light switch on button to turn the light(s) on
The off button to turn the light(s) off
Holding the on button to increase brightness
Holding the off button to decrease brightness.
…without having to set up a bunch of automations. I assumed there would just be a simple single way to say “light switch X controls light(s) Y” in HA, just as there is in Phoscon.
Am I missing something or does it just not exist and I need 32+ automations to dim and switch on / off the lights in 8 areas?
So, you should be able to this with 1 automation that will handle it all. However, for clarity in the single HA automation you’ll have some trigger handling to know if it’s the on or off button that is being pressed or held. So there will be like 4 different sets of logic all in 1. Setting up a Group will help to simplify the automation in terms of directing all of the lights. I’ll try to put together an automation tonight that should hopefully give you what you’re looking for.
Thank you so much! I don’t understand how 4 different actions can be set up in 1 automation, but if it’s possible, that would be extremely educational both to me and others reading this post in the future, I’m sure.
If you set a group of lights in a light group then they should have the features of a light, like a service call to turn off, turn on, set brightness and possible also set color/temperature.
Yep. But my main question was how to set up 4 actions for each group (turn on, turn off, brightness up, brightness down) without needing a ton of automations (eg 32 automations for 8 groups).
@Synappz so here’s something to hopefully get you in the right direction. I don’t have all of the right hardware to get exactly what you need working. The smart bulbs I have are some WiFi bulbs that don’t properly support the transition. However, there are some resources linked below that should further help in that regard. I have a single button that I leveraged the single push & double push to mock up separate on & off buttons. In your case you’ll setup something like a switch-on-hold and switch-off-hold which will give you 2 sections where you will transition your brightness up (switch-on-hold) and then transition down your brightness (switch-off-hold). I created a Group helper that combines my 3 bulbs into a single entity so it makes it easier to setup in the automation. I’m not 100% on the right setup for the press-and-hold part to get it to keep incrementing the brightness until you release the button. I think you might be able to setup something with a Repeat Action and then use a condition that repeats until the button Release trigger. This may need more manual YAML work with some template usage in order to get it to function exactly like you are wanting. I might try playing around with this some more at some point but I’ve got some other project work to tackle yet tonight.
Thanks so much @timnolte ! Would a similar format work for ZHA as well, or would this require setting up an MQTT server and running everything through that?
It can be done with zigbee groups and binding much like deconz. It’s actually pretty easy, just hidden a menu or two too deep.
1: Add the lights to a zigbee group via the “Groups” tab on ZHA Integration “Configure” page
2: Go to the “Manage Clusters” menu of the switch device and complete the “Group Binding” options.
Omg. Yes! This is exactly what I was looking for, but hadn’t come across the “binding” terminology to know what to search for:
The only thing is, when I select the group, tick the sections underneath, and click “bind group” nothing seems to happen. Another post said you need to click “Reconfigure” afterwards, but after closing the dialogue and clicking “Reconfigure” it just returns an error that binding failed and this in the logs:
[0xEC15:1:0x1000]: Couldn't get list of groups: Request failed after 5 attempts: <Status.NWK_NO_ROUTE: 205>
The automation I setup can be used with regardless of whether you are using ZHA or Z2M. I don’t have any Zigbee bulbs at the moment so I can’t test out binding, though I use Z2M and have no way to test ZHA if I had Zigbee bulbs.
I’m curious though if simple binding will get you the dimmer control that you are looking for.
oh my god. Thanks I’m not alone and you asked this.
I received my ConBee2 stick today and just set it up.
After about 30 minutes of creating automations for a zigbee switch (on, off, dim++, dim–, change color …) I think you know what I did - the same crap as you, I was sure that this must go better.
The UI does not make it easy to find this option - or I am simply blind.
I’m really thinking I ought to get my WiFi bulbs switched out for ZigBee ones. I haven’t been super impressed with the Meross WiFi bulbs I have, or at least the integration for them.
I just discovered the solution to the error above! It seems that the devices go into some kind of power saving mode. If I push buttons on the IKEA switches while they’re reconfiguring, the reconfiguring works perfectly. Then the switches work great, changing the light groups. No automations needed! Thanks @jerrm for pointing me in the right direction in this reply!