Trying to sync my bedroom switch with hue bulbs


#1

1) Give a description of the problem
I have a great zwave wired switch in my bedroom wall which is not connected to any load. I also have two hue bulbs in two lamps in that bedroom. I use SmartThings to make that switch control the hue bulbs and that part works well.

Sometimes instead of using the switch to turn on the bulbs, I use Alexa. When I do that, the bulbs turn on, but the wall switch is still set to off. So if I then go to use the switch to turn off the lights, nothing happens.

So… I would like to set up a piston which will be triggered when the hue bulb is turned on or off, and if the wall switch is in the wrong state, set it to the correct state.

I made a few attempts at building a piston for this but it didn’t seem to work.

If someone could offer some suggestions on the best way to do this, I would appreciate it


#2

I’m doing this too…but I just used the “Smart Lighting” app for the whole thing…in both directions.

You can use one of the Hue lights as a “switch” to make it happen, either in Smart Lighting or in WC.

Either way will work…so take your pick.

But I think this would do it in WC…


#3

thanks for posting that. I will give it a try…

here is what I had attempted which didn’t seem to work.


#4

Mike1616 - i just gave your solution a try and it din’t quite work either. when i turned off the lights using alexa, it just made the switch and light keep toggling on and off repeatedly.

I am confused about why my solution didn’t work either.

with my solution nothing seems to happen even though the piston is getting triggered.


#5

ok so i kind of got it working…

what weird is that if i turn the lights on or off using homekit or smartthings, the switch seems to toggle as desired. but if i use my amazon echo to turn the lights on or off, the switch doesnt toggle…

i cant figure this out…

heres what I have right now.


#6

So two things I’m doing differently… First I’m not using a piston, I’m using the smart lighting app, but second I’m only using one of the lights as a switch. I’d be concerned about using “Any” or “ALL” due to any potential latency or “race conditions” that you could run into as a result.

I also have an Echo turning on and off my Hue lights and it’s working for me. So it should all be possible. But it’s a complicated interaction with many moving pieces. Which is why I only use 1 of the lights as the “trigger” to manipulate the switch as “something else” in my environment is turning on all the other lights and they don’t need the competition.

Because you used more than one light as the trigger…and none of this stuff happens absolutely simultaneously. Milliseconds matter.


#7

Ahh good call. Both lamps should always be getting turned on or off so really I only need to tea on one of them.

Let me give that a shot

Thanks for that tip!!


#8

so I just got around to modifying my piston so that it is only checking for changes in one of the hue bulbs.

it works great if i turn on or off the bulb using the smartthings app or homekit/siri, but if i tell my echo to turn on or off the bedroom lights, it turns the hue bulbs on or off but the wall switch does nto change.

I cant figure out what the difference is between controlling the hue bulbs from smartthings vs from my echo.

attached is the latest version of my piston


#9

Ok I think i got it worked out. Turns out that on my Echo app, there were two copies of the hue bulbs. And when I looked Med at them, one was from the hue app and one was from the smartthings app.

Once I removed the duplicate ones from the high e app it started working. Woo hoo!

Thanks for all your help.

I am really amazed at how awesome webcore is and how I didn’t try it sooner.


#10

just to show another way of doing this … this piston can be summarized to the following: