We have moved at community.getvera.com

Author Topic: Combination Virtual switch plugin (UI5)  (Read 152891 times)

Offline M2MExpert

  • Jr. Member
  • **
  • Posts: 95
  • Karma: +0/-0
Re: Re: Combination Switch for Toggle Function
« Reply #60 on: July 29, 2012, 06:28:09 pm »
I am having a problem though. When I create ToggleLight and select the two trigger buttons and save. The trigger buttons do not seem to retain that setting. If I go back into the settings of that scene, the two triggers are no longer selected.

http://forum.micasaverde.com/index.php?topic=10995.msg80867.msg#80867

Thanks. I confirmed that the triggers are saved. Still having problems getting the triggers to do what I need. I replaced LightToBeToggled with a virtual switch. I want the switch to be toggled on and off. It doesn't seem to work. If I manually flip the switch it inverts the two trigger switches so that seems to work but when the two triggers are activated simultaneously by the scene the switch doesn't toggle.
- M2MExpert
Machine to Machine Communications Specialist

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Combination Virtual switch plugin (UI5)
« Reply #61 on: July 29, 2012, 07:55:48 pm »
I replaced LightToBeToggled with a virtual switch. I want the switch to be toggled on and off. It doesn't seem to work. If I manually flip the switch it inverts the two trigger switches so that seems to work but when the two triggers are activated simultaneously by the scene the switch doesn't toggle.

It might be a timing issue. With a regular Z-Wave light, turning it on and off is not an instant thing: there are milliseconds between the "turn on" activation and the "light is on" confirmation.

With a Virtual Switch, the switch changes instantly. This also changes the truth of the conditions of the Combination Switches, so the expected triggers won't fire.

This kind of scenario isn't one that I planned the Combination Switch to handle. But it probably can, with a tweak. I think that the solution is to have only one Combination Switch, not two, and utilize the "Triggered while off" and "Triggered while on" events to capture the two states. With only one Combination Switch, there can't be any race condition.

Offline M2MExpert

  • Jr. Member
  • **
  • Posts: 95
  • Karma: +0/-0
Re: Combination Virtual switch plugin (UI5)
« Reply #62 on: July 29, 2012, 08:09:31 pm »
This kind of scenario isn't one that I planned the Combination Switch to handle. But it probably can, with a tweak. I think that the solution is to have only one Combination Switch, not two, and utilize the "Triggered while off" and "Triggered while on" events to capture the two states. With only one Combination Switch, there can't be any race condition.

Hmmm.... makes sense but this is too new to me. I'm not sure how I would do that. Is there a step by step example somewhere on using "triggered while on/off"? I'm pretty technical on the hardware side but the software side is a learning curve . :)

Thanks again!

- M2MExpert
Machine to Machine Communications Specialist

Offline vera_nc

  • Jr. Member
  • **
  • Posts: 70
  • Karma: +0/-0
Re: Combination Virtual switch plugin (UI5)
« Reply #63 on: July 30, 2012, 10:51:22 pm »
Now... a favour please. I know you Northerners like your thermostats.  What sorts of comparisons involving thermostats have you found yourselves needing to write Luup code for?  (Here there is a grand total of one Z-Wave thermostat on the market, and it's not compatible with most gas central heaters on sale here, mine included.)
I have a Heat Pump with Gas Emergency Heat...  The Trane Thermostat (Z-Wave) I have supports EHEAT mode (although I have a Bug open with MCV to support that in UI5) so I want to be able to force EHEAT mode when the outside temperature drops below 35F... (don't live in the North either)...

Offline M2MExpert

  • Jr. Member
  • **
  • Posts: 95
  • Karma: +0/-0
Re: Combination Virtual switch plugin (UI5)
« Reply #64 on: July 30, 2012, 11:19:31 pm »
I just installed a pair of Honeywell zwave thermostats. The docs say they support gas and oil systems. So far they are working very well and were easy to install.
- M2MExpert
Machine to Machine Communications Specialist

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Combination Virtual switch plugin (UI5)
« Reply #65 on: August 01, 2012, 07:15:37 am »
Hmmm.... makes sense but this is too new to me. I'm not sure how I would do that. Is there a step by step example somewhere on using "triggered while on/off"? I'm pretty technical on the hardware side but the software side is a learning curve . :)
Huh, it doesn't work anyway, I get a stack overflow. I can see why, but I have to think about how to break the recursion.

Offline Dolphran

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +1/-0
Re: Combination Virtual switch plugin (UI5)
« Reply #66 on: August 01, 2012, 11:34:54 am »
I'm on a Vera Lite with 1.5.408.  In my scenes which trigger a CS, when I go to edit the scene the trigger button is not shown as selected.  However the trigger does happen if the button is selected when the scene is saved.

Can anyone else confirm this behavior?  I don't know if it is a 1.5.408 problem or a CS problem or something unique to my setup.
« Last Edit: August 03, 2012, 11:34:22 am by Dolphran »

Offline thetwc

  • Full Member
  • ***
  • Posts: 226
  • Karma: +3/-0
Re: Combination Virtual switch plugin (UI5)
« Reply #67 on: August 06, 2012, 04:13:21 pm »
I'm on a Vera Lite with 1.5.408.  In my scenes which trigger a CS, when I go to edit the scene the trigger button is not shown as selected.  However the trigger does happen if the button is selected when the scene is saved.

Can anyone else confirm this behavior?  I don't know if it is a 1.5.408 problem or a CS problem or something unique to my setup.

I've got this too. Sometimes the trigger works when all the conditions are met, but sometimes I have to load up the web page and press trigger for it to work.  It seems inconsistent.
I'm running Vera lite and v1.5.408.

I just have a scene that turns on a heater if door closed, cold enough and with motion.

Thanks.

1600's Thatched Cottage in the UK tricked out with Veras, RFx, and 30+ devices.  Homewave devotee.
Lite on UI5.  (1.5.672)   |   Edge on UI7

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Combination Virtual switch plugin (UI5)
« Reply #68 on: August 06, 2012, 06:28:59 pm »
In my scenes which trigger a CS, when I go to edit the scene the trigger button is not shown as selected.  However the trigger does happen if the button is selected when the scene is saved.
Can anyone else confirm this behavior?

Sigh.

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Combination Virtual switch plugin (UI5)
« Reply #69 on: August 06, 2012, 06:34:05 pm »
Sometimes the trigger works when all the conditions are met, but sometimes I have to load up the web page and press trigger for it to work.  It seems inconsistent.

This I haven't encountered before.  It's not the intended behaviour. Can you please supply as much information as you can?

(I actually don't use this plugin, so I rely on bug reports from you lot.)

Offline thetwc

  • Full Member
  • ***
  • Posts: 226
  • Karma: +3/-0
Re: Combination Virtual switch plugin (UI5)
« Reply #70 on: August 07, 2012, 03:27:31 am »
Adding the plugin went fine, no worries, appeared as normal, the Trigger button is there too.

I added 4 conditions:
Door sensor is not tripped when armed (back door closed)
Room temperature is between 1 and 24 deg (from a 3in1)
A virtual switch is not on (my holiday switch)
And then motion is detected (from a 3in1)

Trigger is then when all 4 conditions are met.

Then I added a another scene with a trigger of the CS when the "virtual switch status changes" and "switch turns on".  This turns on a z-wave wall switch wired to a heater.

Looking at it again now, all 4 conditions are met. The light bulb on the CS is on, but it has not triggered the scene to switch the heater on.

Any ideas if I'm doing this wrong?
Thanks
1600's Thatched Cottage in the UK tricked out with Veras, RFx, and 30+ devices.  Homewave devotee.
Lite on UI5.  (1.5.672)   |   Edge on UI7

Offline electricessence

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +0/-0
Combination Virtual switch plugin (UI5)
« Reply #71 on: August 07, 2012, 04:51:24 am »
This is super awesome.
How about door lock status?

Offline shuffleshu

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: Combination Virtual switch plugin (UI5)
« Reply #72 on: August 07, 2012, 05:09:11 am »
Adding the plugin went fine, no worries, appeared as normal, the Trigger button is there too.

I added 4 conditions:
Door sensor is not tripped when armed (back door closed)
Room temperature is between 1 and 24 deg (from a 3in1)
A virtual switch is not on (my holiday switch)
And then motion is detected (from a 3in1)

Trigger is then when all 4 conditions are met.

Then I added a another scene with a trigger of the CS when the "virtual switch status changes" and "switch turns on".  This turns on a z-wave wall switch wired to a heater.

Looking at it again now, all 4 conditions are met. The light bulb on the CS is on, but it has not triggered the scene to switch the heater on.

Any ideas if I'm doing this wrong?
Thanks

Сonfirm
Its does not work.
Vera firmware 1.5.408

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Combination Virtual switch plugin (UI5)
« Reply #73 on: August 07, 2012, 05:38:08 pm »
I added 4 conditions:
[...]
Looking at it again now, all 4 conditions are met. The light bulb on the CS is on, but it has not triggered the scene to switch the heater on.

The event is thrown only when the combination switch moves from off to on. Did that happen? If it's on the whole time then no event will fire.

If you can see the combination switch change from off to on, and the event still isn't firing, can you SSH to the Vera and grab the /var/log/cmh/LuaUPnP.log contents for a second or two around the change?  That'll help me to pinpoint the bug very quickly. Let me add some more debug code to the plugin so you can send me a useful Luup log.

Edit: this (attached) is the closest that I can get to your description with the devices in my house.  With these devices, It Works For MeTM.  So unless there is something different about your devices...?
« Last Edit: August 07, 2012, 05:59:02 pm by futzle »

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Combination Virtual switch plugin (UI5)
« Reply #74 on: August 07, 2012, 05:41:33 pm »
How about door lock status?

That's a great idea. I'll add it to the pile.