(ANSWERED) Z-Wave ON/OFF vs. Physical Switch ON/OFF

Posted on
Fri Apr 29, 2016 3:04 am
Shutter offline
Posts: 345
Joined: Mar 07, 2014
Location: London, UK

(ANSWERED) Z-Wave ON/OFF vs. Physical Switch ON/OFF

Is there a way to differentiate in Indigo whether an ON/OFF change is via a Z-Wave command or from physically flipping a switch? Or is this device specific?

My specific device is the Fibaro Dimmer 2 connected to a toggle switch. The plan was to turn on another light connect to a Z-Wave socket when I manually turn on the bedroom light switch with the Dimmer 2 connected, but not when Indigo send an ON command via Z-Wave to the same Dimmer 2.

I tried using Device State Changed and Z-Wave Event as a trigger, but both of course turned on the light the same as when I flipped the light wall switch.

Any ideas?

Thanks,

Simon
Last edited by Shutter on Tue May 17, 2016 3:33 am, edited 1 time in total.

Posted on
Fri Apr 29, 2016 3:56 am
Vangelis offline
Posts: 167
Joined: Mar 18, 2014
Location: Southampton (UK)

Re: Z-Wave ON/OFF vs. Physical Switch ON/OFF

Now this is a total 'Seat of the pants' answer, not having played with one of these but could you bridge S1 to S2 and then have Indigo read the status of S2 as 'local control' - this is assuming that when a Zwave 'On' cmd is sent, S1 and S2 dont poll as 'On' as well. You can then use a 'Condition' for your Zwave socket control.

Hmm reading more I am not sure the above would work..

Maybe set a variable then issuing a ZWave 'On' cmd, then Device Change State checks this variable to determine if remote or local control was the last trigger (Local Control would then clear this variable)

Vangelis
Last edited by Vangelis on Fri Apr 29, 2016 4:09 am, edited 2 times in total.

Posted on
Fri Apr 29, 2016 4:05 am
DaveL17 offline
User avatar
Posts: 6757
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Z-Wave ON/OFF vs. Physical Switch ON/OFF

Another option would be to toggle the value of a variable when Indigo is the command source. Then, any time your switch reports as on while the variable is set to off would indicate local control.

Then use a trigger when the state of the switch changes AND the variable is off.

Dave


Sent from my iPhone using Tapatalk

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Apr 30, 2016 12:41 am
rhanson offline
Posts: 192
Joined: Apr 30, 2013

Re: Z-Wave ON/OFF vs. Physical Switch ON/OFF

I'm sure there's a more elegant way to do it, but for certain lights, I have 2 variables:

kitchen_light_on
kitchen_light_auto_on

These are timestamp variables. I have an Indigo trigger that looks for the kitchen_light to turn on, and it stores the current timestamp in kitchen_light_on.

In my scripts, when I'm programmatically turning on the kitchen light, I store the current time into kitchen_light_auto_on.

Now I can compare these 2 timestamps. If they are within, say, 2 seconds of each other then I know that the light turned on as a result of my automation, and not a manual wall-switch action.

Real use case: kitchen lights come on based on a variety of conditions, including motion sensor, occupancy, ambient light, etc. After some period of inactivity, they get dimmed or turned off. But if I manually turn on the light for some reason, I look for that timestamp difference and keep the light on. This way, I can stand in the kitchen and not have to worry about the light turning off based on some automation.

You can extend this to cover the cases of turning lights Off and manual changes to dimmer levels by using the same logic.

Posted on
Sat Apr 30, 2016 4:36 am
Shutter offline
Posts: 345
Joined: Mar 07, 2014
Location: London, UK

Re: Z-Wave ON/OFF vs. Physical Switch ON/OFF

Thanks everyone, these are excellent ideas. Just one thing, how does one determine if Indigo is the command source?

Posted on
Sat Apr 30, 2016 5:35 am
DaveL17 offline
User avatar
Posts: 6757
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Z-Wave ON/OFF vs. Physical Switch ON/OFF

Shutter wrote:
Thanks everyone, these are excellent ideas. Just one thing, how does one determine if Indigo is the command source?

Here's how I do would do it.

First, create a variable to hold the state of local control for the switch. For this example, I'll call the variable "Foo".

Second, create two action groups that include (1) the Fibaro and (2) a variable action to modify the variable Foo. The first action group would set the value of Foo to on and turn on the Fib. Modify the variable THEN turn on the device. The second action group would set the value of Foo to OFF and turn off the Fib.

Third, modify your schedules and actions (etc.) for the Fib to call the action groups you just created (rather than directly controlling the Fib.)

Fourth, create a trigger that fires when the Fib is turned on AND the variable 'Foo' is OFF. This would indicate the switch has been thrown locally rather than by Indigo. If needed, create a second trigger that does the opposite (when the switched light is turned off AND the variable "Foo" is OFF. These triggers would control the socket.

The second trigger is a little tricky because Indigo could fire a schedule or action (for example) AFTER someone has turned on the light with local control. In other words, the switched light would've already been on but now the variable Foo is set to ON. The simplest solution is to add the socket to the action group in (1) above that turns off the socket anytime the Fib is turned off no matter whether it was turned off locally or by Indigo.

Does that all make sense?
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Apr 30, 2016 10:47 pm
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Z-Wave ON/OFF vs. Physical Switch ON/OFF

When the switch is operated manually I just set a variable that is checked as a condition by my automation
of the light. Simple enough to trigger off an Insteon or Zwave command received to disable the automation
and restore it after an off command received from the switch or have it time out.

Carl

Posted on
Sun May 01, 2016 4:14 am
PvG offline
Posts: 9
Joined: Feb 15, 2016

Re: Z-Wave ON/OFF vs. Physical Switch ON/OFF

Simon, I think the following should work:
You can associate the Dimmer2 with the second lamp switch/dimmer. The associations are only used for the physical controls (at least that is the case for my Dimmer 1 devices). Then via Indigo you can control the Dimmer2 without affecting the second switch/dimmer. Associations between zwave devices can be set via the zwave menu in Indigo. The associations also work when Indigo is offline.

Regards,
Peter

Posted on
Tue May 17, 2016 3:32 am
Shutter offline
Posts: 345
Joined: Mar 07, 2014
Location: London, UK

Z-Wave ON/OFF vs. Physical Switch ON/OFF

Been meaning to reply to thank everyone for the tips. In the end the easiest way was to associate the Dimmer 2 to my plugin socket - thanks Peter. First time I've used associations. Very useful.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 15 guests