Easier way to do multiple switches to control lights?

I’ve created two switch nodes in node-red to turn on and set specific color temperatures and dim levels on my living room wiz lights. When turning each switch on in HA, it works. However, I can’t figure out an elegant way to turn off the lights if both switches are off. This is what I came up with for now…

The top is the switch nodes turning on and controlling the wiz light settings.

The middle is a way to turn off one of the switch nodes if the other turns on so that both switches don’t appear as on to HA and on my dashboards.

The bottom is the only way I can figure out how to test if both switch nodes are in the off position. If they are, then turn off the wiz lights.

There has to be an easier way to do this. Coming from WebCore and Hubitat, I can’t believe there isn’t one node that can test if switch A & switch B are both off, then pass along the off command to the next node. Am I crazy here?

Huh?

Are you creating an entire set of helpers in addition to the actual switches?

Let’s go back to the beginning. What is the end game?

I think you’re fighting the system here. There’s better ways to manipulate displays

Describe what you want to see then we’ll work backwards from there.

(im fmr smartthings and heavy webcore so feel free to use webcore terms. I can help you translate)

Honestly, this is just a workaround because the wiz bulb effect presets stopped being saved in HA scenes. They used to work, and now they default back to warm white whenever you activate a scene. I’ve tried recreating the scenes with the effects set on the wiz lights. It just doesn’t work anymore.

However, I would like to do the following…

1 - Establish 2 different scenes for the same group of wiz lights in my living room. Ideally, these scenes can be put on an HA dashboard and act like a switch instead of just a push button. I want to easily see which scene is on.

2 - When I turn one scene on, I want the other scene’s switch to turn off, but I don’t want the lights to go off. I just want the scene switch on the HA dashboard to appear on or off.

3 - If both scene switches are off, I want the wiz lights to turn off.

I used to do this in Hubitat easily with scenes and in a more complicated way in WebCore. By default, scenes acted like switches in Hubitat and they knew not to turn off the lights if I activated another scene with the same lights in the scene.

Also, I’m not creating any helpers at all. I’m just using the switch node in node-red so that I can see the switch in HA and put it on a dashboard.

Forget this behavior. It’s odd in the Smarthome world. Scenes are stateless. And now I get what the malfunction is. You’re trying to recreate the behavior from Hubitat. Yes it’s easy to and/or/xor/nor A and B to get C but you may not need to.

Let’s focus on this if I read you right the default of your bulb is warm white (Hardware limitations)

Assume the lights are off - You apply a scene and expect what to happen and actually experience? (I think I know but I don’t want to assume)

If the lights were on in one of your usual defaults then what happens?

I expect the wiz lights in the living room to turn on and go to the specified color temp or effects preset. This seems to be the easy part. I got it to work using this part of the flow…

If I select a different scene, I want the lights to transition to that scene. If all scenes are off, I want the lights to go off.

The key part here is that I like to see which scene is actually on. With an HA button, I can press it but there is no change in the button to let me know that the lights are currently in that scene. That’s why I thought a switch would be better. It’s on if the scene is on, off if the scene is off. If all scenes are off, the lights turn off.

1 Like

Go take a look at an input select helper for a moment.

I have one of these for each ‘room’ in my home and use the concepts from Bangali’s rooms manager (if you used webcore and Hubitat you probably know this code).

For me, the input select is the ‘mode’ of the room. I control everything about the room there (except one offs, sounds similar to your description) the room is vacant, occupied, engaged, hold, sleeping cleaning, paused. Automation or other… (you would of course use what works for you - maybe scene names?)

Changing that input select triggers all my other room automations (which work themselves out based on tome/date/condition) and the appropriate scene.

Why. Scenes are sateless. Don’t try to track if a scene is on. It ends poorly. You can tell the last time it fired. But that’s it. But now you have a construct all your own in this input select that you can count on AND it’s self documenting.

Would that work?

This is great advice. I guess I didn’t think about using a drop down list as the SCENE selection but it works perfectly. Now I don’t need a switch to be lit up to know which scene is on. Whatever is in the selection box is on. I even put an OFF option in there which does exactly that for the entire room. Thanks!

1 Like

Nice! Now you can get fancy…


Good luck - I see you’re off to the races already.

1 Like