Hue Bulbs from Z-Wave switch (Brain melting)


#1

Hi Folks,
I’ve just about gone in complete circles with this (as my lights did for the last 5 minutes).

I have a set of hue bulbs (group) connected to a REAL light switch.
I permanently wired the hue lights and replaced the REAL switch with a z-wave switch
the z-wave switch does NOTHING physical (well it appeases the wife’s need to have a real switch :D)

my first part of a piston is simple
if switch is pushed then toggle Hue light group
------NEARLY works----------

However, sometimes the hue light group is triggered separately (or not by the switch) and thus the toggle of the z-wave is out of sync. Meaning you may have to hit the ‘off’ part of the switch to turn the hue light group on.

SO i tried adding another part to the piston to match the setting of the switch to the hue group (and thats when i found my infinite loop :stuck_out_tongue: ) - i was using when switch is physically triggered (thinking i could then manually trigger the switch at another point later)

so challenge is to:

Have the physical light switch control the hue group and stay in sync (but not turn lights on or off, or loop) when staying in sync)

            Physical light (off state) switch changes to on = hue group on
            Physical light (on stage) switch changes to off = hue group off

            Hue Group on = turns physical light to on state (so its ready to physically be turned off)
            Hue Group off = turns physical light to off state (so its ready to physically be turned on)

PLAN B is to by a toggle single button z-wave light switch lol


#2

I have a piston that does exactly that here:

This piston will sync both on and off so the buib and the switch will always be in sync. It has never failed me yet after using it for at least 3 months. I have the Hue White bulb for this piston with a Z-Wave wall switch to control the light in my hallway for my bedrooms.


#3

Awesome thanks - i was wondering if i could keep it to a single ‘if’ rule - but this looks like just the job to get it working

thank you for sharing


#4

bangali sent me this one to try, haven’t tried it yet though.

a0777ede39147f82b0ca2b9f84f729f41da63460_1_647x500


#5

didnt want to provide a complicated example. but theres a way to do this without any ifs … i think. :slight_smile:

if anyone is willing to try it … i can provide the example.


#6

Sure, post away :slight_smile:


#7

this should do the same:


#8

Hi I just have this per light and switch been working for me for ages. I’ve added a few more bits for when a guest uses the house when we are away and when the mode is party but you can ignore that if you want, then it’s only one IF.


#9

@jaburges This way it doesn’t mater what state the switch is in because it works as a conventional 2 way light switch. The actual light switch being one and the virtual cloud state being the other so it’s always in sync :slight_smile:.


#10

bangali,

Works great so far, more efficient than the way I was doing it with 4 IF statement’s.


#11

awesome - this is super lean!

Works great (only minor issue is, when testing, if you turn on and off the physical switch within around 5-6 second window - the Hue group doesnt turn on - there is a pause, and the physical switch then syncs to the Hue off state).

TBH - this doesnt seem like a real world issue as i’m pretty sure there wont be a need to turn the light on and then off again within 6 seconds - lets see if it passes the (wife) test

Thanks for sharing everyone - so fun to see everyone’s different ways of doing things! Appreciate the help!


#12

are the z-wave switches dimmer switches? if dimmers and they are consecutively tapped within a few seconds only the last on/off state is sent as an event.


#13

i dont believe it is (its registered in the IDE as a switch) - i can hear the relay kick in for each physical switch tap. i’m assuming it may just be the time it takes to complete the update of the switch state vs the time another tap occurs


#14

ok. yeah, the delay in sending the event varies significantly by make and type.