The Vera Community forums have moved!

Advanced => Programming => Scene Scripting => Topic started by: futzle on June 26, 2012, 06:34:01 am

Title: Combination Virtual switch plugin (UI5)
Post by: futzle on June 26, 2012, 06:34:01 am
Update June 2018: While this plugin still (just) works, you may want to try Reactor (http://forum.micasaverde.com/index.php/topic,87484.0.html) or Program Logic (PLEG) (http://forum.micasaverde.com/index.php/board,48.0.html) if you are setting up new logic on your Vera.

I've put a plugin onto apps.mios.com that should remove the need for Luup programming for a whole range of common scenarios.

The Combination Switch (http://apps.mios.com/plugin.php?id=2388) looks like a binary light. Instead of you turning it on and off manually, the plugin watches the state of other devices on Vera. You set conditions ("This dimmer is between 10% and 70%", "That light is off"), and a threshold number. The plugin counts how many conditions are true, and when the count equals or exceeds the threshold, the Combination Switch turns on. When the count goes below the threshold, the Combination Switch turns off.

If you set the threshold to 1, you have the equivalent to a Boolean OR. If you set the threshold to the number of conditions, you have the equivalent to a Boolean AND. You can also use thresholds in between to get a kind of consensus sensing.

The Combination Switch fires events when the threshold is met and when it is lost. You can use these in notifications or you can use them as triggers for other scenes.

More in the following posts.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 26, 2012, 06:35:48 am
Here are the states that can be listed in a condition:

Watch this space. More to come.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 26, 2012, 06:37:51 am
Example scenarios:
Title: Scenario: Notification when switch status changes
Post by: futzle on June 26, 2012, 07:09:29 am
In this scenario, imagine that you have two energy-metering switches which you leave on all the time (one on a fridge and another on an aquarium heater). If the power to either one turns off, you need to be notified.
Title: Scenario: Prevent events from firing when on vacation
Post by: futzle on June 26, 2012, 07:50:05 am
In this scenario, you have a light and motion sensor outside your front door. When not on vacation, you want motion to turn on the light. When on vacation, motion doesn't turn on the light. You are using a Virtual Switch called Vacation to indicate your vacation state.

Title: Re: Combination Virtual switch plugin (UI5)
Post by: teonebello on June 26, 2012, 10:35:57 am
I have installed the version 2 and I have the error 'Combination Switch: Startup Lua Faiiled'

Is it due to the bugged version 2?

Should the version 3 fix this problem?
I have a Vera 3 with 1.5.346.

Thank you
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 26, 2012, 05:17:56 pm
I have installed the version 2 and I have the error 'Combination Switch: Startup Lua Faiiled'
Is it due to the bugged version 2?
Should the version 3 fix this problem?

Yes, and yes. Version 3 has been awaiting approval [edit] approved.

The bug in Version 2 can be avoided by ensuring that you have at least one of each of the four device types that the plugin monitors. You've probably already got a binary switch and dimmer, so create a dummy Virtual Switch and a dummy Variable Container.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: davidd1205 on June 27, 2012, 10:18:58 am
thanks for your plugin  ;)

i have a problem with my sensor sp103

i make a scene for my alarm and i would be like use your plugin for watch the status to my sp103
if tripped l'alarm don't turn on and notify me a door is open and it's ok my alrm turn on with my plugin calendar

it's possible to make a status tripped or not tripped ?

thanks
Title: Re: Combination Virtual switch plugin (UI5)
Post by: chris66 on June 27, 2012, 12:30:49 pm
@futzle, that kind of plugin should be integrated ASAP in the Vera Core application! Great!  ;)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 27, 2012, 05:45:27 pm
it's possible to make a status tripped or not tripped ?

Version 3 doesn't do this, but a future version will definitely have sensor conditions. Version 4 up has this support.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: davidd1205 on June 28, 2012, 03:29:02 am
it's possible to make a status tripped or not tripped ?

Version 3 doesn't do this, but a future version will definitely have sensor conditions.

thanks very cool job  ;)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 28, 2012, 06:12:12 am
Version 4 has been submitted with support for security sensors.

I suggest that you don't use the tripped/not tripped states for transient sensors like motion sensors. Such instantaneous events are better tied to the Trigger Poke button. Door sensors, of course, are a different beast.
Title: Scenario: Evaporative cooling shutoff when too many windows closed
Post by: futzle on June 28, 2012, 06:33:01 am
In this scenario, imagine that you have an evaporative cooling system and several door/window sensors. Evaporative cooling works best when the doors/windows are left open, so you want the system to shut down when fewer than two door/windows are open.


Bypass a sensor to pretend its door/window is open.

Tip: You can add the same condition twice, say, a big door that "counts" as two windows.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: davidd1205 on June 28, 2012, 10:04:27 am
Version 4 has been submitted with support for security sensors.

I suggest that you don't use the tripped/not tripped states for transient sensors like motion sensors. Such instantaneous events are better tied to the Trigger button. Door sensors, of course, are a different beast.

a beta for version 4 is possible ?
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on June 28, 2012, 04:28:27 pm
a beta for version 4 is possible ?

That functionality for apps.mios.com is not yet present. For bleeding edge use, you can find the plugin at code.mios.com, browse the source, and download the files yourself. In Version 4, only the new file (obviously the one with SecuritySensor in its name) changed.

If that is too daunting, you will have to wait until an MCV staff member approves the new version.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: davidd1205 on June 28, 2012, 06:21:00 pm
very very good job

my alarm work is charm with doorsensor
 :)
thanks very much ;)

Title: Scenario: Turn on a light when a door is opened, during certain hours
Post by: futzle on June 29, 2012, 07:49:51 am
In this scenario, imagine that you have a door sensor and a nearby light. When the door is opened during the evening, turn on the light. When the door is closed, turn off the light.
Bypass the door sensor to stop it from controlling the light.

Tip: The asymmetry of the door-open and door-closed scenes is deliberate: the light is turned on by the combination switch, but turning off is governed by the door alone. This is to provide better behaviour if the door is still open at the end of the evening. The light stays on even after the end of the evening, until the door is finally closed.
Title: Re: Scenario: Turn on a light when a door is opened, during certain hours
Post by: Dolphran on June 29, 2012, 01:46:35 pm
This is very cool @futzle.  I'm very glad to have Combintaion Switch in our toolbox.  I'll just point out, though, that the scenario 'Turn on a light when a door is opened, during certain hours', can be done with stock objects.  The arming/disarming of the door sensor could be done with scheduled scenes, and the light can just be triggered with the armed door sensor.
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on June 29, 2012, 06:20:40 pm
Haha, yes, if all you have is a hammer, everything starts to look like a nail.

It should be easy to alter the scenario so that it can't be done with stock scenes. I'll give it some thought.

For instance: you are already using the door's Armed/Bypassed status for something else in your house. Or you want to combine this with the Not-on-Vacation scenario, and test a second Virtual Switch.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: QNimbus on June 30, 2012, 06:47:13 am
@futzle

First of all - thanks for the great and useful plugin!

I've got a feature request though ;)....

I'm using several modules around my home that have power metering capability and I would like to switch them off based on their power usage (e.g. standby killer). So far I haven't found a good and easy to configure way - I think that your combination switch might come in handy.

Is there any way you could add a parameter that checks current power usage from a device? Or is there perhaps another easy way to accomplish what I'm trying to do?

Again, thanks for the great work so far!
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on June 30, 2012, 08:16:11 am
QNimbus, power use is definitely on the to do list. Version 6 does this.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 05, 2012, 07:10:35 am
Version 6 tests power consumption (watts). You can provide a range and the condition is true when the power consumption is inside that range. For open-ended tests (less than or equal; greater than or equal) leave a text box empty.

Give MCV a day or so to approve it; many of them are having a major holiday now.

QNimbus, if that's your four-star review on apps.mios.com, you'll need to edit it now. :)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: davidd1205 on July 05, 2012, 11:45:33 am
hello

have you a switch for a calendar with a event ? it's ideal no ?

thansk for your job

best regards
Title: Re: Combination Virtual switch plugin (UI5)
Post by: garrettwp on July 05, 2012, 11:47:13 am
hello

have you a switch for a calendar with a event ? it's ideal no ?

thansk for your job

best regards

Why not use the google calendar switch app?

- Garrett
Title: Re: Combination Virtual switch plugin (UI5)
Post by: davidd1205 on July 05, 2012, 03:16:36 pm
hello

have you a switch for a calendar with a event ? it's ideal no ?

thansk for your job

best regards

Why not use the google calendar switch app?

- Garrett

my scene has a event to ggogle calendar and 2 another switch and it's simplifiy with your plugin to control all the switch
Title: Combination Switch for Toggle Function
Post by: Dolphran on July 05, 2012, 03:29:35 pm
Here's how I used the Combination switch as a toggle:
Lets say I want to toggle a light on and off on each press of a scene controller button.
Let's call the light LightToBeToggled
Let's call the scene controller button SCB
Create Two Combination Switches - IsOff and IsOn
IsOff is set to be ON when the LightToBeToggled is OFF
IsOn is set to be ON when the LightToBeToggled is ON
Create Two Scenes - LTBTOn and LBTBOff
LTBTOn Turns on LightToBeToggled and is Triggered by Combination Switch IsOff being On
LTBTOff Turns off LightToBeToggled and is Triggered by Combination Switch IsOn being On
Now create a scene called ToggleLight
ToggleLight activates the Trigger button of BOTH IsOn and IsOff
ToggleLight is Triggered by SCB being pressed.

Now every press of SCB toggles the light. 

I actually added another virtual switch EnableToggle, which is an AND condition in both IsOn and IsOff,  This allows me to disable the toggle behavior.

Note that there is a race condition here which means that another possible outcome of this logic is the light continually blinking on and off.  Since this doesn't happen I assume that all triggers are evaluated before any scenes are activated.  This could change in a future rev of Vera, and this setup would stop working.  (I'm using UI5 1.5.408)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 05, 2012, 05:34:05 pm
Hi Dolphran,

Thanks for posting that example.  It's exactly the kind of thing that I'm trying to do with the Combination Switch.  I'll stick a link to your post from the index (third) post of this thread.

Users might find they are able to get away with only one Combination Switch in this scenario, using the "Triggered while switch is off" event, if they don't want to copy the Enable Toggle feature.

Edit: second paragraph.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: gbeeton on July 06, 2012, 02:07:15 am
Thanks for the great plugin!  It has enabled me to do something I've been wanting to do for some time.  I have numerous schedules set up for numerous devices (mostly lights and shades) to make the house look lived in when we are away.  But when we're home those schedules can be a bit annoying so they get turned off.  It can be a bit tedious enabling/disabling a few tens of schedules every time we go away/return.

Your plugin has enabled me to create one "Vacation Mode" virtual switch that turns all of the vacation schedules on or off with one click.  (I borrowed the idea from your example scenario to turn on a light on when a door is opened during certain hours - so thanks for that too.)  I have set my system up so that each scheduled event activates a virtual switch for that event.  Then I set up combination virtual switches which look for each scheduled virtual switch and the master "Vacation Mode" virtual switch to both be on.  That then is used as triggers for the scenes to activate the lights/shades.  Works slick.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 06, 2012, 05:43:13 am
Version 7 can do conditions that depend on temperature sensors, even fractional and (you'll have to test this for me) negative values.  I imagine that it also works on the temperature field of the Google Weather plugin.

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.)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Brientim on July 06, 2012, 06:10:27 am
(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.)
@futzle, I thank you for this device and believe all the requests display how useful and dynamic this is. By the way, the one thermostat you are more than likely referring too is actually compatible with most our central gas heaters, but requires a separate power supply. This is the same for several wifi models. However, none are compatible with evaporative cooler and therefore, no good during summer. I believe this will explain http://forum.micasaverde.com/index.php?topic=786.0
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 06, 2012, 07:14:48 am
requires a separate power supply.

Indeed, in my house it's about fifty-fifty whether it's easier to run a power supply to the spot where the thermostat is, or use a nearby existing 5 V line and connect an Arduino and a DS1820 temperature sensor and an optoisolator for a relay.  Probably it'll be summer before I do anything about it, at which point I will be whinging about the aforementioned evaporative cooling.  But I digress.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Brientim on July 06, 2012, 07:26:21 am
requires a separate power supply.

Indeed, in my house it's about fifty-fifty whether it's easier to run a power supply to the spot where the thermostat is, or use a nearby existing 5 V line and connect an Arduino and a DS1820 temperature sensor and an optoisolator for a relay.  Probably it'll be summer before I do anything about it, at which point I will be whinging about the aforementioned evaporative cooling.  But I digress.

And other than the odd occasions we do not have the extremes of the northern... But on those days like when hit 49 c here, an automated system on an evaporative cooler would not have worked anyway. Hence the combo switch could be used.
And I am old enough to know how to use my fingers to turn things on, off, up or down.
Title: Issues with version 6.0
Post by: kiwi on July 07, 2012, 06:18:50 am
Hi there,

I wanted to use Combination Virtual Switch plugin on my Vera 3 (1.5.408) with conditions :

- Power is at maximum 20W
- Power switch is on

All of above conditions are true (this is AND condition).

Plugins seems to work well, but when I want to use this as a trigger to switch off the plug that I monitor, it doesn't seems to work. Worse doesn't seems to notify anything.

Is there any issue / bug ?

I saw that version 7.0 seems to be in MCV process. Do you have ETA when it will be publised?

Kind regards
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on July 07, 2012, 08:42:27 am
Plugins seems to work well, but when I want to use this as a trigger to switch off the plug that I monitor, it doesn't seems to work. Worse doesn't seems to notify anything.

Have a look at the light icon on the Combination Switch. Does it ever change from lit to unlit, or vice versa? If not, then you have inadvertently created a set of conditions that is always true, or always false.

Events occur only when the Combination Switch moves from lit to unlit, or from unlit to lit. For example, if your device is off, then it is changed to on but with power more than 20 watts, there will be no event because never were both conditions simultaneously true.

If you can describe in English what you want to do, I can see if what you have programmed the Combination Switch to do matches this. At the moment it is not at all clear to me what you are expecting.

Edit: I made a combination switch with two conditions: switch power is on, power consumption is from (blank) to 20 W, threshold = 2. It lights up as expected when I vary that device's wattage (it was a dimmer, so easy to adjust its power consumption). The combination switch icon lights up mostly as expected. More on this shortly.

Then I made a scene, triggered by Combination Switch > virtual switch status changes > switch turns on, and made it turn the light off completely. This fired as expected.

(Conjecture: you are using the events "Triggered when ..." "Poked when ...". Don't use these. Use the event "virtual switch status changes".)

So, I can confirm that events do fire, and that it's possible that your scene trigger is testing for the wrong event.

That said, I think that you need to tweak the conditions that you are using. Using the conditions in my test, I found that turning the device (the dimmed light) on from cold also caused the Combination Switch event to fire, turning it right back off again, because the Watts were less than 20. My advice is to take out the Switch Power Status check, and rely only on the power. This way the event will be caused only by the power consumption transitioning from over 20 W to under 20 W, which I assume is only going to happen while the switch is turned on anyway.

Try that and see how you go.

Quote
I saw that version 7.0 seems to be in MCV process. Do you have ETA when it will be publised?

It's out of my hands. MCV are the gatekeepers. Outside weekends, updates tend to take 0 to 48 hours. Edit: Version 7 is published.
Title: Combination Virtual switch plugin (UI5)
Post by: Brientim on July 08, 2012, 04:57:07 am
I have been in hospital for the last few days. My wife and children just visited and my wife said ref automation stuff, the kids were playing with the toaster... I'd like this to automatically turn off power after x.

This is not a problem but it got me thinking about this... I can write the script or use this. This is simple as 1. 2 3.  So I will walk my wife through this and no doubt she'll discover more and more uses as time goes on.

But the extension of this thought crossed my mind is re-education or education on best use of these setup. So now I am considering try to map the bad practices around the home that become vampires on my pocket, put the condition in to correct them eg turn tv off    when no ones is present after predetermined time then notify my family by either email or SMS where there have failed to correct the conditions specified. Tie this app in with countdown timer (I need to reserve that for the sake of education as time elapsed in their face scenario), variable container and dataMine and there are the very great and useful tools to do this with.

Thanks.
My point here is this is easy I need not do it myself and my wife is very intelligent and all I need to do is get out of her way.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: kiwi on July 08, 2012, 03:29:31 pm
(...)
Try that and see how you go.

Seems after reworking all my stuff from scratch and this is working good... Thanks for your kind module !

Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 10, 2012, 06:43:48 am
Another day, another plugin. Version 8 can test the Google Weather plugin (http://apps.mios.com/plugin.php?id=45) from apps.mios.com and match the current weather condition.

Normally you will want to select a range of weather conditions (as in the screenshot here), with a threshold of 1.  To combine that with another condition ("rain or showers or storms, and also less than 10º"), use two combination switches: remember that combination switches can test other combination switches.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: garrettwp on July 10, 2012, 06:54:22 am
futzle,

You are on a roll!

- Garrett
Title: Re: Combination Virtual switch plugin (UI5)
Post by: big517 on July 10, 2012, 09:30:56 am
Loving it.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: akash1221 on July 17, 2012, 02:15:27 am
My mind is getting warped thinking about this! Typical newb problem I assume... 

:P

So here is what i am attempting to achieve:
I have a door that leads from the garage to the interior of the house. I have door sensor on it.

I want the lights to turn on (kitchen, hallway, living room) when the sensor is triggered and its night time. I don't care if the door is armed or bypassed, just triggered. However I don't want it to turn the lights on when someone is already home.

The way I'm thinking about how to achieve the home presence is to turn on a virtual switch when the door is opened. I have a remote button that will turn off all the lights and the virtual switch when I leave home.

So here is how it should all work:
I leave home turn off all the light (this turns off the virtual switch as well).
I come home, open the door, the virtual switch gets turned on and the lights get turned on.
Go about my business, my wife opens the door to go to the garage, nothing happens because the virtual switch is on.

Is that correct? And then the magic question, how do I achieve that with the combination switch or luup code?

I would greatly appreciate any insights you could provide.

Thank you,
Akash
Title: Re: Combination Virtual switch plugin (UI5)
Post by: davidd1205 on July 20, 2012, 09:38:40 am
hello

I have some code that does not work well since I put the combination switch

local partielactif = luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1","Armed",46)
local mode = luup.variable_get("urn:utz-com:serviceId:GCal1","gcalval", 70)
local controle = luup.variable_get("urn:upnp-org:serviceId::SwitchPower1","Status",74)
if (partielactif == "0") and (mode == "alarmpartielle")  then
return true
else
return false
end


this code is good but this

local partielactif = luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1","Armed",46)
local mode = luup.variable_get("urn:utz-com:serviceId:GCal1","gcalval", 70)
local controle = luup.variable_get("urn:upnp-org:serviceId::SwitchPower1","Status",74)
if (partielactif == "0") and (mode == "alarmpartielle")   and (controle == "1")then
return true
else
return false
end



have you a idea ?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: davidd1205 on July 20, 2012, 09:43:13 am
another question

i have a sensor security in a combination swith but i would like if my sensor is not triggered for 20 minutes (a time) activate a scéne

thanks David
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 20, 2012, 08:39:34 pm
Code: [Select]
local controle = luup.variable_get("urn:upnp-org:serviceId::SwitchPower1","Status",74)

There is a double colon there that looks suspiciously wrong.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 20, 2012, 08:43:56 pm
i have a sensor security in a combination swith but i would like if my sensor is not triggered for 20 minutes (a time) activate a scéne

I recommend that you use the Countdown Timer (http://forum.micasaverde.com/index.php/topic,9425.0.html) plugin for this.  Whenever the Security sensor trips, have it Restart the timer, and when the timer completes, have it activate the scene.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 20, 2012, 09:14:30 pm
I want the lights to turn on (kitchen, hallway, living room) when the sensor is triggered and its night time. I don't care if the door is armed or bypassed, just triggered. However I don't want it to turn the lights on when someone is already home.

Hi Akash,

Sorry for not replying sooner; I was on holiday and didn't have a big screen and keyboard to make a detailed reply.

This should be doable with some virtual switches and a Combination Switch.  (Also you could do it with Luup.)

I'll restate what I think your requirements are. Hopefully this matches your real requirements...

During day time, when the door opens, no lights turn on.  It doesn't matter if you are "at home" or not "at home" during the day time, the lights stay as they were (probably off).
During night time, nothing happens it you are "at home".  It doesn't matter if the door opens when you are "at home", nothing happens.
During night time AND when you are not "at home", opening the door turns on the lights.
At any time, opening the door resets the "at home" virtual switch to "on".  This is needed in case you arrive home during the daytime, and then open the door later that night. In this case you don't want any lights to come on for that second door opening.
Closing the door has no effect. It is up to you to turn off the lights manually.

Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 22, 2012, 01:36:15 am
Version 10 has been submitted, testing the Heliotrope plugin for sun position.  With this you can build sunrise-sunset tests directly into a Combination Switch.  Attached is an example that is on from sunset until roughly midnight.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Brientim on July 22, 2012, 01:50:11 am
Hello @futzle,

That is brilliant! What a fantastic combination (excuse the pun) of tools you have provided. Thank you for the great work.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: tdinardo on July 22, 2012, 09:22:55 am
I was on v7 and had to uninstall and reinstall to get to v8. I've got mine configured to auto-update, but it never does. What do you need to do to force an update of the plugin code without uninstalling and reinstalling the plugin?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: capjay on July 22, 2012, 07:36:17 pm
[...] What do you need to do to force an update of the plugin code without uninstalling and reinstalling the plugin?

see http://forum.micasaverde.com/index.php/topic,7750.msg78644.html#msg78644
Title: Re: Combination Virtual switch plugin (UI5)
Post by: tdinardo on July 22, 2012, 09:30:16 pm
Cool. Thanks.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: huib on July 25, 2012, 08:39:58 am
@futzle,

I have your plug in and it is very helpful.

But i have a querry on which i need some guidance

If i have the conditions as created in the combination switch (i.e.night plus movement) and the virtual switch is activated. This activation should reset the countdown time. 

The concept of the idea is to have during the day have a different timing than at night. ie 15 minutes light of and during the night time 2 minutes.

by using the virtual day/night switch i choose between one or the other timer

The querrie is how to reset the countime timmer triggered by the combination switch. The automatisation does not work

please advice

Huib
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 25, 2012, 06:08:15 pm
The querrie is how to reset the countime timmer triggered by the combination switch. The automatisation does not work

Huib, it's not clear to me what you mean.  I'll restate what I think you mean, and then answer that. If I'm wrong about what you want, please correct me.

At any time of day, movement turns on a light and then, after the timer's duration has completed, the light turns off.  Any movement while the light is on will restart the timer.

During daytime, the timer is 15 minutes. During night time, the timer is 2 minutes.

Note that there are no Combination Switch devices in this setup.  It's not needed.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: akash1221 on July 26, 2012, 02:54:27 am
Quote
  • Create a scene, call it Door opened. Make this scene turn the At Home virtual switch on, and make it press the Trigger button on the Away and Night Combination Switch. Add a trigger from the door sensor: A sensor is tripped.
  • Create a scene, call it Coming Home. Make this scene turn all your lights on. Add a trigger from the Away and Night Combination Switch: Triggered while virtual switch is on.

Hi Futzle,

Thank you for your reply and instructions, you interpreted my scenario perfectly! :)

I followed your instructions to a "T", but it does not seem to work...

Here is what happens...
I created all the virtual switches, combination switch and scenes.

I run the Leave Home scene followed by the Coming Home scene from MIOS, it works. All the lights turn on.

However, when I run the Leave Home scene, followed by the Door Opened scene, the lights do not turn on. This is not the expected behavior, as I am simulating the first opening of the door, not subsequent openings. It is the correct behavior for the scene to not turn the lights on after the At Home switch is on.

One issue I noticed is that in the Door Open scene, you state "make it press the Trigger button on the Away and Night Combination Switch." I select the Trigger button and then save the scene. When I go back to look at it, it's greyed out.

Is that a bug? I believe that this may be why the scenes are not functioning as they should.

Again, thank you for taking the time to assist me. :)

Akash
Title: Re: Combination Virtual switch plugin (UI5)
Post by: huib on July 26, 2012, 07:37:14 am
@futzle,

possibly i a little to vague in my querry;

1) i have in the bathroom a motion sensor
2) a scenee starts the light in case of motion
3) the change of status of the light triggers the count down times
4) the motion sensor resets the countdown time by a scene
5) at completion of the countdown times the light goes off by a scene

the lights goes on and after the set periode (15 minutes) the light goes off
bu also at night after 15 minutes the light will go off

now i have created avirtual swich (day/night) with is controled by the scedule
and in case it is day time the scene indicated above is valid

further i created a combination switch (virtual switch (day/night) and movement sensor) with triggers the combination swicht
i have created a second countdown time for 2 minutes which is also reseted by the movement sensor.
now the combination switch (if triggerd) must activate the 2 minuter timer, to have the light go out after two minutes after the last movement

in day time the line of events are; movement, light on, delay 15 minutes, light off
in night time the line of event is; night switch. movement; lights on, delay 2 miutes, light off

my problem is that i can not trigger a scene by the comnination switch to start the 2nd timer 

thanks for you advice
huib
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 26, 2012, 08:33:48 am
One issue I noticed is that in the Door Open scene, you state "make it press the Trigger button on the Away and Night Combination Switch." I select the Trigger button and then save the scene. When I go back to look at it, it's greyed out.
Is that a bug? I believe that this may be why the scenes are not functioning as they should.

It's a visual bug in MiOS (see here (http://forum.micasaverde.com/index.php/topic,9425.msg63555.html#msg63555)).  Check the scene's Advanced tab to make sure the action is really there.

I'm not 100% sure, but I think what is happening is that the moment you open the door, the Away and Night combination switch is switching off an instant too soon (because opening the door turns on the At Home virtual switch at the same moment, actually a moment before).  You can test this by temporarily taking out the action of Door Opened (step 7).  Try this and tell me if it works.  If yes, then the remaining task is to attach the deleted action to a different event (say, closing the door, or using a Countdown Timer with a two-second delay).
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 26, 2012, 08:44:03 am
possibly i a little to vague in my querry;
...
bu also at night after 15 minutes the light will go off
...
in night time the line of event is; night switch. movement; lights on, delay 2 miutes, light off

Sorry huib, I'm still not getting it.  Is the amount of delay 2 or 15 minutes at night?

I think it's a mistake to put the motion sensor in as a condition of the Combination Switch.  For momentary things you are better off using the Combination Switch's Trigger Poke button, and using the events Triggered Poked while switch on and Triggered Poked while switch off.  Keep the daytime/nighttime condition in the Combination Switch.  See the example I've been concurrently showing Akash for an example.

(But it's still possible to do away with the Combination Switch entirely and use one timer with durations that change for day and night, as I described earlier.  Do try it, because I think it's simpler than what you're trying.)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: akash1221 on July 26, 2012, 09:19:39 pm
Quote
It's a visual bug in MiOS (see here (http://forum.micasaverde.com/index.php/topic,9425.msg63555.html#msg63555)).  Check the scene's Advanced tab to make sure the action is really there.

Yes, I confirmed that in the Advanced Tab it's there.

Quote
You can test this by temporarily taking out the action of Door Opened (step 7).  Try this and tell me if it works.  If yes, then the remaining task is to attach the deleted action to a different event (say, closing the door, or using a Countdown Timer with a two-second delay).

By temporarily taking out the action, do you mean remove the door tripped trigger? (sorry for being a newb :P)

Thanks,
Akash
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 27, 2012, 07:51:35 am
By temporarily taking out the action, do you mean remove the door tripped trigger? (sorry for being a newb :P)

I mean here is your new step 7:
Quote
Create a scene, call it Door opened. Make this scene press the Trigger button on the Away and Night Combination Switch. Add a trigger from the door sensor: A sensor is tripped.

Note that it's missing something compared to the original step 7. Edit the scene so that it now matches the above, or delete it and start over from the (new) step 7.

This is just for testing. There's still a flaw but I want to see if it's helped with the reported problem.
Title: Re: Combination Switch for Toggle Function
Post by: M2MExpert on July 29, 2012, 05:54:31 pm
Here's how I used the Combination switch as a toggle:
Lets say I want to toggle a light on and off on each press of a scene controller button.
Let's call the light LightToBeToggled
Let's call the scene controller button SCB
Create Two Combination Switches - IsOff and IsOn
IsOff is set to be ON when the LightToBeToggled is OFF
IsOn is set to be ON when the LightToBeToggled is ON
Create Two Scenes - LTBTOn and LBTBOff
LTBTOn Turns on LightToBeToggled and is Triggered by Combination Switch IsOff being On
LTBTOff Turns off LightToBeToggled and is Triggered by Combination Switch IsOn being On
Now create a scene called ToggleLight
ToggleLight activates the Trigger button of BOTH IsOn and IsOff
ToggleLight is Triggered by SCB being pressed.

Now every press of SCB toggles the light. 

I actually added another virtual switch EnableToggle, which is an AND condition in both IsOn and IsOff,  This allows me to disable the toggle behavior.

Note that there is a race condition here which means that another possible outcome of this logic is the light continually blinking on and off.  Since this doesn't happen I assume that all triggers are evaluated before any scenes are activated.  This could change in a future rev of Vera, and this setup would stop working.  (I'm using UI5 1.5.408)

This is exactly what I'm needing. Thank you. 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. I can't seem to figure out why. Anyone ave any thoughts?

J
Title: Re: Re: Combination Switch for Toggle Function
Post by: futzle on July 29, 2012, 06:00:42 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

Title: Re: Re: Combination Switch for Toggle Function
Post by: M2MExpert 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.
Title: Combination Virtual switch plugin (UI5)
Post by: futzle 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.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: M2MExpert 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!

Title: Re: Combination Virtual switch plugin (UI5)
Post by: vera_nc 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)...
Title: Re: Combination Virtual switch plugin (UI5)
Post by: M2MExpert 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.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle 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.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Dolphran 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.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: thetwc 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.

Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle 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.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle 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.)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: thetwc 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
Title: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 07, 2012, 04:51:24 am
This is super awesome.
How about door lock status?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: shuffleshu 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
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle 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...?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle 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.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 08, 2012, 01:03:22 am
See my other post:
http://forum.micasaverde.com/index.php/topic,9425.45.html?PHPSESSID=787f23bceb04a188e0da322e37b3fd6f

These plug-ins are worthy of simply being part of UI5 out the box.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on August 08, 2012, 04:38:39 am
electricessence,

I've attached a file to this message that should do door lock status.  Please upload it (Apps > Develop Apps > Luup Files) and let me know how it goes. I don't have a door lock that my Vera can talk to so you'll have to test it for me.

Assuming it's good then I'll put it in the official release.
Title: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 08, 2012, 12:39:01 pm
Dude! You rock! Will do tonight!
Title: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 08, 2012, 12:40:09 pm
Sorry of I assumed you're a dude. ;)
Title: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 08, 2012, 12:45:22 pm
I have another small challenge for you.
Have you followed the Garage Door Plugin thread?
The author never made it an official plug in and it isn't easily configurable.

What really needs to happen is:
A combination device (generic or similar to a door lock) that displays a status based on one sensor, but has a button that triggers something else. The door lock UI/API is preferred since this will show up easily on any mobile app.

Any ideas?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on August 08, 2012, 05:54:01 pm
Sorry of I assumed you're a dude. ;)

You don't need to assume, the power is in your hands to find out (http://forum.micasaverde.com/index.php?action=profile;u=5055) :)

Let me know how the lock status file goes, if I got locked/unlocked the right way around, anything else you notice.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: M2MExpert on August 08, 2012, 09:15:47 pm
OK this isn't rocket science but I'm having problems getting Combination Switch to trigger a scene.

I have 2 scenes Turn Air ON and Turn Air Off. I have Combination switch monitoring the security sensors on my doors and windows. (5 sensors) If any sensors are triggered I want to trigger Air Off. When they reset I want to trigger Air On. The scenes work when manually run. The Combination Switch "light" icon turns on and off as the sensors trigger it. But when I set the scene(s) to be triggered when the virtual switch is off (or on), nothing happens.

What am I missing?
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on August 08, 2012, 10:34:14 pm
jvilla,

One of two things is happening.

One is that the Combination Switch status change (off to on, or on to off) isn't registering. To test for that, go to your Combination Switch's Notifications tab and add a notification for Virtual Switch Status Changes. See if you get the notification when you walk around the room.

Two is that you've used the wrong event on the scene. Do use "virtual switch state changes". Do not use "triggered while switch on" or "triggered while switch off".

Failing that, I will need to make a version of the plugin with extra logging, and you will have to go trawling through the Luup logs.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 09, 2012, 01:20:12 am
futzle!!!  :D

WORKED FIRST TIME!

Love the plug-in architecture!  This literally allows me to create an smart auto-lock scheme without code!!!

Now someone needs to make a plug-in that does all this in one. ;)

How to make your z-wave lock smart so it doesn't auto-lock when it's open:

Here's the method:

That's it!  I have mine set to two minutes.  8)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 09, 2012, 02:45:31 am
Just to wrap up the cool factor:
I just removed almost all of my luup code. :)
The only thing left is a simple scene luup that blocks a condition for locking the door.  I may eventually remove that as well. :)
But there are lighting scenes that had code.  All replaced by combination switches.
And as I got used to how they worked, it got easier and cleaner. :)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on August 09, 2012, 06:47:54 am
I've submitted version 11, with door locks, to apps.mios.com.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: M2MExpert on August 09, 2012, 09:00:27 am


Two is that you've used the wrong event on the scene. Do use "virtual switch state changes". Do not use "triggered while switch on" or "triggered while switch off".



I think this is my issue. I don't understand why triggered while switch is on/off won't work? If I just use state change, I won't be able to tell for sure if the switch is on or off.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 09, 2012, 05:05:32 pm
@jvilla:

This took me a second to understand.  This is why it's a "Combination SWITCH".

The trigger effectively amplifies it's usefulness... :)

Yes, there is an event for changes in state, but you can also wire up to 'trigger' the switch.

Here's my example I use today:
- I have the Heliotrope plugin.  I wired up a ComboSwitch to determine if it's 'night' time (aka light or dark).  Name: "Is Night?"
- I have a ComboSwitch that then tells me if the state of the lights in my house is bright enough.  >=40% entry light, OR >=30% living room lights. Name: "Is Enough Light?"
- Then another ComboSwitch that is ON when "Is Night?" is ON, AND "Is Enough Light?" is OFF.  Name: "Needs Auto Light?"
- I then have a scene that will set the entry light to 40% and it is triggered by the previous ComboSwitch("Needs Auto Light?") when it's triggered while ON.

I can then test this by clicking 'Trigger' on the "Needs Auto Light?" device and depending on whether it's night time and there's not enough light, it will raise the entry light to 40%.

- Next I create a scene that will click 'Trigger' on that device when I enter my code in my door lock. :)

Cool stuff.  Works like a charm.  The 'Trigger' is the key to it working without an insane amount of other virtual devices or extra code.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on August 09, 2012, 06:07:25 pm
Edit 2013-06-23: Revisionism ahead.  The "Trigger" button has been renamed "Poke" from version 15 onwards, to prevent this kind of confusion.

I think this is my issue. I don't understand why triggered while switch is on/off won't work?

You can use the Combination Switch two ways.  One is to use it as a straight condition-tester.  You configure the conditions and ignore that big "Trigger" "Poke" button on the device's dashboard.  The Combination Switch turns on or off, and you catch the state changes with the "Virtual Switch Status Changes" event.  For most cases, this is good enough.

The other way to use the Combination Switch is to use it as an enabler when some instantaneous event (such as a motion sensor tripping) comes along.  If the event happens and the conditions are not right, you want to filter the event out and ignore it.  Otherwise, you want the Combination Switch to pass the event on to activate some scene.  In this case, you make the instantaneous event push the Combination Switch's "Trigger" "Poke" button, and have all the other, enabling, conditions in the Combination Switch's configuration as before.  You don't care about the conditions until the instantaneous event Triggers the Combination Switch. Catch the event with "Triggered Poked while virtual Switch is On" or "Triggered Poked while Virtual Switch is off", and feed it through to a scene that does its business.

TL;DR version: use "Virtual switch status changes", unless you've got something pressing the Combination Switch's "Trigger" "Poke" button.

(I admit that "Trigger" is not a great name for this feature since the term is already used elsewhere in the MiOS UI. Any better suggestions, people? I thought about something whimsical like "Prod" but who wants a bunch of "Prod" buttons over their dashboard?)

Quote
If I just use state change, I won't be able to tell for sure if the switch is on or off.

I get what you're saying, but why do you need to know if the switch is (still) on or off?  What would Vera do, that it hadn't already done at the state change?  Turn the air conditioning on (or off) again?  It's already in that state, or should be.  The Combination Switch tracks the state pretty well and it should notice a change even if it happened in the middle of a Luup engine crash.

If you've got some critical piece of equipment that is safe to send redundant on/off commands to, and you want to have Vera check every five minutes Just To Be Sure, you can tie a Schedule to a scene, and make the schedule press the Combination Switch's "Trigger" "Poke" button every five minutes.  Then you'd be in Event Enabler territory and you'd be using the "Triggered Poked while virtual switch on/off" events to fire your on/off scenes.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Intrepid on August 09, 2012, 10:04:15 pm
beautiful plugin. 

How do I get more than one combination switch installed?  I installed from the app store, but I need more for other purposes..  Am I missing something?

Title: Re: Combination Virtual switch plugin (UI5)
Post by: M2MExpert on August 09, 2012, 10:49:42 pm
beautiful plugin. 

How do I get more than one combination switch installed?  I installed from the app store, but I need more for other purposes..  Am I missing something?

This is one I CAN answer. Go to the apps and click on the combination switch. You will see the switch you have already installed. Underneath that will  be a "Create Another" button click that and save and it will magically appear. Pretty cool... huh!

J
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Intrepid on August 10, 2012, 06:27:45 am
beautiful plugin. 

How do I get more than one combination switch installed?  I installed from the app store, but I need more for other purposes..  Am I missing something?

This is one I CAN answer. Go to the apps and click on the combination switch. You will see the switch you have already installed. Underneath that will  be a "Create Another" button click that and save and it will magically appear. Pretty cool... huh!

J


Ahh, I see it.  I just upgraded to UI5.  This is much easier than it was in UI4.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Intrepid on August 10, 2012, 07:15:48 am
Futzle, I must say this is one of the most useful, well thought out add-ons for vera I have seen since I started.  Great job.  And thank you.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: thetwc on August 10, 2012, 10:22:09 am
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...?

Not only a great plugin, but great support too. Thank you for all of this.

I think I was doing it wrong but now I understand when it throws the scene execute makes a lot more sense.

I made it more complicated as my heater on for given conditions scene has a delay in the same scene such that it then turns off after 20mins if the trigger hasnt fired again.  So if the motion detector remins tripped, the CS remains on, but the event countdown has already started.
I'll try it with triggered while on.

Thank you.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: TheAce on August 11, 2012, 01:22:44 pm
+1 on the great support for this very valuable add in (as I read all these posts), this is phenomenally helpful.

Two suggestions for values it would be nice to be able to add in there would be humidity (As reported by the google weather plugin) and time or time range of day.  Like "if it's after 7am and the humidity is above 65%. . ."  Or maybe (noob alert) I'm putting functions of a trigger and functions of a schedule together into one idea?

Thx!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on August 11, 2012, 10:19:43 pm
Glad you're all liking the plugin.

Two suggestions for values it would be nice to be able to add in there would be humidity (As reported by the google weather plugin) and time or time range of day.  Like "if it's after 7am and the humidity is above 65%. . ."  Or maybe (noob alert) I'm putting functions of a trigger and functions of a schedule together into one idea?

I've already talked about why I can't do time-of-day with the Combination Switch plugin (there isn't a variable with a time-of-day state that the plugin can watch).  Humidity should be a doddle though; just a renaming of the dimmer level one with some changed strings.  I'll add it to the pile.  (mcvflorin is taking a vacation so there won't be any updates to plugins for a couple of weeks.)
Title: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 13, 2012, 01:37:13 pm
@The Ace: use the heliotrope plugin instead of time of day. Probably better for most cases since anything dealing with the weather is tied to the sun.

@Futzle: why not make a time of day plugin? :)
Title: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 13, 2012, 01:39:17 pm
@Futzle:
Things to add to the combination switch:
Timer: Is Running
Timer: Is Muted
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on August 14, 2012, 11:13:43 am
@Futzle,
I hope you have given this one more consideration? You can see there is a lot of use that would come from my feature request to integrate sunset/sunrise/dusk/dawn settings into the Heliotrope plugin.

@The Ace: use the heliotrope plugin instead of time of day. Probably better for most cases since anything dealing with the weather is tied to the sun.

@Futzle: why not make a time of day plugin? :)
Title: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 15, 2012, 12:58:28 pm
@Aaron:
I agree with both of you.

Having those triggers or states is nice for scripting, but it forces non-configurable specifics. Because someone in Alaska may want a different offset than what someone in Hawaii wants. So it's better to create other devices that detect these states.
Title: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 15, 2012, 01:28:52 pm
As a developer, I think a separate plugin for night/dawn/day/dusk would be better than altering Heliotrope's simplicity.
But as a user, less plugins is better. ;)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: chris66 on August 16, 2012, 08:06:36 am
Hi Fuzzle, wonderful plugin!

Is it a way to add a test with the speed of a wind sensor (Oregon with RFXcom)?

If you need my lu_sdata or something else, just tell me!

50   08/15/12 15:46:47.101   luup_log:7: decodeMessage bits:88 data:58 1A 99 04 72 D0 C0 22 80 01 46 8A  <0x2c563680>
50   08/15/12 15:46:47.102   luup_log:7: decodeoregon <0x2c563680>
50   08/15/12 15:46:47.102   luup_log:7: Identified Oregon Anemo WTGR800 <0x2c563680>
50   08/15/12 15:46:47.103   luup_log:7: Received command direction=292.50;speed=2.20;speedav=1.80;battery=100 for 256 with ID ORE72 <0x2c563680>
50   08/15/12 15:46:47.107   luup_log:7: Key=direction;Value=292.50; <0x2c563680>
50   08/15/12 15:46:47.107   luup_log:7: SET DIRECTION from ORE72 with value 292.50 <0x2c563680>
06   08/15/12 15:46:47.108   Device_Variable::m_szValue_set device: 40 service: urn:upnp-org:serviceId:EZAnemoSensor1 variable: Direction was: 247.50 now: 292.50 #hooks: 0 upnp: 0 v:0xc95258/NONE duplicate:0 <0x2c563680>
50   08/15/12 15:46:47.123   luup_log:7: Key=speed;Value=2.20; <0x2c563680>
50   08/15/12 15:46:47.123   luup_log:7: SET SPEED from ORE72 with value 2.20 <0x2c563680>
06   08/15/12 15:46:47.123   Device_Variable::m_szValue_set device: 40 service: urn:upnp-org:serviceId:EZAnemoSensor1 variable: Speed was: 1.80 now: 2.20 #hooks: 4 upnp: 0 v:0xc95238/NONE duplicate:0 <0x2c563680>
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on August 16, 2012, 05:42:03 pm
Wind speed should be easy enough to add.  You've already given enough info: Service ID = urn:upnp-org:serviceId:EZAnemoSensor1, Variable = Speed.

Wind direction shouldn't be out of the question either; I can re-use the azimuth range testing from Heliotrope.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: big517 on August 16, 2012, 08:11:56 pm


 2
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on August 17, 2012, 05:00:33 pm
@Aaron:
I agree with both of you.

Having those triggers or states is nice for scripting, but it forces non-configurable specifics. Because someone in Alaska may want a different offset than what someone in Hawaii wants. So it's better to create other devices that detect these states.

This should be easy enough to put into the Heliotrope plugin.

Some universal standards below (measurements based on center of the sun)...

Sunrise/Sunset : centered on the horizon
Civil Twilight (Dusk & Dawn) : 6° below the horizon
Nautical Twilight (Dusk & Dawn) :  between 6° and 12° below the horizon
Astronomical Twilight (Dusk & Dawn)  :  sun is between 12° and 18° below the horizon

IMO, the way to do this in a plugin is to have these pre-defined values and provide a time-based offset. This is what we did in the EventGhost plugin. It works perfectly since you have an always shifting (based on the day, changes of the earth/sun relationship) and then you are able to offset it based on your personal need and for each scene separately: how your room is facing, how much light enters the room itself, etc

This is MUCH easier than trying to get a non-astrophysicist to do then trying to figure out the sun's placement on the horizon.

Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on August 17, 2012, 08:31:20 pm
This should be easy enough to put into the Heliotrope plugin.

Developing software for users is a three-way balancing act, and in all cases I have to balance the extra use cases that a feature enables, with the time I have to provide doing extra support for the plugin, with the cognitive load the feature puts on users of the plugin.  How "easy" a feature is to add is only a small part of the decision.  My intention with Heliotrope is to make a plugin that is so simple that it's got no configuration at all.  That's still how I feel about Heliotrope.

That said, I've always maintained that my plugins are open-source and there to be modified.  If someone wants to take Heliotrope and fork it into a full-blown astronomical orrery, then I welcome them to do so.  I'm mature enough to admit I was wrong if the user base follows the fork.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: teonebello on August 22, 2012, 09:30:43 am
OK this isn't rocket science but I'm having problems getting Combination Switch to trigger a scene.

I have 2 scenes Turn Air ON and Turn Air Off. I have Combination switch monitoring the security sensors on my doors and windows. (5 sensors) If any sensors are triggered I want to trigger Air Off. When they reset I want to trigger Air On. The scenes work when manually run. The Combination Switch "light" icon turns on and off as the sensors trigger it. But when I set the scene(s) to be triggered when the virtual switch is off (or on), nothing happens.

What am I missing?

how can you check your door and windows sensor? I can only check switcher, dimmer or virtual switch with this plug it.

It would be great if I can check my four windows sensor if they are armed, in order to inderstand if the alarm is on.

Thank you guys
Matteo
Title: Combination Virtual switch plugin (UI5)
Post by: electricessence on August 22, 2012, 12:49:49 pm
I am able to do what you are explaining. No problem.  In some cases it sounds like you don't even need a combo switch.
1) Have two scenes: Fan ON and Fan OFF.
2) Test the scenes to be sure they do what you expect.
3) In the triggers tab on the scenes select the appropriate trigger for that scene. If all you need is if a window or door opens, the sensors provide a trigger for that. If you need more complicated logic than that, then a combo switch is a good way to go.

Devices/Sensors Trigger Scenes =>
Scenes Control Devices =>
Desired Result.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: M2MExpert on August 22, 2012, 05:19:55 pm

how can you check your door and windows sensor? I can only check switcher, dimmer or virtual switch with this plug it.

It would be great if I can check my four windows sensor if they are armed, in order to inderstand if the alarm is on.

Thank you guys
Matteo

I have an Ademco Vista 20P alarm panel and am using and AD2USB interface to the Vera. I'm also using the Vista AD2USB plug-in. That plug-in creates devices for each zone that appear as security sensors in the dropdown of Combo Switch. What alarm panel are you using?

I finally got all the timing and triggering worked out with 1 combo swtch 2 scenes and a countdown timer. It works great.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on August 22, 2012, 05:39:57 pm
how can you check your door and windows sensor? I can only check switcher, dimmer or virtual switch with this plug it.

Door and window sensors come under the heading of Security Sensors.  The Combination Switch looks for devices that support the service Id "urn:micasaverde-com:serviceId:SecuritySensor1".  If none of your devices admit to supporting that service Id then you won't see that type of condition in the Combination Switch configuration. I'd need to see the D_*.xml file of the offending device to know why it is not appearing.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on September 02, 2012, 08:48:53 pm
humidity (As reported by the google weather plugin)

I've attached a Lua file that adds humidity sensors to the Combination Switch.  Since I haven't got a humidity sensor (and perhaps you don't either (http://forum.micasaverde.com/index.php/topic,1435.msg84036.html#msg84036), any more) can someone please stick this file on their Vera and test it?  Once I've had a green light I will add it to the official distribution.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on September 02, 2012, 10:01:20 pm
Version 12 submitted with Alarm Partition support (arm mode and detail arm mode).

The standard partition device shared by most of the Vera alarm plugins has two ways of indicating armed-ness.  There's a coarse-grained state "Armed" or "Disarmed", represented in the Combination Switch by the condition type "Partition Arm Status".  There's also a fine-grained state with a dozen different values, represented in the Combination Switch by the condition type "Partition Detail".

The Partition Detail state is a good candidate for a Combination Switch because there are often several kinds of "disarmed": Disarmed-and-ready-to-arm; Disarmed-but-cannot-arm-because-zone-is-tripped; Disarmed-because-zone-tripped-at-end-of-exit-delay.  Similarly there are several kinds of "armed": Away-armed; Stay-armed; Vacation-armed; also instant versions of all these.  Collecting them all into a Combination Switch with a threshold of 1 (pictured) lets you use the detail state more usefully.

Lua files attached for the impatient.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: MikeT on September 04, 2012, 01:44:46 am
Futzle,

Uploaded the humidity file you provided and it seems to do the trick, can see my Everspring Humidity sensor but haven't had a chance to test it with anything directly yet. Will try and find some space to do that this evening...
Title: Re: Combination Virtual switch plugin (UI5)
Post by: MikeT on September 04, 2012, 04:21:32 pm
Futzle, all looking good with a few test cases using Humidity and all working exactly as anticipated. You have a green light from me!!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on September 04, 2012, 05:51:45 pm
You have a green light from me!!

Thanks MikeT, it was a cut-and-paste job so it was either going to work or bomb horribly. I'll stick it into the next release today.

Edit: sorry, it slipped my mind. Version 13 has just been sent in for approval.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: ChrisK on October 06, 2012, 03:36:34 pm
@futzle, Thanks for the great plugin!  I have a feature request, if you would please add LightSensor as an input.  I am working on a scene that evaluates the outdoor light level and time of day to ramp up or down indoor lights.  This would really make things much easier.  I think others would find it useful as well.

Regards,
Chris
Title: Re: Combination Virtual switch plugin (UI5)
Post by: MikeT on October 07, 2012, 08:13:16 am
+1 on ChrisK's suggestion!
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on October 07, 2012, 08:34:59 am
Light sensors should be pretty easy. I haven't got one; what range of numbers do they produce?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: garrettwp on October 07, 2012, 09:47:33 am
futzle,

Any way of exposing the values of the plugin into the lu_sdata so I can add official support for the plugin into my app?

- Garrett
Title: Re: Combination Virtual switch plugin (UI5)
Post by: capjay on October 07, 2012, 09:59:34 am
0 to 100

Light sensors should be pretty easy. I haven't got one; what range of numbers do they produce?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 07, 2012, 05:05:27 pm
Any way of exposing the values of the plugin into the lu_sdata so I can add official support for the plugin into my app?

I'm not entirely certain why they aren't already exposed.  I've got <shortCode> names in the service file already.  That seems to have been sufficient for other plugins, but not for this one.  Mysterious.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: livingthreeday on October 08, 2012, 12:36:17 am
I am using two combo switches to give me a notification if all of the lights in a scene do not turn on (two of them are on the fringe and can be unresponsive).
The first switch is "all lights are on" that is based on the power consumption of each light (so a blown bulb will indicate that a light is off even though the switch is on)
The second is "light on fail" this one looks at the "all lights on" and a light that is in the scene that always turns on properly. I will get a notification if the trusted light is on but the " all lights on" virt switch is off.
This works great but with one small problem. Sometimes the trusted light will report to be on a split second before the "all lights on" status is recognized and I get a false "light on fail" notification.Does anyone have any ideas? Can the Virt switch response be slowed down slightly?
Thank you for a great plugin.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: garrettwp on October 08, 2012, 12:38:19 am
Any way of exposing the values of the plugin into the lu_sdata so I can add official support for the plugin into my app?

I'm not entirely certain why they aren't already exposed.  I've got <shortCode> names in the service file already.  That seems to have been sufficient for other plugins, but not for this one.  Mysterious.

Futzle,

I believe the values that are not exposed are WatchCount and Label. Are they not required?

- Garrett
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 08, 2012, 04:49:17 am
Attached is a bash at a light sensor plugin for the Combination Switch.  Can those of you with light sensors please try it out? If it's good I'll add it to the next release.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: chris66 on October 08, 2012, 04:51:02 am
Hello Futzle, did you had the time to look at this? Thanks.

Wind speed should be easy enough to add.  You've already given enough info: Service ID = urn:upnp-org:serviceId:EZAnemoSensor1, Variable = Speed.

Wind direction shouldn't be out of the question either; I can re-use the azimuth range testing from Heliotrope.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 08, 2012, 04:57:38 am
I believe the values that are not exposed are WatchCount and Label. Are they not required?

Huh, yeah, I need WatchCount.  Label is just a constructed value that you probably don't want in AutHomation.

Here's what I'll put into the service file next time I do an update.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 08, 2012, 05:04:19 am
Hello Futzle, did you had the time to look at this? Thanks.

Afraid not.  These other ones I'm doing are basically copy-and-paste so they are dead simple to do while I'm home in front of the TV.  Also I was waiting to see the fallout from the Google^H^H^H^H^H^HWeather Underground plugin.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 08, 2012, 05:29:16 am
Can the Virt switch response be slowed down slightly?

Tricky.  I don't have any control over the order that the plugin gets its notifications.  Whether you get one event or the other first is basically a crapshoot.

Try introducing a Countdown Timer into the mix.  Give it a short duration and tie events to Start and Cancel from your Combination Switches. If the timer completes then it's been bad for long enough to notify you.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: garrettwp on October 08, 2012, 05:59:23 am
futzle,

What data do you want me to show for the combination switch? I mentioned label as this is what is showed in the Vera's UI.

- Garrett
Title: Re: Combination Virtual switch plugin (UI5)
Post by: oTi@ on October 08, 2012, 09:18:38 am
Light sensors should be pretty easy. I haven't got one; what range of numbers do they produce?
0 to 100
Luminance can be reported in % and in lux (assuming the device reports against the proper Z-Wave sensor type). The HSM's report in % (range: 0-100). The Aeotec's in lux (range: 0-1000).
Title: Re: Combination Virtual switch plugin (UI5)
Post by: kveibell on October 10, 2012, 08:21:18 pm
Can you add the countdown timer to one of the selctions, just as you did for the heliotrope app? I want my lights to turn off if there has not been motion in 30 minutes.
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on October 10, 2012, 08:31:19 pm
Can you add the countdown timer to one of the selctions, just as you did for the heliotrope app?

The Combination Switch is a poor tool for that job.  The only state that the Countdown Timer has is "counting" and "not counting". If the Combination Switch were to watch a Countdown Timer then it couldn't distinguish completed timers from cancelled timers.

I'd much rather help you to use the right tool for the job than mess with the single-mission approach of the Combination Switch.
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on October 10, 2012, 08:33:31 pm
Luminance can be reported in % and in lux

Oh, good to know. Are they the same serviceID inside Vera?  If so, I will just have to pretend that they are a dimensionless value and put the onus of correct units onto the user.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: kveibell on October 10, 2012, 08:45:47 pm
What is the best way to allow the system to turn off my lights after a certain amount of time without motion?
Title: Combination Virtual switch plugin (UI5)
Post by: electricessence on October 10, 2012, 09:01:17 pm
 Some motion detectors have timeouts. Changing that setting might do it.
Otherwise just use the Timer plugin.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: PurdueGuy on October 10, 2012, 10:20:04 pm
You could also use the SmartSwitch plugin.  Topic here (http://forum.micasaverde.com/index.php/topic,11246.0.html).
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on October 10, 2012, 10:34:08 pm
What is the best way to allow the system to turn off my lights after a certain amount of time without motion?

Here is how to do it with one Countdown Timer and some scenes: http://forum.micasaverde.com/index.php?topic=9425.msg62531#msg62531

Or, this is exactly what the Smart Switch plugin does. No scenes needed.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: j0ergensen on October 15, 2012, 02:05:40 am
I seem to have found a bug between the combination switch and the weather plugin. Whenever the weather plugin reports "Light Rain" the combination switch does not seem to register. I am using UI5 and i just tried to re-install the combination switch but it still will not switch on when the status is light rain.
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on October 15, 2012, 05:48:56 am
I seem to have found a bug between the combination switch and the weather plugin.

Thanks for reporting this. I'll take a look at it when I overhaul the Google Weather plugin and make it work for Weather Underground.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Eilskov on October 16, 2012, 05:12:24 pm
First of all I am new with Micasaverde but I am getting there!

I have a problem with the plugin. I can't get it to turn a lamp on!
The switch is turned on but I can't get it to trigger the lamp on?

So the switch is on!
Under Automation -> lamp is set to switch on
Under Automation Triggers -> LampOn -> Device #27 (the switch) -> triggered while virtual switch is on

But it is not triggered? :-(
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on October 17, 2012, 04:05:15 am
Don't use the "triggered while..." Events unless you are also using the Trigger button on the Combination Switch. I wrote a better explanation about this earlier in this topic. Best if you go back and read it.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Eilskov on October 17, 2012, 04:47:02 am
Not sure I fully understand sorry, I think I use the trigger button! I configured the switch: Switch is on when  or more watched items are true.
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on October 17, 2012, 05:53:27 am
Eilskov, change your event condition to "virtual switch status changes" instead of "triggered while ..." and tell me if it works.

Edit: here is the link I suggested you read: http://forum.micasaverde.com/index.php?topic=10995.msg82348#msg82348
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Eilskov on October 18, 2012, 03:18:14 am
Works perfect!
Am I the only one experiencing that changing a trigger will not save, must delete save and then create the trigger again.
Thanks Futzle.

Why is it reacting only on status change and not trigger?

/E
Title: Re: Combination Virtual switch plugin (UI5)
Post by: oTi@ on October 18, 2012, 07:58:59 am
Luminance can be reported in % and in lux
Oh, good to know. Are they the same serviceID inside Vera?  If so, I will just have to pretend that they are a dimensionless value and put the onus of correct units onto the user.
Yup. (The unit type is actually contained in the sensor report, but I don't think this is exposed (yet).)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: garrettwp on October 25, 2012, 12:42:50 am
Futzle,

I have modified the S_CombinationSwitch1.xml to include the label variable. How are you calculating the "Label" variable. I have not had time to look deep into your code to see how this is populated. So I added the variable to the xml file. This will allow me to display this in my app. I hope you do not mind me modifying it. I have attached the file for your review and addition to the next update.

- Garrett
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 25, 2012, 01:40:56 am
The label is made up of two numbers. The first is the number of conditions that are true. The second is the number of conditions total. Both of those numbers are exposed as other variables in the service. They are just joined in a string with a / for a separator.

I'll just expose Label too, as you've done. That way it can do other jobs in the future if necessary.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: bucko on October 26, 2012, 07:45:07 am
After installing V13.0 of this combo switch, I keep getting "downloading plugin #5" when I reload my Vera 3 UI5.

What's up with this???
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 28, 2012, 01:55:45 am
After installing V13.0 of this combo switch, I keep getting "downloading plugin #5" when I reload my Vera 3 UI5.

Coincidence (http://forum.micasaverde.com/index.php/topic,8885.0.html).
Title: Re: Combination Virtual switch plugin (UI5)
Post by: dva411 on October 29, 2012, 02:01:27 am
Great Plugin.    However, I'm having a strange issue and was wondering if anyone else has seen this behavior.


My scenario:    I want to set the thermostat to my 'day setpoints' if it is daytime and someone is home.  If its nighttime and someone is home i want to set my nighttime setpoints.     If nobody is home, I want to put the thermostat into energy mode and set the setpoints accordingly.

In order to accomplish this, I downloaded the ping control.   I hardcoded the ip addresses on my phone and my wife's phone and mapped them into 2 different ping controls.

I created a combo switch that lets me know if 'someone is home' by incuding both ping controls in the combo switch and selecting that I need one to be true.  If its off, nobody is home.   If its on, someone is home.

Then I created a Daytime virtual switch.    I create a scene to switch the switch on and off using a schedule.  When its on, I'm in my day setpoint.  When its off, I should be running the night setpoint (unless I'm away)

I created another combo switch to represent "Daytime and someone is home".     I created another combo switch to represent "Nighttime and someone is home)

Then I have three separate scenes that set my setpoints on my thermostat.  One for day, night and away.     The day is triggered by the 'daytime and someone is home combo switch', the nighttime is triggered by the 'nighttime and someone is home combo switch'.   The away is triggered when somone is at home combo switch turns off.


The logic is right, and it 'almost works'.   The problem is, that when it changes the setpoints, it forces a refresh a few seconds later.    When the refresh finishes, it Changes all my virtual switches (ping sensor, combo switches, etc' to 'on mode'.   They correct themselves to the correct status about 20 seconds later.     So basically, I get this non-stop loop if nobody is home.   It sets the thermostat to the away setpoints, refeshes, at the completion of the refresh, it sets my virtual switches temporarily to look like someone is home.    Then it changes the setpoints as if someone is home and refreshes (and back and forth).

The wierd thing is, that if i don't tie the combo switches to a scene, then i don't get the strange refresh behavior.    I even tried a scene to update a virtual switch based on the combo switch status, and tied the virtual switch to my setpoint scenes.   I still got the refresh and flipping status to 'on' for a few seconds post refresh.

Because it always moves the status of the switches to 'on', I don't enter the loop if someone is home (combo switches are on and stay on after the refresh)

Help?
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on October 29, 2012, 04:30:57 am
The problem is, that when it changes the setpoints, it forces a refresh a few seconds later.    When the refresh finishes, it Changes all my virtual switches (ping sensor, combo switches, etc' to 'on mode'.   They correct themselves to the correct status about 20 seconds later.

That's beyond odd.

Combination Switches with a feedback loop (where the result of the switch changing can change the switch's input conditions) are known to cause trouble. But that doesn't sound like what you are describing.

It is probably worth catching a Luup log for the period of time in question.

Title: Re: Combination Virtual switch plugin (UI5)
Post by: Gjones on November 01, 2012, 09:28:02 am
Hi Futzle

I'm really keen to test this with my light sensor, have you had chance to modify for Lux level (0-1000) rather than %

Many Thanks

Gareth
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on November 02, 2012, 02:49:54 am
I'm really keen to test this with my light sensor, have you had chance to modify for Lux level (0-1000) rather than %

No, sorry, been in poor health for a few weeks and haven't really had the head for coding.

I bet if you just put in literal values and pretended not to see the % signs it would still work.  Try it.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Gjones on November 02, 2012, 05:08:41 am
Thanks for getting back to me. I get a Startup Lua Failed message when I try to add a light sensor to the combination switch even if I try to use a range between 100%

Hope your feeling better soon
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on November 02, 2012, 05:24:19 am
I get a Startup Lua Failed message

That's unexpected. Can you catch a Luup log so I can see the error message?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Gjones on November 02, 2012, 05:27:34 am
Very new here, let me look up finding the logs and I'll get back to you

Many Thanks
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Gjones on November 02, 2012, 07:27:55 am
I've just setup up the combination switch again and it's all working including the light level on a lux value of 500-800.

Thanks for a great plugin and the information
Title: Re: Re: Combination Virtual switch plugin (UI5)
Post by: garrettwp on November 02, 2012, 07:40:27 am
I'm really keen to test this with my light sensor, have you had chance to modify for Lux level (0-1000) rather than %

No, sorry, been in poor health for a few weeks and haven't really had the head for coding.

I bet if you just put in literal values and pretended not to see the % signs it would still work.  Try it.

Futzle,

I hope everything is ok. Get well soon!

- Garrett

Title: Re: Combination Virtual switch plugin (UI5)
Post by: ExHempKnight on November 03, 2012, 10:16:26 pm
Having a problem with this plugin, and (apologies) I am a bit too frustrated to search through this entire thread.

Vera 2, firmware v1.5.408, plugin v13.

I have a scene in which when the Combo Switch is ON, my heat setpoint is supposed to go to a certain value. The Combo Switch is activated by my Ping Sensor being tripped AND a virtual switch being ON (activated by a scene where the virtual switch is on between certain times, and off between others). The Combo Switch performs as it should when the criteria are met. However, the heat setpoint does not change.

I tried testing this by creating a simple scene where the Combo Switch being ON should turn on a virtual switch... with the same result. The Combo Switch performs as it should, yet the scene does not execute.

Help?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on November 04, 2012, 12:38:47 am
The Combo Switch performs as it should when the criteria are met. However, the heat setpoint does not change.

Did you fall into this trap (http://forum.micasaverde.com/index.php/topic,10995.msg89064.html#msg89064)?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: ExHempKnight on November 04, 2012, 12:59:46 am
The Combo Switch performs as it should when the criteria are met. However, the heat setpoint does not change.

Did you fall into this trap (http://forum.micasaverde.com/index.php/topic,10995.msg89064.html#msg89064)?

It would appear I did. Thank you very, very much. Your help will hopefully save me a lot of money in heating oil this winter.

Now I just have to learn Lua so I can write an oil consumption tracking app.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on November 07, 2012, 12:33:16 am
futzle
any plans to change the 'meets #' criteria into a AND/OR criteria?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on November 07, 2012, 01:20:28 am
any plans to change the 'meets #' criteria into a AND/OR criteria?

Nope.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: chris66 on November 07, 2012, 05:13:18 am
Hello Futzle, just seen that "Scattered Clouds" was missing in the list, let's be perfectionnist  ;)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on November 08, 2012, 08:07:57 pm
any plans to change the 'meets #' criteria into a AND/OR criteria?

Nope.

why? There is a lot of value in it for Scenes
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on November 08, 2012, 08:35:34 pm
why? There is a lot of value in it for Scenes

Patches welcome.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: SM2k on November 14, 2012, 10:10:43 am
futzle. Nice plugin. Thanks for writing it.

I fell into the trap of using "triggered while switch is on" instead of "virtual switch status changes". figured that out with a little searching. Out of curiosity, I want to trigger a scene only when the combo switch changes from off -> on but not the other way. What's the best practice for that?

I'm about to throw in some luup code to check the state of the switch inside the trigger, but thought I'd ask if I'm going down a rabbit hole for no reason.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: oTi@ on November 14, 2012, 11:17:55 am
[...] I want to trigger a scene only when the combo switch changes from off -> on but not the other way.[...]
The trigger has a New state qualifier (Switch turns on / Switch turns off).
Title: Re: Combination Virtual switch plugin (UI5)
Post by: SM2k on November 14, 2012, 12:24:36 pm
Thanks oTi@. Not sure what happened. I started with a trigger that was originally "triggered while switch is on" and edited it to be "switch status changes". When I did that I did not get the state qualifier dropdown. Seems that remove-add is a better workflow than edit.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Peter on November 18, 2012, 01:47:11 pm
Why does't work a scene when I use the combination switch as a trigger?

I have too manual klik the trigger button before It works !

How can I trigger the button between 7 and 8 AM?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on November 18, 2012, 04:41:35 pm
Peter,

It's clear in your mind what you mean, but "between 7 and 8 AM" is not an instant in time, so it's not clear what happens if the condition becomes true at, say, 7.14, then false at 7.23, then true again at 7.59.  What do you intend to happen in these edge cases?  Also, what happens at 8 AM?

Also, read this post (http://forum.micasaverde.com/index.php/topic,10995.msg82348.html#msg82348) for why you may be using the Combination Switch wrong.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Sender on November 19, 2012, 08:00:43 am
Is there any option to include my "light sensor" level with percentages?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: geoffbon on December 02, 2012, 10:53:36 pm
Thanks oTi@. Not sure what happened. I started with a trigger that was originally "triggered while switch is on" and edited it to be "switch status changes". When I did that I did not get the state qualifier dropdown. Seems that remove-add is a better workflow than edit.

I also see this exact behaviour; adding a new trigger and selecting "switch status changes" causes the qualifier to be displayed; changing an existing "triggered while..." trigger does not cause it to be displayed.  Is this a UI5 issue, or an app issue?  Otherwise, VERY useful app.
Cheers,
Geoff
Title: Re: Combination Virtual switch plugin (UI5)
Post by: PurdueGuy on December 03, 2012, 01:33:20 pm
I gave up on modifying triggers.  I delete and re-add them.  Too often they looked ok in the GUI, and after a reload, they would be back to the old trigger.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: PoPo on December 03, 2012, 08:36:59 pm
I have a light switch in my bedroom that can be associated with devices in Group 2 (two taps activate these devices) and devices in Group 3 (by tapping the switch three times).  I'm trying to control my blinds with this switch (they are Somfy blinds with a URTSII).  I set up a virtual on/off switch which will trigger the shades to go up or down when the switch is on or off.  Does anyone know how I can associate the Virtual Switch as a Group 3 device into my wall switch?  Can this be done with Combination Virtual Switch?  I am at wits end with these shades!  I'm using the Combination Virtual Switch for several other applications and love it!  Thanks for any help!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on December 04, 2012, 04:01:19 am
Is there any option to include my "light sensor" level with percentages?

Just submitted in version 14 of the plugin.  Sorry, I thought I'd already done that.  (Also includes Garrett's update to the service file, so perhaps better integration with AutHomation.)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on December 04, 2012, 04:03:40 am
Is this a UI5 issue, or an app issue?

I get it too, on several plugins.  It's either a bug in the UI5 JavaScript, or it's a malformed object in the plugins' static JSON files.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: garrettwp on December 04, 2012, 07:36:18 am
Now that it is released, I'll start to add support for the plugin. I wanted to wait until you made an official release with the changes.

- Garrett
Title: Re: Combination Virtual switch plugin (UI5)
Post by: bucko on December 16, 2012, 08:18:31 pm
Has V 14 been published in Mios apps yet? I am on V13 and see no upgrade to latest version option there.
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on December 16, 2012, 09:10:16 pm
Has V 14 been published in Mios apps yet?

I'm at work so I can't check, but given that someone has left a 0-star review saying "Version 14 doesn't work" I'd say yes.

Remember that apps don't self-update, despite promises that they do.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Cappinator on December 17, 2012, 10:56:37 am
Here's my contribution:
In the kitchen I have one mono-stable switch (sw1) next to the door to the living room, and one mono-stable switch (sw2) next to the cooking area that's against the wall.
The main kitchen light is hooked up to sw1 using a fibaro FGD 211 dimmer module, while the cooking area spots are controlled by sw2, also using a fibaro FGD 211 dimmer module.
The main kitchen light does not need to be dimmable, but I'll explain why I'm using a dimmer soon.  The cooking area spots should be dimmable, as they are also used when eating breakfast (the cooking area is right opposite the breakfast seats).
Here's what I want both switches to do:
sw1: short press toggles the main kitchen light on and off; long press toggles both lights (main + cooking area spots) on and off depending on the status of the cooking area spots.
sw2: short press toggles the cooking area spots on and off, long press is for dimming up or down.  (this is default stuff)

Why do I want this?
Basically I want sw1 to act as a switch for the main light only (no dimmer), but double in function as an all-on or all-off switch.
I also want sw2 to function normally for the cooking area spots, with dimmer.

Here's how I did it:

1. Created 2 Combination switches and called them "kitchen all-off" and "kitchen all-on"

2. "kitchen all-off" configuration:
- Dimmer level: Main_light: is in range 1% to 99%
- Switch Power Status: cooking_light: is On
Switch is on when 2 or more watched items are true.

3. "kitchen all-on" configuration:
- Dimmer level: Main_light: is in range 1% to 99%
- Switch Power Status: cooking_light: is Off
Switch is on when 2 or more watched items are true.

4. Created 2 scenes and called them "kitchen all-off scene" and "kitchen all-on scene"

5. "kitchen all-off scene" advanced configuration:
- Delay: Immediate
- Main_light: SetLoadLevelTarget: newLoadLevelTarget: 100
- Main_light: SetLoadLevelTarget: newLoadLevelTarget: 0
- Delay: 3 seconds
- Cooking_light: SetLoadLevelTarget: newLoadLevelTarget: 0
+ Trigger = kitchen all-off

6. "kitchen all-on scene" advanced configuration:
- Delay: Immediate
- Main_light: SetLoadLevelTarget: newLoadLevelTarget: 100
- Delay: 3 seconds
- Cooking_light: SetLoadLevelTarget: newLoadLevelTarget: 100
+ Trigger = kitchen all-on

Result:
Now when I press sw1 for about a second when all lights are off, I may just see it dim up a little (or not, depends how long I press), and the main lights will turn on immediately, after a few seconds, the cooking area lights will go on as well.  The slight dim of the main light is something I don't mind, but some people might find it ennoying.  In that case, you can always mess around with the fibaro's option and slow the dimming speed so it's hardly noticable.

Also, you may ask, why did I first set the dim status of the main light to 100 and immediately to 0 afterwards in step 5.  This is to prevent the fibaro to 'remember' a dim level of anything but 100%.  If the dim level is not set to 100% before turning it off, the next short press of sw1 will set the main light back to its previous dim level, and act as an all-on when that was clearly not the intention.


Great plugin, Futzle! Keep the updates coming!
It's been my favourite plug-in so far, since you can really get creative without writing any code. :)

 Cappy
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jpitts on December 23, 2012, 05:30:13 pm
I'm trying to figure out how to use your plugin to replace the functionality of the Power Event Device Plugin http://forum.micasaverde.com/index.php?topic=8291.0
Basically it triggers after a period of time that the device is no longer drawing power. Says for example washing machine is drawing power between 5 and 300 watts and and after it has finished it goes back down to 2 watts. Then I want to be able to trigger an e-mail to say "time to put into dryer"
Title: Combination Virtual switch plugin (UI5)
Post by: Brientim on December 23, 2012, 05:33:16 pm
Funny thing today I see there id a new PED in the  App Store.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on December 23, 2012, 06:05:31 pm
Cappinator, thanks for the example.  I linked to it from the first page so users can find it.

I'm trying to figure out how to use your plugin to replace the functionality of the Power Event Device Plugin
[...]
Says for example washing machine is drawing power between 5 and 300 watts and and after it has finished it goes back down to 2 watts.

This was talked about before but I couldn't find the discussion.  You might have better luck.

What you're looking for is the transition from "in range" to "out of range" with respect to power consumption.  At a very basic level you can do this with just one Combination Switch, and a notification on "Virtual Switch Status Changes" > "Switch Turns Off".

Try this simple version and see if you get any false positives with it.  It depends on how reliably your washing machine continues to draw at least 5 watts while it's running.

I bet you can use RichardTSchaefer's Program Logic plugins to do this too.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jpitts on December 23, 2012, 06:13:13 pm
I was one the one that recreated the PED plugin based on the files I found on my vera from when I had it installed before, the PED does work, but it does not show up for me under triggers.
Does anyone still have the PED V0.2 installed or downloaded the files we need are D_PED.json, D_PED.xml, I_PED.xml,S_PED.xml
 I'll try to create it based on what you said later tonight and see what results I get.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on December 23, 2012, 06:24:58 pm
I was one the one that recreated the PED plugin based on the files I found on my vera from when I had it installed before

Remember that the files that Ap15e wrote are copyrighted and that you don't automatically get to redistribute them (or derived works) without his permission.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jpitts on December 23, 2012, 07:10:17 pm
Visibility is owner and devs only , I didn't really intent to redistribute it, I can remove it if you think I should.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jpitts on December 23, 2012, 07:41:57 pm
It looks like it did trigger three times before it actually finished I can provide you some screenshots from datamine if you think it will help. I guess what I'm trying to figure out is if there is a way to say after it's detected that the watts has dropped can it wait x mins before sending the trigger then reset the timer if the watts have gone back up ?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on December 23, 2012, 08:45:09 pm
if there is a way to say after it's detected that the watts has dropped can it wait x mins before sending the trigger then reset the timer if the watts have gone back up ?

Let's say you need a two-minute delay.  Make a Countdown Timer and set its duration to 120.  Then make two scenes that are triggered by the Combination Switch.  One ("Switch turns off") starts the timer.  The second ("Switch turns on") cancels the timer.  Then set your notification for when the timer completes.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: mkrieger on December 23, 2012, 09:11:27 pm
Hi,

I'm having a heck of a time using this new plugin. I'm on a VeraLite and I can set up conditions and see the status as (2/2), but no matter what I do, I can't get the event to fire.

Here's what I did:
1) Set up a virtual switch based on dusk time. This sets correctly
2) Set up the combo switch to check dusk and a door open
3) Set the event to turn on an outside light.

I followed the directions in the start of the post - but no matter what I do or how I set things, the light won't turn on when the conditions are met - even though I can see that the 2/2 shows just fine.

Any ideas? This is driving me nuts! :)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jpitts on December 23, 2012, 10:16:21 pm
futzle, great idea on adding in a countdown timer, I think that will work. I went back to the basics and I'm testing it with a heater in my office, when the heater is between 500 and 2000 it turns the virtual device on, but I'm having the same trouble as mkrieger it doesn't seem to trigger the scene when the condition is met and it displays 1/1 I've tried both with with the virtual device is turned on and off. The scene does activate when I manually press the trigger button on the combo switch, btw I'm running on a vera3 with firmware 1.5.408
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on December 23, 2012, 11:26:05 pm
I'm having a heck of a time using this new plugin. I'm on a VeraLite and I can set up conditions and see the status as (2/2), but no matter what I do, I can't get the event to fire.

This (http://forum.micasaverde.com/index.php/topic,10995.msg90714.html#msg90714) may be relevant.

Edit:

I'm having the same trouble as mkrieger it doesn't seem to trigger the scene when the condition is met and it displays 1/1 I've tried both with with the virtual device is turned on and off. The scene does activate when I manually press the trigger button on the combo switch

Same advice.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: mkrieger on December 24, 2012, 11:33:41 am
Yup - that did it - changing the event to 'virtual switch changes..' did the trick. What a wonderful Christmas gift - thanks!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jpitts on December 28, 2012, 11:21:17 pm
I also changed mine as well and now it works. Is there anyway you can record how long it met the condition, example power between 5 -> 400w lasted for 40mins. Would it be possible to trigger if the above condition lasted more then 30 mins ?
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on December 29, 2012, 12:04:27 am
Is there anyway you can record how long it met the condition, example power between 5 -> 400w lasted for 40mins.

Combination Switches have no concept of history; it's a consequence of how it reacts to events. But you can create a Countdown Timer device and have the Combination Switch start and cancel the timer when it goes on and off, respectively. If the timer completes before it is cancelled, you got your 40 minutes.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jpitts on December 30, 2012, 08:41:23 pm
Can you add to the configuration to check time of day as well, basically I only want it to turn the virtual device on if power consumption is between 15 and 5500 and time of day is between 0800 and 2200.
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on December 30, 2012, 09:02:14 pm
Can you add to the configuration to check time of day as well

No (read my many replies to previous repetitions of this request for why, and what to do instead).
Title: Re: Combination Virtual switch plugin (UI5)
Post by: HansW on January 02, 2013, 03:57:23 pm
I cannot get the combination switch working anymore on my Vera 2 with UI5.

I had it working but my system locked up and I needed to do a factory reset, restore from backup and I have tried all you can think of since including removing and reinstalling the combination switch but no luck. It does not show the selection box on the configure tab.

Please help!!
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on January 02, 2013, 06:34:34 pm
I needed to do a factory reset, restore from backup

Ouch. Here's what I recommend.

Delete any Combination Switch devices that you have. Uninstall the plugin through the web interface. Then SSH into your Vera and run:

Code: [Select]
cd /etc/cmh-ludl
ls *Combination*

This should list about 15 files, all for the Combination Switch. Now delete them (double-check you typed this right! There are no spaces between the stars and the "Combination"):

Code: [Select]
rm *Combination*

Now, Reload the Luup engine by pressing the button where SAVE would be. Clear your browser cache.

At this point you should be completely clear of the plugin. You should be able to start again.

Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on January 02, 2013, 07:06:03 pm
@futzle
Do you have auto-update defined for your plugins ?
It seems that if a plugin has these defined and the MCV servers act up ... they can cause the Vera's that use the plugin to get into a hosed state until the MCV servers are reset (In a manner that they have yet to disclose).

Quote
Now delete them (double-check you typed this right! There are no spaces between the stars and the "Combination"):
If folks only download from the APP store it should be OK to delete everything. It will just re-download the files ... but again it assumes the MCV App Servers are working properly.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Uncle Fuzzy on January 03, 2013, 11:10:17 am
 :) So far so good! Veralite with UI5 using temperature range toggles correctly. Now if I {newest of newbies} could apply this to turning my heat pump off in existing schedules. The scenes/schedules include four thermostats; however, i would like to affect only one. Do I have to double up on my scenes/schedules and split the heat pump out or is there a way to just affect the heat pump therm? The thermostats are all Trane Z Wave...
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on January 03, 2013, 03:22:10 pm
Do you have auto-update defined for your plugins ?

I do (not that auto-update has ever worked for me).

Now if I {newest of newbies} could apply this to turning my heat pump off in existing schedules.

I'm no expert on thermostats and heaters, so I may be wrong.  But generally you will need to make a separate scene, so that you can edit its trigger (not schedule) to be affected by the output of the Combination Switch.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on January 03, 2013, 03:25:49 pm
FFS, people...

How is a "review" like this useful?  The plugin is clearly working for plenty of users.  You've provided no explanation of how it's not working for you, and you haven't bothered to report whatever bug you've found to me, either on the forum or any other way.

Seriously, rating apps has jumped the shark.

End rant.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: mfp on January 05, 2013, 06:29:10 am
Can you add to the configuration to check time of day as well

No (read my many replies to previous repetitions of this request for why, and what to do instead).

Hi I think the Combination Virtual Switch is the most powerfull plugin for Vera, I really like it.

I have read all post of this thread and cant find a practical solution. I therefore agree with jpitss. I would really like an option to check the time and the day. A check to see if the current time is past (on) or before (off) a certain time would be great. Just as I would love an option for a check for the day Friday (On or Off). This would give me a single virtual device to configure all things needed. I my current setup I loose overview, I have a lot of scenes and a lot of virtual switches to get things done. A side affect of this it makes my vera very low. Things like the countdown timer work but are not an option for a fixed period of the clock in combination with a check for the sun being under, as timers are always fixed.

I don't know if our request is even possible, but if it is I hope you will reconsider it.

Mark
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on January 05, 2013, 08:25:31 am
I don't know if our request is even possible, but if it is I hope you will reconsider it.

It's not a case of reconsidering. It's a case of time-of-day not being a state that the plugin can check, or be informed when it changes. That's a consequence of the way Vera stores device state, and of how the Combination Switch stays completely in the background until one of those state variables changes. If I modify the Combination Switch plugin to poll the current time for a condition, it would cease to be efficient.

This wish is outside of the scope of the Combination Switch. Which is why I point at scenes, schedules and the Virtual Clock (http://apps.mios.com/plugin.php?id=2838) plugin as how to fill in this functionality.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: HansW on January 06, 2013, 04:03:40 pm

Ouch. Here's what I recommend.

Delete any Combination Switch devices that you have. Uninstall the plugin through the web interface. Then SSH into your Vera and run:

Code: [Select]
cd /etc/cmh-ludl
ls *Combination*

This should list about 15 files, all for the Combination Switch. Now delete them (double-check you typed this right! There are no spaces between the stars and the "Combination"):

Code: [Select]
rm *Combination*

Now, Reload the Luup engine by pressing the button where SAVE would be. Clear your browser cache.

At this point you should be completely clear of the plugin. You should be able to start again.

Thanks for your help Futzle, it did not help unfortunately. I did as you described, no luck. Removed some other plugins and did it again, again no luck, same result. Any other pointers???

Thanks, Hans
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on January 06, 2013, 04:26:25 pm
Thanks for your help Futzle, it did not help unfortunately.

It's about a fifty-fifty chance that you've found a bug in the plugin, and fifty-fifty that you're being hit by a known bug in the Vera plugin loading code. The only way to know is for you to log into your Vera over SSH and capture some of the log file at /var/log/cmh/LuaUPnP.log. Be sure to do a Reload/SAVE on the web UI so I can see the startup from the beginning.

If you find a bug in the plugin then naturally I'll fix it.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: HansW on January 06, 2013, 04:45:12 pm
Well, do appreciate that! I have the log file, how do I get it to you?

Hans
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on January 06, 2013, 04:59:32 pm
Well, do appreciate that! I have the log file, how do I get it to you?

If you haven't unlocked PM privileges on the forum yet you can email it to debbiep at (my_forum_username) dot com.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: HansW on January 06, 2013, 05:14:25 pm
Okay, I figured it out. Enclosed are two log files, the first after the reboot with all installed and not working properly and the second right from the reboot of the clean system before installing again.

Do appreciate your help, I hate the Vera programming interface but your plugin could make the difference between throwing everything in the dust bin and giving it one more go!

Hans
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on January 06, 2013, 09:07:08 pm
Thanks Hans, I've taken a look ... and I'm flummoxed.  There aren't any error messages of any type relating to the Combination Switch.  The restart-loop appears to be because the Lua engine has detected a deadlock:

Code: [Select]
01 01/06/13 22:11:38.000 Failed to get lock(0xa571fc) Lua: LuaInterface.cpp:1870 last used LuaInterface.cpp:769  first used LuaInterface.cpp:1800  thread: 0x402 (>3220)  handler 0x422ed0 bOkToFail 0 <0x7815>
02 01/06/13 22:11:38.047 Dumping 22 locks <0x7815>
...
02 01/06/13 22:11:38.066 OL: (0x8b0f10) (>4898) ThreadedClass ../JobHandler/JobHandler.cpp l:394 time: 1:00:00a (1357506698 s) thread: 0xc04 Rel: Y Got: Y <0x7815>
01 01/06/13 22:11:38.104 Deadlock problem. going to reload and quit <0x7815>
03 01/06/13 22:11:38.146 JobHandler_LuaUPnP::Reload: deadlock Critical 1 m_bCriticalOnly 0 dirty data 1 <0x7815>
...
01 01/06/13 22:11:46.010 Main WatchDogRoutine: blocked - terminating 1 <0x8821>

Followed by a segfault:

Code: [Select]
2013-01-06 22:11:46 - LuaUPnP Terminated with Exit Code: 137
Both of the logs have repeating restarts.  I thought you said the second one was clean, without the plugin installed?

This is telling:

Code: [Select]
02 01/06/13 22:12:34.114 JobHandler_LuaUPnP::FetchMissingFiles need to download D_CombinationSwitch1.xml <0x400>
02 01/06/13 22:12:34.274 JobHandler_LuaUPnP::m_sMissingFile_set D_CombinationSwitch1.xml <0x400>
01 01/06/13 22:12:35.288 Device_LuaUPnP::LoadDeviceDoc can't load /etc/cmh-lu//D_CombinationSwitch1.xml <0x400>
02 01/06/13 22:12:35.289 JobHandler_LuaUPnP::m_sMissingFile_set /etc/cmh-lu//D_CombinationSwitch1.xml <0x400>
01 01/06/13 22:12:35.290 JobHandler_LuaUPnP::CreateDevice_LuaUPnP failed to load 84/D_CombinationSwitch1.xml so device 84 is offline <0x400>
01 01/06/13 22:12:37.315 Device_LuaUPnP::CreateServices Aborting device 84 because the topmost device has no interface <0x400>
01 01/06/13 22:12:37.316 JobHandler_LuaUPnP::CreateAllServices failed to create 84 <0x400>

It seems to be wanting to download the device file.  I don't know why it can't.

I just uninstalled the plugin from my Vera, then reinstalled it from Apps > Install Apps.  It successfully downloaded all the files and created a Combination Switch device.  No restarts.

I think I'm going to have to invoke MCV tech support here.  No plugin should be segfaulting the host process.  Wish me luck, I don't know how responsive they are any more.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on January 06, 2013, 09:26:27 pm
These problems with download files have been around since around XMas.

The dead lock seems to be broken when you remove the Auto-Update from your plugin definition. It doesn't work .... but it can make things bad for the clients when the App server acts up!

I have still not heard back from MCFlorin. I assume they will be working this week.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: shward1 on January 08, 2013, 01:06:45 pm
I am sure what I want to do is very simple, but I’ve been unable to get it working properly.  I am hoping someone can walk me through the setup, including what plug-ins are required and configuration of the plug-ins, schedules, and scenes.

Thanks in advance for the help.

L1: Light switch
M1: Motion sensor with 120 second timeout
T1: Timer

Here is the scenario:
- When L1 is off AND M1 is tripped --> turn L1 on --> set T1 to 15 mins
- When L1 is on AND M1 is tripped  --> reset T1 to 15 mins
- When L1 is on AND T1 expires --> turn L1 off
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on January 08, 2013, 03:56:57 pm
- When L1 is off AND M1 is tripped --> turn L1 on --> set T1 to 15 mins
- When L1 is on AND M1 is tripped  --> reset T1 to 15 mins
- When L1 is on AND T1 expires --> turn L1 off

Looks like this (http://forum.micasaverde.com/index.php/topic,9425.msg62531.html#msg62531).  Try that and let us know how it goes.

Edit: Actually this (http://forum.micasaverde.com/index.php/topic,9425.msg62673.html#msg62673) is a better example.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: shward1 on January 08, 2013, 04:33:26 pm
Thanks for the pointer.  What that example is missing is the reset timer if motion sensor is tripped while the light is on, am I wrong in thinking I need something like your Combination switch to accomplish this or at least it would take fewer scenes?

[Update] Another reason I believe I would want to use the Combination switch is I would want use both the light switch and the motion sensor in the examples first scene to trigger starting the timer.  I realize I could use two seperate scenes; one would start the time via the light switch and a second would start the timer via the motion sensor.

I am also misunderstanding something about your Combination switches operation.  When all conditions are met causing the switch to transition from off to on should it also trigger?  I've created a scene using the switch as the trigger, but it does not work when the switch transitions from off to on.  If I manually press the switches trigger button the scene does fire.


[Update]  futzle: I believe I finally figured it all out.  With the example you pointed out and me playing around with and finally understanding how to properly trigger a scene using your Combination switch I've got everything configured and just need to do testing to verify it is all working correctly.  Thank you for your guidance.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on January 08, 2013, 07:07:08 pm
Thanks for the pointer.  What that example is missing is the reset timer if motion sensor is tripped while the light is on, am I wrong in thinking I need something like your Combination switch to accomplish this or at least it would take fewer scenes?

You're right, I seem to have pointed you at the wrong example.  Try this one (http://forum.micasaverde.com/index.php/topic,9425.msg62673.html#msg62673) instead.

As you've figured out, you don't need a Combination Switch for your particular scenario,  though having one will give you extra options for adding additional conditions later.  I'm definitely going to rename the "Trigger" button on the Combination Switch, it was a bad choice given that triggering already has a different meaning in the Vera world.

Edit: link to correct example.

Further edit: The Smart Switch plugin is also an option.  It specializes in motion-triggering-lights just like what you want.  You may find it more convenient to use than a bunch of scenes and a Countdown Timer.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jouked on January 11, 2013, 05:10:39 am
It would be great to support the Sonos plugin from the virtual switch, or more generic HADevices. One interesting variable to watch is wether any music is playing in a room.

The following device exists for this within the Sonos plugin:
urn:schemas-upnp-org:service:AVTransport:1

Within AVTransport is the variable 'TransportState' wich can be 'STOPPED', 'PLAYING', 'PAUSED_PLAYBACK' or 'TRANSITIONING'. If I could evaluate a change in this state from the Combination switch I would use this to switch other scenes.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: HansW on January 17, 2013, 06:41:09 pm
Hello Futzle,

did you get any response yet to your request to Mios regarding my issue with the combination switch (Post 210)?

I also asked for support and they claim it is your code causing my unit to crash, underneath is their response. Maybe you overlooked something?


Hi Hans,

I've checked the logs and discussed with one of my colleagues and it seems that the issue you are encountering is caused by the Combination Switch plugin and I would suggest you uninstall it to prevent Vera's engine from crashing.
As for your request, unfortunately it cannot be done easily and requires luup code, but I've asked one of my colleagues from the development team to take a look and add the code necessary for that type of scene.
Let me know if you have other questions.

Best Regards.

--
George Diaconescu - ticketing@my.mios.com
MiCasaVerde Inc.
Technical Support Team
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on January 18, 2013, 12:43:31 am
Hi Hans,

I've had some pointers from MCV about what part of their code I am causing to crash. I will need to make a heavily-logged version for you to try to install to see if it is always crashing at the same point. When that is ready I will mention it here.

It is possible that there is interplay between the Combination Switch and another plugin that you have installed. Can you tell us what other plugins you have (and how many devices of each, if more than one)?

jouked, Media player status looks like a good idea. I will add it to the pile.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: HansW on January 18, 2013, 10:38:53 am
Thanks Futzle,

I uninstalled your plugin but still things are not ok? so either it breaks something permanently or indeed there is another plugin interfering or causing issues as well. I have installed:

Smartphone web interface 1.0
GE Caddyx Networx Alarm Panels Plugin 65.0
Virtual On/Off Switches 1.31
Wunderground Weather Plugin 1.54
RFXCOM Gateway 1.1
Day or Night 1.1
Countdown timer 5.0
Samsung TV Remote 0.3

Maybe there is a way I can completely re?nstall my system without having to reinitiate all z-wave devices? I would be willing to try that since the present automation doesnot work anyway...

Hans

Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on January 19, 2013, 01:37:05 am
I uninstalled your plugin but still things are not ok?

That's what makes me think that what you are experiencing is down to a combination of plugins, driving Vera over the edge.  The error messages point to a deadlock in plugins' "Require" statements, so the more of these plugins you have, the more likely you are to tip the scales.  The Combination Switch plugin is chock-full of require-statements, so it's more likely to be the one that crosses the tipping point.

Though if you haven't got any devices of that plugin in your Vera, then the code isn't even being run, even if the files are still present in the Vera's cmh-ludl directory.

If I were in your situation, I'd progressively remove plugin-devices until the issue goes away, then see if adding a plugin back reinstates the crash.  There may be more than one plugin that fits the bill; deadlocks always need two parties or it's not a deadlock...

Quote
Maybe there is a way I can completely re?nstall my system without having to reinitiate all z-wave devices? I would be willing to try that since the present automation doesnot work anyway...

I'm no expert on this, but I think this is what the "restore Z-Wave network" option is about on the Restore Backup page.  You'd leave the option off.  But don't take my word for it; I've never had to do what you propose.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: HansW on January 19, 2013, 01:48:19 pm
Hello Futzle,

Because my system wasn't working anymore I decided to start all over. I just uninstalled all my plugins, deleted all scenes and all plugin configuration files and did a factory reset after which all was gone except for the z-wave configuration which makes me wonder about the factory reset. But anyway, all was clean afterwards.

I started testing a simple scene which now ran like it should at the given time.
Then I installed the NX-584 plugin and configured it. It worked fine!
Then I installed the Combination switch, now I could see the configure tab!
Then I installed the day or night plugin and noticed it didnot show the proper icon (Sun or moon I believe it was before)
Then I installed the virtual switch and noticed that didnot show the proper icon either.

So I am not sure wether this means anything to you but I have included a screen shot and the log file. Sure hope this helps you in any way!

I still find it hard to believe how difficult it is to program this system to do simple things.

All I want is to have a pump run for half an hour when a motion sensor of the NX-485 is tripped when the system is armed and to have the lights go on when the system is disarmed when it is dark and off when the sun is shining .....

I still wonder why the vera guys have not made the programming interface much simpler to make it easy to program without plugins or luup like:

Enter a list of triggers, any trigger will start the automation. Triggers can be any change of state or at a certain time or regularly etc.
Enter a number if conditions, all should be met or any should be met like date/time range, temperature range, day time etc.
Enter a number of actions, one of them being setting a flag which can be used as trigger or condition.

Then anyone without programming experience could easily program any algorithm without needing complex programming plugins.

Thanks for your help!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on January 19, 2013, 08:52:13 pm
After you load new plugins an restart vera ... then you need to reload your browser window.

It has OLD cached data in it.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: mfp on January 24, 2013, 09:12:57 am
Hello Futzle,

Could you add support for the "Day or Night" Plug in? It will be a welcome alternative to the Heliotrope.

Mark
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on January 25, 2013, 05:19:47 am
Could you add support for the "Day or Night" Plug in? It will be a welcome alternative to the Heliotrope.

That should be pretty straightforward to do, sure.

I'm not doing a lot of coding at the moment (on this plugin at any rate, I'm knee-deep in writing a UPnP implementation to communicate with the Belkin WeMo devices that I have), so I can't offer an ETA.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: garrettwp on January 25, 2013, 10:05:19 am
Could you add support for the "Day or Night" Plug in? It will be a welcome alternative to the Heliotrope.

That should be pretty straightforward to do, sure.

I'm not doing a lot of coding at the moment (on this plugin at any rate, I'm knee-deep in writing a UPnP implementation to communicate with the Belkin WeMo devices that I have), so I can't offer an ETA.


Futzle, and sorry for the off topic question, but this caught my eye. Is this implementation for vera?

- Garrett
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on January 25, 2013, 06:01:11 pm
Belkin WeMo

Is this implementation for vera?

Yep.  I don't yet know how good the integration will be.  At the moment I'm still writing the UPnP discovery code.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: sjolshagen on January 27, 2013, 11:11:56 pm
I'm having a problem with the Combination Virtual Switch, but I'm not going to bet the fault lies w/the Combination Switch (it may very well be MIOS).

I've got a few Combination Switches (CS) configured to monitor the lights on the floors in my house.

My intent is this:

If all of the lights are off, I want to lower the heat on that floor. If one light turns on, I want the heat turned back up.

Created a CS for each floor and associated all of the on/off & dimmers to the CS with the definition that the switch is on if all of the items are true. Then I created a scene to lower the temp on that floor, triggered (well, it's supposed to) when the virtual switch is on. I created another scene that does the opposite and has a trigger while the virtual switch is off.

Then I turn off lights on the floor to test. And the scene never triggers...

Help!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on January 28, 2013, 04:52:42 am
This comes up every month or so. Start here: http://forum.micasaverde.com/index.php/topic,10995.msg95805.html#msg95805
Title: Re: Combination Virtual switch plugin (UI5)
Post by: sjolshagen on January 28, 2013, 06:12:11 am
This comes up every month or so. Start here: http://forum.micasaverde.com/index.php/topic,10995.msg95805.html#msg95805

Oops.. Sorry! :)

(I'm going to blame the <sarcasm>incredible</sarcasm> search capabilities of the simple machines forum, combined with my own impatience because my house was getting cold & I'm too stubborn to take the manual approach when the automated "should work, d*mn it!")
Title: Re: Scenario: Turn on a light when a door is opened, during certain hours
Post by: snovvman on February 16, 2013, 09:44:02 am
In this scenario, imagine that you have a door sensor and a nearby light. When the door is opened during the evening, turn on the light. When the door is closed, turn off the light.
  • Create a Virtual Switch. Rename it Evening.
  • Create a scene. Rename it Evening start.  Add a schedule. Make the schedule Day of Week based, every day at sunset (or whenever you consider "evening" to begin). Add an action to the schedule to turn On the Evening virtual switch.
  • Create another scene. Rename it Evening end. Add a schedule. Make the schedule Day of Week based, every day at midnight (or whenever you consider "evening" to end). Add an action to the schedule to turn Off the Evening virtual switch.
  • Optional: add more schedules and triggers to these two scenes. You may have differing definitions of "evening" based on the day of the week, or you may want to add dawn times too.
  • Create a Combination Switch. Rename it Door open during evening. Go to the Configure tab
  • Add a condition to test Virtual Switch when the Evening device is On.
  • Add a condition to test Security Sensor the door sensor is Tripped while Armed.
  • Set the threshold count to 2.
  • Create a third scene. Rename it Door is opened during evening. Add a trigger on the Combination Door open during evening > Virtual Switch Status changes > Switch turns off. Add an action to the scene that turns on the light.
  • Create a fourth scene. Rename it Door is closed. Add a trigger on the door sensor device being An Armed Sensor is Tripped > Device Armed is not tripped. Add an action to the scene that turns off the light
Bypass the door sensor to stop it from controlling the light.

Tip: The asymmetry of the door-open and door-closed scenes is deliberate: the light is turned on by the combination switch, but turning off is governed by the door alone. This is to provide better behaviour if the door is still open at the end of the evening. The light stays on even after the end of the evening, until the door is finally closed.

Step 9 confuses me: 1) Shouldn't the part I highlighted in red be "on" rather than "off"?

I am trying to understand the conditions:  The Combination switch has two states: Trigger on (all conditions met) / trigger off.  At the same time, in a scene trigger, there are options "Triggered while switch on", "Triggered while switch off", and "Switch status changes (on/off)".  Under what condition is the Combo switch "on" or "off".  And, back to step 9, wouldn't it be better to use "Triggered while switch on"?

Thanks for your patience.

Edit:

I read this post:
http://forum.micasaverde.com/index.php/topic,10995.msg82348.html#msg82348

I am still trying to understand the differentiation between the conditions and triggers.  When is the Combo switch considered "on" or "off" vs. "triggered"?  I read the two scenarios described, but are they not essentially the same?  If the conditions are met, there is a trigger, if the conditions are not met, no trigger.  What am I missing?

Thanks again.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on February 16, 2013, 04:18:53 pm
Yeah, I think "off" is a typo. I will fix the original post.

I will try to address your other question later.
Title: Re: Scenario: Turn on a light when a door is opened, during certain hours
Post by: futzle on February 16, 2013, 11:03:07 pm
I am still trying to understand the differentiation between the conditions and triggers.  When is the Combo switch considered "on" or "off" vs. "triggered"?  I read the two scenarios described, but are they not essentially the same?  If the conditions are met, there is a trigger, if the conditions are not met, no trigger.  What am I missing?

I'm going to rename the "Trigger" button on Combination Switch devices to "Poke", to avoid the confusion that I brought about by trying to re-use an existing word in a new way (bad futzle).  Wherever you see "Poke" in this description, it may still be called "Trigger" in your UI, at least until you update the plugin.

Combination switches are either "on" or "off", based purely on the number of conditions that are true.  This state is persistent: the switch stays on or off for as long as the conditions are the same.  The events "Switch state changes" ("on" and "off") monitor only this state, or rather, transitions of this state from on to off, or from off to on.  States are not themselves events, only the transitions are events.

There's no mention of poking in the preceding paragraph.  You would use the above method of controlling a Combination Switch if a given set of input states (conditions) always results in the same actions.

For instantaneous events*, there is the Poke button on the dashboard for the device.  Pressing the Poke button causes the Combination Switch's "Poked while switch on" or "Poked while switch off" events to fire, depending on the switch's current state.  Poking doesn't change the state of the switch.  All poking does is allow you to filter the event through the Combination Switch's conditions, and allow it to generate a "poked while ..." event, or to be silently dropped.  You can manually press the Poke button in the Dashboard UI, but more often you'll get a scene to do it.

You would use the above method of controlling a Combination Switch if you wanted to suppress an event under some set of conditions.  Make the (scene that is triggered by the) event press the Combination Switch's "Poke" button, and then make a second scene that is triggered by the Combination Switch's "Poked while on"/"Poked while off" events.  The second scene will fire along with the first scene, but only if the Combination Switch is on, or off.

Sometimes a problem can be solved with either poking or non-poking uses of the Combination Switch.  Your example of the door opening is one such example.  Sometimes it makes more sense to poke, sometimes not.

* Examples of instantaneous events: A certain time of day is hit.  A PIN is entered on a lock.  A Countdown Timer completes.  Someone runs a scene.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: snovvman on February 17, 2013, 12:11:09 pm
Thank you for the detailed explanation.  So the "poke" can also be described as and exception, or invoke, or simply activate.  Combination Switch is really two switches in one.  There is the conditional met switch, and the out of band, exception "activate".  Again, thank you for the explanation.

I appreciate the plug ins you provide and the support.  If you pm me your PayPal address, I would be glad to buy you a couple of beers...

Cheers.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: snovvman on February 19, 2013, 10:39:36 am
Another question on the Poke button--is it only momentary?  In other words, if I use a scene to invoke the Poke function, Poke will get "pressed" momentarily and then return to the Un-Poked state?"

I know I can use Virtual Switch to achieve on/off, but just curious if Poke can be "held down" (therefore simulating an extended Poked condition).

Thanks again.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on February 19, 2013, 02:23:31 pm
Another question on the Poke button--is it only momentary?  In other words, if I use a scene to invoke the Poke function, Poke will get "pressed" momentarily and then return to the Un-Poked state?"

It's momentary. Actually, there is no state associated with it; it's not really meaningful to talk about an unpoked state.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: pocster on March 14, 2013, 12:11:53 pm
Hi all,

Only just installed this ace app; so forgive that I haven't read the 16 screens of posts!!  :o
Simple question.
I have a 4 in one multi sensor. I have set a switch so that dim light and movement causes a light to turn on. My question is if I turn the light off (manually) surely the switch could turn it on again i.e. because its dark and senses my movement. Is there a way to 'delay' an activation for a switch again?

thanks in advance
Title: Re: Combination Virtual switch plugin (UI5)
Post by: pocster on March 14, 2013, 12:34:03 pm
Is countdown timer my friend somehow?? (did quickly go through the 16 pages)  :P
Title: Re: Combination Virtual switch plugin (UI5)
Post by: PurdueGuy on March 14, 2013, 12:56:48 pm
Hi all,

Only just installed this ace app; so forgive that I haven't read the 16 screens of posts!!  :o
Simple question.
I have a 4 in one multi sensor. I have set a switch so that dim light and movement causes a light to turn on. My question is if I turn the light off (manually) surely the switch could turn it on again i.e. because its dark and senses my movement. Is there a way to 'delay' an activation for a switch again?

thanks in advance

Smart Switch Plugin (http://forum.micasaverde.com/index.php?topic=11246.0)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on March 14, 2013, 05:06:34 pm
Is there a way to 'delay' an activation for a switch again?

I'd try to follow PurdueGuy's advice first.  You could probably assemble some kind of Rube Goldberg contraption involving a Countdown Timer, but it'll be awkward.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: pocster on March 18, 2013, 05:57:30 am
Thanks I will.
Whilst I fiddle with this I noticed when I set 'virtual switch changes state' ; when I go back to the option it always changes back to 'triggered while virtual switch is on' - I understand this may be why it doesn't work for me!!!
Is this a known bug? i.e. even after saving the trigger event is wrong??

thanks again

P.S I also notice with the light setting if I set for a trigger between 0 and 80% i.e. quite high the combination switch still shows 0/2 operative. Currently (as I sit here) the light sensor is reading '600' so I would of assumed 1/2 would of been triggered.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on March 18, 2013, 06:39:42 am
It always changes back to 'triggered while virtual switch is on' [...]
Is this a known bug?

Hell no, it's not known! Please report the steps you took to reproduce it, because this isn't something that is happening to others. Step 1 is "use <browser>"; this makes a difference.

Quote
0 and 80% [...] '600' so I would of assumed 1/2 would of been triggered.

Well, 600 isn't in the range 0 to 80...
Title: Re: Combination Virtual switch plugin (UI5)
Post by: pocster on March 18, 2013, 07:25:34 am
Hey Futzle!

Firstly. The Aeon light sensor seems to give a range 0 to 1000.
Your app asks for a percentage therefore I assume 600 would be 60%; is it not??. Is it not percentage in the app for the Aeon? i.e. do I specify 0 - > 1000 even though is says %??

Second bit. I am in the browser at <verde ip>/cmh ; I want to trigger a scene based on the combination switch AND'ing 2 triggers.
The trigger on the scene uses device 37 combination switch.
The trigger event I select is 'virtual switch changes state'.
I confirm changes . The select 'save'.
Once the unit has finished being busy I go back to edit the trigger on that scene and the trigger event has changed back to 'Triggered while virtual switch in on' ; which of course is incorrect.

I'm rather new to all this so appreciate your help and of course the app!. Therefore more than willing to help dump any logs that might help you - but you'll have too tell me what to do!  ::)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on March 18, 2013, 03:49:12 pm
The Aeon light sensor seems to give a range 0 to 1000.
Your app asks for a percentage therefore I assume 600 would be 60%; is it not??.

The % character should be ignored. It is slated to be removed at the next release. Read back in the topic for what happened. Yes, just use a literal dimensionless number.

Quote
Second bit. I am in the browser at <verde ip>/cmh

I meant: what browser are you using? I ask because if you are using IE, your Vera experience is commonly compromised, and I am curious if this is yet another example of it.

Also, what version of the Combination Switch do you have installed?

Edit: I really can't reproduce this bug.  I'll need you to describe in excruciating detail every single step.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: pocster on March 19, 2013, 05:44:09 am
Hi Futzle,

Sorry for my mis-understanding. The browser is Safari on Mac - everything appears fine visually.
Combination switch is version 14.0 ; and I have auto update enabled.

If the above all seems correct; then I will happily go through the exact detail to re-produce this :-)

Cheers
Title: Re: Combination Virtual switch plugin (UI5)
Post by: pocster on March 19, 2013, 05:51:03 am
Well!  ;)

I deleted the trigger; then simply re-added it and it works!!!. i.e. it keeps the current state. UI5/verde bug? I *suppose*.
Have seen a 'similar' thing ; where I added some Luup code to a scene save it all - go back and the code's gone!!  :-\

Enter the Luup code again, save it - *wait a magic period of time* ; go back to the scene and the Luup code exists.

 ???

Thanks for your help. And also thanks for making a fantastic app. It amazes me that Verde doesn't have a natural ability to allow AND'ing of events to cause triggers. Before finding this app; thought I was mad and just not understanding the UI ; after all (I thought) "you must be able to have triggers off multiple events - surely!"  :D
Title: Re: Combination Virtual switch plugin (UI5)
Post by: pocster on March 21, 2013, 10:35:40 am
OK! - I found heliotrope.
But when I set combination switch to use this UI5 reports 'startup Lua failed'

????

EDIT: Hmmmm, multiple Verde reboots later and it *seems* to be working!!
Title: Re: Combination Switch for Toggle Function
Post by: myk on April 11, 2013, 01:44:18 am
Here's how I used the Combination switch as a toggle:
Lets say I want to toggle a light on and off on each press of a scene controller button.
Let's call the light LightToBeToggled
Let's call the scene controller button SCB
Create Two Combination Switches - IsOff and IsOn
IsOff is set to be ON when the LightToBeToggled is OFF
IsOn is set to be ON when the LightToBeToggled is ON
Create Two Scenes - LTBTOn and LBTBOff
LTBTOn Turns on LightToBeToggled and is Triggered by Combination Switch IsOff being On
LTBTOff Turns off LightToBeToggled and is Triggered by Combination Switch IsOn being On
Now create a scene called ToggleLight
ToggleLight activates the Trigger button of BOTH IsOn and IsOff
ToggleLight is Triggered by SCB being pressed.

Now every press of SCB toggles the light. 

I actually added another virtual switch EnableToggle, which is an AND condition in both IsOn and IsOff,  This allows me to disable the toggle behavior.

Note that there is a race condition here which means that another possible outcome of this logic is the light continually blinking on and off.  Since this doesn't happen I assume that all triggers are evaluated before any scenes are activated.  This could change in a future rev of Vera, and this setup would stop working.  (I'm using UI5 1.5.408)

Well I got that race condition to happen tonight, the only way to make it stop was to pull the airgap on the physical switch for the light =)

If anyone wouldn't mind a quick sanity check on my settings and telling me where I went wrong here:

Physical Switch: KitTable
Combo Switch #1: KitIsOff (Switch Power Status = KitTable=Off)
Combo Switch #2: KitIsOn (Switch Power Status = KitTable=On)
Scene #1:KitTableOnScn (Action is KitTable=On/100%) (Trigger is KitIsOff/Virtual Switch Status Changes/Switch turns on)
Scene #2: KitTableOffScn (Action is KitTable=Off) (Trigger is KitIsOn/Virtual Switch Status Changes/Switch turns on)
Scene #3: ToggleTable (Action is "Poke" KitIsOff and KitIsOn), Trigger is <Scene Controller #1/Scene is Activated> and <Scene Controller #1/Scene is de-activate>

Appreciate anyone that may be able to help =)  Thanks
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jraitt on May 16, 2013, 12:31:30 pm
Hope someone can help here

I have an AEON multi sensor, trying to use the light sensor and ran into the > bug for triggering so I am trying to use the Combination Switch instead.

I have two virtual switches:
IS_DAY (triggered when is_night is false)
LIGHT_SENSOR > 100 (I want to trigger this from the combination switch)

I have a Combination Switch LIGHTSENSOR > 100 with two conditions:
IS_DAY = ON
AEON LIGHTSENSOR IN RANGE 100 to 1000
Switch on when 2 or more watched items are true

I created a scene LIGHTSENSOR > 100, its trigger is:
Device: "LIGHTSENSOR > 100" combination switch
Triggered while virtual switch is on
The AEON LightSensor is > 100.
The combination switch shows 2/2 triggered.
If I turn off "IS_DAY" it shows 1/2 triggered
For some reason it is not triggering the scene.
In the scene I set virtual switch "LIGHT_SENSOR > 100" but it never happens.
If I click the "Trigger" on the combination switch, it does set virtual switch "LIGHT_SENSOR > 100"

Any help appreciated
Thanks,
John


Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on May 16, 2013, 04:39:11 pm
John, follow the chain: http://forum.micasaverde.com/index.php?topic=10995.msg100151#msg100151
Title: Re: Combination Virtual switch plugin (UI5)
Post by: j0ergensen on May 19, 2013, 04:53:02 am
I seem to have found a bug between the combination switch and the weather plugin.

Thanks for reporting this. I'll take a look at it when I overhaul the Google Weather plugin and make it work for Weather Underground.

Hi futzle

Did you get a chance to look in to this? I am still having trouble with all the "light" weather conditions. The combinationswitch does not seem to trigger on these conditions.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on May 19, 2013, 05:24:56 am
Did you get a chance to look in to this? I am still having trouble with all the "light" weather conditions. The combinationswitch does not seem to trigger on these conditions.

No, and (sorry) it's low priority for me.  But you've got the source code (http://code.mios.com/trac/mios_combination-switch/browser/trunk/L_CombinationSwitch1Plugin_WeatherCondition.lua) and it should just be a case of editing the strings, so have a go at it yourself.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: j0ergensen on May 19, 2013, 10:48:01 am
Did you get a chance to look in to this? I am still having trouble with all the "light" weather conditions. The combinationswitch does not seem to trigger on these conditions.

No, and (sorry) it's low priority for me.  But you've got the source code (http://code.mios.com/trac/mios_combination-switch/browser/trunk/L_CombinationSwitch1Plugin_WeatherCondition.lua) and it should just be a case of editing the strings, so have a go at it yourself.

I think i found the error, but how do i edit the lua file? Im getting "startup lua failed" after i uploaded the file i edited in normal text editor
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on May 19, 2013, 11:46:44 am
Post your diff
Title: Re: Combination Virtual switch plugin (UI5)
Post by: j0ergensen on May 19, 2013, 01:28:53 pm
Post your diff

I think its very simple. In line 58,59 it says "Light rain/Light snow" i think it should be "Light Rain/Light Snow"

Thank you very much for your help

Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on May 20, 2013, 04:08:11 am
I think i found the error, but how do i edit the lua file? Im getting "startup lua failed" after i uploaded the file i edited in normal text editor

Chances are that you corrupted the file while editing it.  Put it in a zip file to preserve it and post the zip file here.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: mfp on May 27, 2013, 04:40:45 pm
futzle,

I made a new add on for the Combination Virtual switch plugin. It is for the Day Or Night Plugin from RichardTSchaefer http://forum.micasaverde.com/index.php/topic,12806.0.html (http://forum.micasaverde.com/index.php/topic,12806.0.html). It is available from apps.mios.com https://apps.mios.com/plugin.php?id=3166 (https://apps.mios.com/plugin.php?id=3166). This plugin has the ability to make the day longer or shorter.

Day or Night: Tests the Day or Night plugin. True when day or night condition/status matches the one selected.

It works at my site. Maybe you could review the code and add it to a future release of the Combination Virtual switch plugin.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on May 28, 2013, 06:36:04 am
Thanks mfp; I haven't had an opportunity to look at your plugin, but I am only too happy to add it to the distribution. The other files are released under GPL; are you happy for yours to be the same?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: mfp on May 28, 2013, 04:16:15 pm
Thanks mfp; I haven't had an opportunity to look at your plugin, but I am only too happy to add it to the distribution. The other files are released under GPL; are you happy for yours to be the same?

Off course I see the file just as a small change of the files you provided.  I just hope you and others keep making things better, at least that's what I really like about this community.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: electricessence on June 14, 2013, 12:28:00 pm
@futzle:
I'm not sure if anyone noticed this, but I am unable to get notifications/alerts/logs from the combination switch.
I do get notifications/alerts/logs for other devices like my door lock.  Any help with this?
I just noticed that when I click trigger on the device in question Lua reboots?  :'(
... Okay I confirmed, combination switches with notifications when triggered cause lua to crash and reboot.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 14, 2013, 06:06:14 pm
@futzle:
I'm not sure if anyone noticed this, but I am unable to get notifications/alerts/logs from the combination switch.

That's not normal. It seems that only you are affected. Capture a Luup log and post it.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: electricessence on June 14, 2013, 07:13:45 pm
Okay. I've got a USB stick in it.
How do I get the log you need?
The logs page isn't very helpful.

Title: Re: Combination Virtual switch plugin (UI5)
Post by: jbfoster on June 17, 2013, 02:45:33 am
How often does the Poll happen? Can it be changed?

BTW Very nice app. :)

Thanks
Jim
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 17, 2013, 02:54:30 am
How often does the Poll happen? Can it be changed?

The Combination Switch doesn't poll at all.  Its main function gets called by the Luup engine every time that a variable that it's watching changes.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: electricessence on June 22, 2013, 02:08:28 pm
@futzle:
Apparently I've been running swimmingly on version 10 for a while. :P
Looks like you're already to version 14.  I'm guessing that's why I'm having issues with notifications.
I use your plug in A LOT.  I have about 20 combination switches that make my home smarter. :)

So I have 3 questions.
1) Where do I download the latest files?
2) How do I upgrade my plug-in without destroying my vera configuration?
3) Are there any compatibility issues I may encounter upgrading from 10 to 14?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 22, 2013, 08:31:25 pm
I've posted version 15 to apps.mios.com.  MCV will probably let it through within 48 hours.

This is just a maintenance release, including mfp's Day or Night condition, fixing the capitalization of Light Rain/Light Snow that j0ergensen found, and changing the confusing "Trigger" button wording to "Poke" as threatened promised.

Those who installed through apps.mios.com can force an update (after it's approved by MCV) the usual way: http://your_vera:3480/data_request?id=update_plugin&Plugin=2388

electricessence, there haven't been core changes since version 10, so your crashes won't go away just by updating.  Most likely you've got a feedback loop with a device -> condition -> scene -> device that's causing a stack overflow in the Luup engine.  The Combination Switch doesn't cope well with feedback loops (see some previous posts, like this one (http://forum.micasaverde.com/index.php/topic,10995.msg108982.html#msg108982)).
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 30, 2013, 06:32:29 pm
Version 16 has been submitted to apps.mios.com.  This version adds new conditions for HVAC devices:
Title: Re: Combination Virtual switch plugin (UI5)
Post by: mtncomm1 on July 04, 2013, 02:33:20 pm
I could use some help scripting scenes for a spa. I presume I will need some combination of the combo switch and perhaps the virtual switch plugin, although control with Google Calender would be great as well.

I want to create spa scenes that switch between two different schedules, based on whether a rental cabin is Occupied or Unoccupied. When Occupied, I want the spa power to come on at 10am and turn off at 11pm. When Unoccupied, I want the spa to come on at midnight and go off at 2am, to maintain minimum filtering and to keep the water temp above freezing in the winter.

Any help would be greatly appreciated, as I have no idea what combinations of plugins I need to use to accomplish this. Thanks in advance!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 04, 2013, 05:45:05 pm
I want to create spa scenes that switch between two different schedules

Though you could do this with a virtual switch, four Combination switches and four six scenes, I reckon that the Program Logic plugins would be a better fit. PLEG has its own subforum (http://forum.micasaverde.com/index.php/board,48.0.html) where you may find a similar example already, or describe your scenario over there and beg Richard to give you the magic formula.

Edit: for completeness, here is what you'd to with a Virtual Switch and Combination Switches.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: mtncomm1 on July 05, 2013, 01:03:11 pm
Thank you futzle!

I will implement this today and see how it works. I am hoping I can change the "virtual switch" in step 1 from the virtual switch plugin to using the Google Calender plugin to specify Occupied or Unoccupied; but I will write them as per your example for starters.

Thanks again for the input and speedy reply!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: electricessence on July 21, 2013, 03:24:46 am
Okay so with your help I successfully updated the combination switch to version 16.
But sadly, as you suggested, the core code is not different and neither is the result. :(

But please consider this.  You refer to the possibility of a feedback loop.  I can't imagine how when I can add a fresh combination switch by itself, tell it to send me a notification if triggered, and ... luup restart.  What feedback loop?

My work around for this was to use your timer plug-in to actually trigger the notification (which works great) and then the trigger starts a scene which starts the timer.  But it does seem very weird that a simple notification causes this issue.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 21, 2013, 03:50:06 am
You refer to the possibility of a feedback loop.  I can't imagine how when I can add a fresh combination switch by itself, tell it to send me a notification if triggered, and ... luup restart.  What feedback loop?

I'm totally guessing. Without (a) a complete description of how you have set up this combination switch and what actions it triggers, and (b) a copy of the Luup log at the moment of the restart, I can't help you debug this.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: electricessence on July 21, 2013, 08:22:30 pm
I happy with my work around.  No need to help debug my problem.
Out of courtesy I'm simply reporting the problem to you.

a)  The description can't any simpler than:
  1. Add a new combination switch.
  2. Create a notification in the switch's "Notification" tab.
      Simply select "Poked while virtual switch is off".
  3. Poke it. ... and ...
   .... Luup restarts, and no notification is sent.
b) I have no idea how to get this log.  I do have a 4GB USB dongle on my Vera, but I am not aware of how to access the log.  If you could point me in the right direction here (getting the log), I might be able to figure this out on my own.  If it's something that I can fix, then great.  If I do find something potentially relative to the combination switch, I will pass you the information.

And as always, huge thanks for your plugins.  My home is smarter because of them.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 21, 2013, 08:51:42 pm
How to get the Luup log:

http://wiki.micasaverde.com/index.php/Logs

http://wiki.micasaverde.com/index.php/Luup_Debugging

http://wiki.mios.com/index.php/View_Logfiles

http://forum.micasaverde.com/index.php?topic=8549.0

http://forum.micasaverde.com/index.php/topic,13246.0.html

http://forum.micasaverde.com/index.php?topic=13477.0
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 21, 2013, 08:57:41 pm
  1. Add a new combination switch.
  2. Create a notification in the switch's "Notification" tab.
      Simply select "Poked while virtual switch is off".
  3. Poke it. ... and ...
   .... Luup restarts, and no notification is sent.

Thank you for the extra detail (in particular, which event the notification is tracking). This level of detail is necessary for me to try to reproduce the crash. I'll see if I can.

See my previous post for some Google search results on getting the Luup log. Each of those links shows one of about four ways to get the log.

Edit: Yes, I can reproduce the notification crash.  Wow, it's sudden and hard.  Here is the log:

Code: [Select]
08 07/22/13 20:28:03.443 JobHandler_LuaUPnP::HandleActionRequest device: 247 service: urn:futzle-com:serviceId:CombinationSwitch1 action: Trigger <0x2fc7e680>
08 07/22/13 20:28:03.444 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=247 <0x2fc7e680>
08 07/22/13 20:28:03.444 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:futzle-com:serviceId:CombinationSwitch1 <0x2fc7e680>
08 07/22/13 20:28:03.444 JobHandler_LuaUPnP::HandleActionRequest argument action=Trigger <0x2fc7e680>
08 07/22/13 20:28:03.445 JobHandler_LuaUPnP::HandleActionRequest argument rand=0.5803000093280569 <0x2fc7e680>
06 07/22/13 20:28:03.445 Device_Variable::m_szValue_set device: 247 service: urn:futzle-com:serviceId:CombinationSwitch1 variable: Trigger was: EMPTY now: 1 #hooks: 1 upnp: 0 v:(nil)/NONE duplicate:0 <0x2fc7e680>


2013-07-22 20:28:03 - LuaUPnP Terminated with Exit Code: 245

I'm not sure that I can debug this.  The last log message is normal, then ... terminated.  I think I'm going to have to hand it up to MCV and see if they have any ideas.  A plugin should never be able to crash its host environment.

Thanks for discovering this crash.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: billy11 on September 16, 2013, 12:30:38 am
I just loaded combination switch v16. I tested it as watching other events. Woarked as adverised but it wasn't until I wanted to send a notification using combination switch trigger. Since Poke can be tested I picked "Poked while virtual switch is on" and I configured "Switch is on when 0 and the switch stays always on. So far so good. I may or may not to pick any user for a notification. Everything is saved. When I test it and I press the Poke button it crashes my system. See a log below. But the trigger "virual switch status changes" on or off contolled by another device seems to be working fine. Notifications are sent. It looks that using the Poke button to fire a trigger crashes system when it comes to send a notification.  Or am I missing something? This seems to be similar to the problem with version 16 reported in the previous post. Case is Very simple.
1. Add notification to the Combination Switch "Poked while virtual switch is on" (or off)
2. Press Poke button and system becomes busy. In the it reports a crash and reboot.


08   09/16/13 0:03:27.951   JobHandler_LuaUPnP::HandleActionRequest device: 10 service: urn:futzle-com:serviceId:CombinationSwitch1 action: Trigger <0x2db29680>
08   09/16/13 0:03:27.952   JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=10 <0x2db29680>
08   09/16/13 0:03:27.952   JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:futzle-com:serviceId:CombinationSwitch1 <0x2db29680>
08   09/16/13 0:03:27.952   JobHandler_LuaUPnP::HandleActionRequest argument action=Trigger <0x2db29680>
08   09/16/13 0:03:27.953   JobHandler_LuaUPnP::HandleActionRequest argument rand=0.9270385435449683 <0x2db29680>
06   09/16/13 0:03:27.953   Device_Variable::m_szValue_set device: 10 service: urn:futzle-com:serviceId:CombinationSwitch1 variable: Trigger was: 0 now: 1 #hooks: 1 upnp: 0 v:(nil)/NONE duplicate:0 <0x2db29680>


2013-09-16 00:03:27 - LuaUPnP Terminated with Exit Code: 245



2013-09-16 00:03:28 - LuaUPnP crash

01 2013-9-15 23:28:34 caught signal 11 <0x2dfd9680>
01 2013-9-15 23:34:38 caught signal 11 <0x2d64d680>
01 2013-9-15 23:35:48 caught signal 6 <0x2c443680>
01 2013-9-15 23:38:13 caught signal 6 <0x2c1e1680>
01 2013-9-15 23:59:50 caught signal 6 <0x2bfd5680>
01 2013-9-16 0:3:27 caught signal 11 <0x2db29680>
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on September 16, 2013, 01:03:03 am
This seems to be similar to the problem with version 16 reported in the previous post.

Yes, this is exactly the same crash that electricessence reported three posts up. Unfortunately I cannot fix this without help from Micasaverde. The crash is inside their LuaUPnP executable, which is closed-source. The logs aren't detailed enough to identify what is going on.

Until there is some movement from MCV I can only recommend that you either don't use Vera's built-in notifications, or don't use the Poke button on a Combination Switch.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on September 16, 2013, 08:23:17 am
What type of notification ?
   MCV ?
   Vera Alerts ?
   Push ?

Do you have any mirroring of notifications to an external database ?

All of the notification systems require communications to a 3rd party server. If the communications on these links backs up ... and more requests come in ... Vera will see this as hung communications ... and cause it to restart.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on September 16, 2013, 05:26:25 pm
What type of notification ?
   MCV ?

The reported crash has been seen only with Vera's built-in Notification system (i.e., the one that many of us consider to be so useless that we don't even test it any more). It's definitely not a timeout because it happens instantly when you trigger the notification.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on September 16, 2013, 08:20:33 pm
If there were queued up notifications ... because of a MCV server problem ... one more can causes Vera to think it's in a deadlock, or getting behind,  and restart.
 
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on September 16, 2013, 10:53:26 pm
If there were queued up notifications ...

I believe that. In this case I was able to reproduce the crash on my Vera which never uses notifications of any sort normally. So it's something else.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: resq93 on October 20, 2013, 09:08:01 am
I have been using this great plugin for sometime and maybe this has already been answered somewhere above, but, is the re some way to have multiple AND and OR conditions? I find that I'm limited without.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on October 20, 2013, 12:26:21 pm
@futzle
I am sorry ... I did not mean notification in the Vera sense ... I meant if there was a call_action to notify the plugin ... 
If the Actions (specified in I_XXX.xml) use run vs job ... if to many runs are made  ... it will trigger a restart .. apparently there is no queue ... so it triggers an overrun restart. 
The Job has a queue to queue up requests.

@resq93
That is why I wrote PLEG.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on October 25, 2013, 06:21:39 pm
@resq93
That is why I wrote PLEG.

The complexity of PLEG make it difficult for beginners to adopt/grasp, let alone create complex scenes.

Will you be creating a UI to layer on top to make it simple for the non-coder to use?  Most people really need only basic IF-THEN-ELSE (one step beyond what Vera's native UI provides)

For example, I want to create a very basic motion tracking scene in order to know when to trigger a siren. This will help eliminate false-positives. To do this in PLEG is complex even though the IF-THEN-ELSE is very simple...

IF (Garage Door = tripped) and (Garage Motion = tripped) and (Vacation Mode = ON) THEN (Siren = ON)

... to do something even this simple in PLEG it requires actual programming mindset - create variables (inputs), write code (conditions - using programming syntax most non-coders do not understand).

I think the UI/layout of Combination Switch is something non-coders easily understand and gravitate to.

just my $0.02
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 25, 2013, 06:49:38 pm
The complexity of PLEG make it difficult for beginners to adopt/grasp, let alone create complex scenes.

Once a programmer had a problem.  "I know," he said, "I will create a domain-specific language to express the logic."  Now he has two problems.

(In all seriousness, PLEG is great for the cases where the Combination Switch leads to device-overload.  I use my own dogfood Combination Switches and Countdown Timers everywhere and I admit they almost outnumber the real devices.  I think it's great that there are at least two solutions to the shortcomings in the standard Vera UI.  It gives users so much more choice.)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on October 29, 2013, 02:51:57 am
futzle
It would be great if you could enhance your Combi Switch just a bit to fill the gap that most people need... simple AND / OR combinations. I suspect with the way you have it today, you must check for each condition to be true? Maybe you could modify it to support AND/OR for each condition check?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 29, 2013, 05:11:20 am

AND / OR combinations.

I'm leaving that territory to PLEG. That said, if you're determined you can already do any arbitrary logic with multiple Combination Switches. Set a threshold of 1 for OR, and a threshold equal to the number of conditions for AND. To combine AND with OR in the same condition, use the state of one Combination Switch as a condition in the other.

If you've ever done complicated Smart Playlists in iTunes, it's exactly the same.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: mxg on November 13, 2013, 09:13:45 pm
futzle

Thanks so much for this plugin!! I used this (5 of them) in combination with virtual clock (x6) and virtual switch (x8) to create a series of states and temperature/time zones that control my thermostat. Depending on the time of day and/or if the house is occupied or not, the thermostat will be set to 5 different temperatures (16oC through to 20oC) throughout the day and night.

I've read this entire thread and understand why time can't be used as a condition. However, could the Combo switch not be configured to check the virtual clock directly? (active or inactive states)
I ask this as because this would kill 6 virtual switches + 6 scenes in my set-up.

Again, great plugin!!
 :)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: garrettwp on November 13, 2013, 10:29:04 pm
Or use pleg and you only have one device.

- Garrett

Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on November 14, 2013, 03:38:20 am

However, could the Combo switch not be configured to check the virtual clock directly? (active or inactive states)

The Virtual Clock device appears as a security sensor. The Combination Switch can already use security sensors as conditions, which should include all Virtual Clock devices. Or are you looking for something more?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: mxg on November 14, 2013, 06:34:56 am

However, could the Combo switch not be configured to check the virtual clock directly? (active or inactive states)

The Virtual Clock device appears as a security sensor. The Combination Switch can already use security sensors as conditions, which should include all Virtual Clock devices. Or are you looking for something more?

Nope. Thanks for pointing me in the right direction. I didn't know it was a security sensor. I'll check it out.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jimpapa on January 03, 2014, 04:25:45 pm
Has anyone got the Combination Switch to work with the iPhone location Plugin ?

I wanted to do a quick scene at night and away using the combo switch... but.. the iPhone plugin looks like it is not a device the combo switch will deal with ...
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on January 03, 2014, 05:20:36 pm
You can use PLEG ...
The need for multiple Countdown Timer and Combo Switch plugins motivated PLEG.


Title: Re: Combination Virtual switch plugin (UI5)
Post by: jimpapa on January 03, 2014, 05:43:33 pm
Your right... I really need to Try PLEG again..  I am in exactly that boat!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: chris66 on January 04, 2014, 11:01:18 am
Richard, will PLEG works with UI6 ???
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on January 04, 2014, 11:03:33 am
I do not know ... I do not have access to UI6.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: garrettwp on January 04, 2014, 01:15:21 pm
No one has or knows anything about the upcoming ui. More details should become available at ces.

- Garrett

Title: Re: Combination Virtual switch plugin (UI5)
Post by: SM2k on January 10, 2014, 02:23:26 pm
Has anyone got the Combination Switch to work with the iPhone location Plugin ?

I wanted to do a quick scene at night and away using the coho switch... but.. the iPhone plugin looks like it is not a device the coho switch will deal with ...

Sorry my response has nothing to do with the combination switch, but could possibly lead you in the right direction. you could put something like this into your startup lua.

Code: [Select]
function runScene(sceneId)
  luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "RunScene", {SceneNum=sceneId}, 0)
end

function handlePhone(lul_device, lul_service, lul_variable, lul_value_old, lul_value_new)
  if tonumber(lul_value_new) == 1 then
    runScene(RELEVANT_SCENE_ID)
  end
end

luup.variable_watch("handlePhone", "urn:upnp-org:serviceId:IPhoneLocator1", "Present", PHONE_DEVICE_ID)

In that example code you would need to replace PHONE_DEVICE_ID and RELEVANT_SCENE_ID with whatever you were trying to trigger. Also, note that code would run a scene when the device changed from away to present, which also might not be what you're trying to do.

Basically the iPhone locator plugin uses the "Present" variable, which is pretty specific to that app. If the plugin had been derived from a security sensor, and thus used ("urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped") it might have worked with the combo switch plugin without any further effort.

Anyways, I hope that helps.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jimpapa on January 10, 2014, 04:54:22 pm
Thank you SM2K,

I ended up using this snippet of code:

if (luup.is_night()) then
  return true
else
  return false
end

With the Trigger using the iPhone locator "away"

It does work .. when I leave the office at night the scene runs.. but not during the day when I come and go.


Title: Re: Combination Virtual switch plugin (UI5)
Post by: aaronsquire on February 06, 2014, 02:13:56 pm
I do not know ... I do not have access to UI6.

It's available now http://firmware.getvera.com (http://firmware.getvera.com) but I wouldn't download it. I was naive and thought going through main www.getvera.com / Support and Update Firmware it would be a public release. I ended up getting UI6 and now I'm reading every where it's beta.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: garrettwp on February 06, 2014, 02:45:32 pm
We know it's available. It's more the fact that no official announcement has been done on the forum. Most of us will not upgrade for this reason and the fact that there is still a lot of work to be done.

- Garrett

Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on February 06, 2014, 03:58:09 pm
Getting back on topic... this plugin is not UI6 ready yet (because of JavaScript code in the configuration tab).  Existing Combination Switches will probably continue to work if you upgrade from UI5, but you won't be able to modify their configuration.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: wj on February 15, 2014, 02:07:53 pm
Could I put my scenario out there for a little help? I have read the first 16 pages of the thread so far without luck.

I have Stellaz TVR which I would like to monitor with the temp range condition. I would then use a scheduled scene(s) to switch the heat, being triggered by the combi switch. ( So I simply want to maintain the room temp at 19c between 5pm and 10pm by switching the heat, for example).

When the scene runs in accordance with the schedule, the room temperature will be fairly static so no change in state will occur in the CS and the heat will not be turned on if the room is cold. 

Do I simply need to poke the CS at the start of the scheduled scene, bearing in mind that it will still need to trigger the scene with any subsequent temperature changes?

Thanks very much.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on February 17, 2014, 04:07:48 pm
With something as complicated as that and with a time dependency you will probably find that PLEG is more suited to your needs.  But if you want to do it entirely with Combination Switches, do something like this.

Make a Virtual Switch and call it "Active".  Make a scene turn it on at 5 pm and another scene turn it off at 10 pm.

Make a Combination Switch and give it two conditions: When the switch Active is on; When the temperature is in the range -infinity to 18.  Set the threshold to 2 conditions.

Make a scene that activates the heat when the Combination switch turns on.  Make a scene that deactivates the heat when the Combination Switch turns off.

There's no poking at all in this scenario because there is no asynchronous event that needs to be reacted to.  It can be done entirely with state.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: SM2k on February 18, 2014, 11:47:26 am
Make a scene turn it on at 5 pm and another scene turn it off at 10 pm.

Virtual clock can do this without scenes I think...
Title: Re: Combination Virtual switch plugin (UI5)
Post by: wj on February 19, 2014, 05:29:11 pm
Thanks Futzle - the penny has dropped. Your plugin is going to be extremely useful.

When the scenarios get more elaborate, first impressions are that PLEG can get complicated too with a single space or bracket breaking the device - a bit like coding. As a photographer I take to the more visual nature of scenes and devices.

That said, I have great respect for PLEG - I just need more time to look at it.

I will look at the Virtual Clock too, SM2k.

Thanks for helping out the newbie.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: wj on February 24, 2014, 05:32:31 pm
Having got the Combination switches working brilliantly, they now all seem to be breaking! I think that this happens when ever I update or alter the configuration. The icon and numbers confirm the change in state but the related scenes will no longer trigger. It seems that I have to completely replace the Switch and all relevant scenes to make them work again. I have also noticed that I still get the prompt within the CS setting window but no red SAVE icon within this box any more.

What an I doing wrong!!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on February 24, 2014, 06:51:39 pm
That's not expected behaviour and no one else has reported it. I will need you to produce a simple test case that I can reproduce on my Vera. Be as detailed as you can. State what is behaving as expected and what isn't behaving. If you are able to catch a Luup log showing the scene failing to fire, that'd be good too.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: wj on February 25, 2014, 10:07:46 am
My setup is based on your post of Feb 17th which makes perfect sense. I will describe as best I can?

1 - Scene sets Set Points for TRVs (Separated as this can take some time)
2 - Scene switches on VirtualSwitch. Triggered by schedule.
3 - Combination switch looks for Temp Range and Virtual Switch Conditions. Threshold 2.
4 - Scenes then switch another VirtualSwitch on/off. These are trigged by Status Change of the Combination Switch.

This is replicated for other  temperatures / rooms and then?

5 - Combination Switch looks for Status of these VirtualSwitches. Threshold 1.
6 - Scenes then switch the Central Heating Relay on/off.

I appreciate that may not be the most elegant solution, but it was working wonderfully until I started adding other rooms.

If it does not make sense to you, please disregard - I have attached a screen grab of my system I use for thinking the logic through.

If you need more, I will learn how to capture a luup log.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on February 25, 2014, 04:33:13 pm
Ok, thanks, that all looks good.  So, you said this in passing, but it's important: even when triggers aren't firing, all the combination switches always correctly show their proper state (2/2 and the icon) on the dashboard?  If so, there's nothing wrong with the plugin's test logic, and the issue is instead with the code that turns a status change into a trigger.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: wj on February 27, 2014, 08:06:11 am
It would certainly seem that way - I am sure your plugin is working brilliantly.

I have replaced everything and all works well again so I am going to leave it alone for now!

I will be more diligent when I start making any modifications next time.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: datammwv on March 01, 2014, 08:12:01 am
I have your example working flawlessly for me..

Turn on a light when a door is opened, only during evening hours (Security Sensor, Virtual Switch)

What is happening however is that say it is evening and my wife and I are watching tv in living room; son comes hope opens front door, it triggers, front porch light, hallway light and living room light. Then it waits a minute and shuts them all off. 

I need a way that it check to see if the living room light is already on DON'T  turn on again or turn off.  I hope this makes since.  What is happening is that it is shutting lights off on us if we are already home.  I do not want to trigger off a motion sensor either; I just want to see if light is already on then don't do anything with it. 

Can this be done?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on March 02, 2014, 06:32:55 am
Can this be done?

Sure it can.  A poked Combination Switch can poke another Combination Switch as an action.  You just have to pile on more Combination switches and scenes to cover the condition you want to check.  In this case, the condition is "Living Room Light" Switch Status is Off, threshold of 1.  The scene that currently turns on your light will instead poke this new Combination Switch, and a new scene you make that reacts to this Combination Switch being poked-while-on does the actions that your old scene did.  End result: if the light is already on, the poking fails to pass through the second Combination Switch and no actions happen.

Someone will come along in a moment and describe how you can do the same thing with the Program Logic Plugins.  (Sincerely, I hope they do.  The more choice users have, the better.  I'm not in a battle with Richard for mindshare.)

All this is predicated on your light switch reporting its status back to Vera in a timely manner, either by having instant status or by having been on long enough for polling to have taken place.  If Vera doesn't know you've turned the living room light on yet, you're out of luck.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: datammwv on March 02, 2014, 01:25:23 pm
Futzle,

They are GE switches that react great in my small house environment.   I understand the Combination Switch working inconjuction with a scene very well.  I do not understand the Program Logic plug in yet.  I have even paid for it and played with it a bit but still do not follow it.  I have used your combinations switches with scenes for after hours functioning lights and or siren.  I have also used it for my barn door sensor and notification of open evening hours and enabling lights.   
From your knowledge is there any performance issues I might see by making so many of these?  Some day I might have to understand the PLE & PLTS but if I can continue working with what I am more comfortable with I will.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on March 02, 2014, 03:44:57 pm

From your knowledge is there any performance issues I might see by making so many of these?

Each device takes up a chunk of RAM in the Vera. It's not a huge amount but you'll hit the limit quicker with Combination Switch than with PLEG, simply because the latter crams a lot more functionality into one device. I don't know what the limit is, and it probably isn't a hard limit in any case. I personally have half a dozen on a Vera Lite and I don't get many spontaneous reboots.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on March 02, 2014, 04:05:31 pm
The following can be used to map a combination switch into a single condition in PLEG.

1) First bind your inputs.  In the combination plugins, you reference these, but do not give them a name. In PLEG you name each input.
    Say you had three triggers in Combination Plugin.
    You would have 3 input triggers in PLEG ... each with a user defined name, i.e.   t1, t2, t3

2) Create a condition that emulates the combination switch. In this case the condition is also named. Because we can have multiple ones (equivalent to multiple combination switches).
    Combination1       t1 + t2 + t3 > 2
    In this case the threshold is 2. So if all three triggers are true at the same time the condition Combination1 will be true.

3) Add your actions to Combination1 
    This is equivalent to creating a scene that is triggered by the Combination switch.


In the same PLEG you can also   have a second logical Combination switch with inputs t4, t5, t6, and condition Combination2 and associated actions.
In fact add as many as you want. If they share the same triggers, you only need to name them once.

You can have a logical 3rd combination switch that is the combination of both of these in the same PLEG:
Combination3    Combiation1 + Combination2 > 1

IN the last case this is equivalent to:
Combination3    Combiation1 AND Combination2

If you had:
Combination3    Combiation1 + Combination2 > 0

This would be equivalent to:
Combination3    Combiation1 OR Combination2


PLEG also has support for counters ... So it can incorporate the equivalent of the CountDown plugin.
When I started with Vera I used all of these plugins.  But I ended up having so many.  The number of pieces is what primarily motivated me to do PLEG. But the original technical basis for PLEG and PLTS is rooted with @futles's plugins.

Title: Re: Combination Virtual switch plugin (UI5)
Post by: datammwv on March 03, 2014, 10:40:20 am
Ok I am going to try to do this with a PLEG also.
Step 1.  No issues I created input for each of multiple combinations switches.
                a.  Front door is tripped  & Back door tripped
                B.  Barn door is tripped
                c.  armed room sensor tripped   & Arduino motion sensor tripped.
My 1st question lies is that for a & b of these before I also had If Evening virtual switch is on; and c an 10:00pm on & 5 am off.
Do I just create these times under schedules under inputs?
Step 2. you say create and
       combination that includes both inputs from a.
       combination that include barn door only,
       combination that includes armed sensor 1 or arm sensor 2 tripped.
Have no idea what choice to choose on the condition screen.....  trigger, schedule property, etc.....
Then where is the schedule fall into place?
Then where does the check exist that family room light is already on so do not shut off when doors close for example a.

Needless to say haven't even thought about step 3 in your explanation but it appears it is selecting the different conditions created in step 2 and then telling that conditions to in example a. turn on family room light, turn on porch light, turn on hallway light.  Wait 2 minutes turn off porch light & hallway light, if family room light was already on prior to this condition turning it on leave on otherwise shut off now.

For if barn door is tripped and it was after hours immediately email & sms.  If still tripped after 2 minutes enable siren.

for if armed motion sensor durring special sleep hours turn on hallway light wait 5 minutes turn off if no motion now. If motion stilll then leave on.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on March 03, 2014, 12:18:42 pm
You should probably take this over to  new thread in PLEG to discuss details.
I just wanted to map the strategy here.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on March 08, 2014, 03:48:07 pm
Anyone setup Security Zones with Combo Switch?

Curious a to how you did it, tips/hints/etc.

thx
Title: Re: Combination Virtual switch plugin (UI5)
Post by: PurdueGuy on March 08, 2014, 07:57:08 pm
Anyone setup Security Zones with Combo Switch?

Curious a to how you did it, tips/hints/etc.

thx
I have an "All Secure" combination switch that is on if every door is closed and deadbolt locked.  I have scenes that set indicator lights based on that Combination Switch turning on or off.  Nothing special in the setup, I just use "Security Sensor ... is Not Tripped" and "Lock Status .. is Locked"
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on March 09, 2014, 06:01:00 pm
I'm thinking about using this for triggering my Siren... something like, if 2 of the 10 sensors trips then someone must be in the house, kinda thing. Should stop false alarms for if a device falls or fails somehow, and trips.

Wish this had a tab more conditional logic... PLEG is nice but complex, while this interface - with a tad more logic ability - is exactly what we need for like 80% of the automation most people do.  Could use a set of conditions before this.... like If Alarm Switch is ON then...

arg, so close :)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: PurdueGuy on March 09, 2014, 08:37:41 pm
I'm thinking about using this for triggering my Siren... something like, if 2 of the 10 sensors trips then someone must be in the house, kinda thing. Should stop false alarms for if a device falls or fails somehow, and trips.

Wish this had a tab more conditional logic... PLEG is nice but complex, while this interface - with a tad more logic ability - is exactly what we need for like 80% of the automation most people do.  Could use a set of conditions before this.... like If Alarm Switch is ON then...

arg, so close :)
Make 2 combination switches.
The first would be your sensors, if 2 are on.
The second would be if the first is on and the alarm switch is on.
Create a scene that triggers by the 2nd switch turning on.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on March 09, 2014, 10:46:14 pm
You can always solve any problem by adding more Combination Switches. Except the problem of too many Combination Switches.

Part of the reason why I haven't added arbitrary logic to this plugin is that I didn't want to turn it into a parser for a domain-specific language. Keeping the UI simple makes it more accessible, while those who need more logic can double up on devices to get whatever condition they want. (The rest of the reason is that there now is such a parser for a domain-specific language, thanks to Richard.)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on March 10, 2014, 01:25:31 am
Futzle,
PLEG is likely too difficult for many to use... and even for those more technical, still a major PITA. With your style UI it would take about 2 minutes for me to make most of my scenes BUT with PLEG, it takes 10-15 due to all the programming steps required (defining constants, then the condition statement, then the actions, etc)... then if you need to change/tweak something multiply that time by 2-5x since many items/entries cannot be changed but must be deleted and re-added... then forget about reordering Actions - delete it all and start over! Functional, yes -- easy, far from it.

I hope you reconsider adding AND / OR option at the start of each line and grouping lines using () ... it could go a long way to making lots of lives easier.

Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on March 10, 2014, 02:31:43 am

I hope you reconsider adding AND / OR option at the start of each line and grouping lines using () ... it could go a long way to making lots of lives easier.

Why don't you draw up a user interface mockup that shows how your proposed Boolean logic extension would work? It's got to be obvious enough that it requires no user instructions even for users that struggle with the current UI already, expressive enough to allow arbitrary Boolean expressions of conditions, and implementable in JavaScript.

Meanwhile, you've got a workaround involving two Combination Switches. Give it a try and decide how much more effort it is than your proposal.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on March 10, 2014, 10:18:07 am
Sorry @Futzle for diverging ...

Quote
PLEG is likely too difficult for m0any to use... and even for those more technical, still a major PITA. With your style UI it would take about 2 minutes for me to make most of my scenes BUT with PLEG, it takes 10-15 due to all the programming steps required (defining constants, then the condition statement, then the actions, etc)... then if you need to change/tweak something multiply that time by 2-5x since many items/entries cannot be changed but must be deleted and re-added... then forget about reordering Actions - delete it all and start over! Functional, yes -- easy, far from it.

I hope you reconsider adding AND / OR option at the start of each line and grouping lines using () ... it could go a long way to making lots of lives easier.
A lot of false information and lack of understanding of the problem in this statement.
You can not move to a general AND/OR expression of the inputs until you name the parts of the expression. Countdown timer does NOT need to name the inputs since it only has one operation.  Counting the number of inputs that are true.  You get an OR of all the inputs if count  = 1 and an AND of all the inputs if the count = N where N is the number of inputs. It has some nice fuzzy logic for counts between 1 and N.  PLEG has this same logic, since I use combination and countdown plugins before I created PLEG. And so yes, if you use PLEG to just emulate this behavior you end up going through an extra step of naming the inputs. 

Some folks have tried to merged the boolean logic with the input selection (graphical editors) ... looks nice for simple expressions but falls short for real world problems.

I do not know why you think you have to deleted things all the times (other than inputs). Just because you delete an input does not mean you need to delete a condition ... or it's associated actions.  There are buttons to to re-order conditions.  I use the exact SAME Scene Editor for Actions as you would for an external Scene which is needed for a countdown plugin ... So I do not know how that can be any more/less difficult.  So if you want to reorder the commands in the actions (scene) ... you have to delete entries and re-add them in the right order.

Named Conditions give you the equivalent of MULTIPLE  combination virtual switches.  So if you have 4 conditions it should be compared to setting up 4 combination switches. There is considerable time saving and understanding by having all of the logic in one place, and not spread in different devices and different scenes.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on March 10, 2014, 12:17:33 pm
I understand, and said, PLEG is far more powerful and having Combo VS move to AND/OR would fill a need, no replace PLEG completely.

I assumed Combination Virtual Switch evaluated all statements, then added the number which were true to get the outcome. Figuring he might be able to be move add AND/OR evaluation by doing a grouped, linear evaluation - without too much trouble. Even if it was fixed groups (2 groups with a single operation between them) then it will still fill a gap where most basic HA lives today without the complexity of PLEG.

Yes, PLEG is awesome, and people like us (those who code, or have coded in the past) understand the methodology which PLEG uses - similar to raw coding... define constants/variables, create routines, etc.

Even then, PLEG Actions has challenges:
- Cannot edit an existing Action, requires deleting.
- Cannot reorder, must delete all/many actions to get proper execution order if you need to make a change

Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on March 10, 2014, 01:23:50 pm
Quote
Even then, PLEG Actions has challenges:
- Cannot edit an existing Action, requires deleting.
- Cannot reorder, must delete all/many actions to get proper execution order if you need to make a change
Are you confusing Conditions and Actions ?
An ACTION is the equivalent of a SCENE. There is no easy way to change the order of things in an Action/Scene without deleting the Action/Scene.
Most people do not care if light 1 comes on first or light 2 ... And you can always use delayed commands to force an ordering.  For things like Z-Wave
devices in actions/scenes the order only implies the order the commands are sent ... not the order they are executed. First command can happen after the second one ... if it had an transmission error or needed to be routed via secondary path.

It's the same behavior if you use PLEG or do it it with Scenes and combination switch ... So why are you saying this is a problem with PLEG ?
They both have the same capabilities in editing ... add new device commands, remove device commands, add new delays ... etc. It's the exact same code!

If you mean Conditions than clearly you have not read the documentation or clicked the + or - buttons in the condition editor.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on March 10, 2014, 02:30:20 pm
It can be important, just like with Conditions (which I know can be reordered easily, I have many times), to be able to reorder Actions - so they fire in the proper order. For instance, if you want to pull text from a variable (for use in something else), then change that variable text right after, order of execution is required. There are other possible order issues... like lighting sequences, etc.  If you need to make a change - deleting all the Actions and recreating is a PITA.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on March 10, 2014, 07:02:01 pm
You make that sound like a PLEG Problem ?
This is a problem in the Scene editor that I reuse from Vera.

You may be surprised by thinking the order is actually the order things happen in ... Some commands are synchronous ... i.e. they happen when the call_action is made ... many others are queued ... which means they will happen later when the target device has time and has finished processing all of its previously queued commands... The call_action returns immediately. The difference is if the action is implemented with JOB or RUN semantics. If ordering is absolutely critical ... you should use call_delay between commands with a long enough delay to make sure the commands are dequeued  and executed. I do not think luup.sleep will yield to the scheduler. I could be wrong on that ...but considering the negative feedback from MCV if you use luup.sleep in your plugins (i.e. they will not approve the audit) ... I believe that is the case.

My observations from your comments in this thread (and previous ones) is that if something does not meeting your specific specifications ... you make negative comments about it.

I suppose @Futzle would get the same negative feedback if she implemented two groups of inputs and allow you to specify that they are connected with AND or OR when you needed 3 groups!

@ Futzle ... I will not be responding to any more comments on this thread relative to @Aaron. If he wants to complain about PLEG ... he can use the PLEG forum ... I will provide him the feedback it deserves.

Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on March 10, 2014, 07:53:42 pm
Richard,
Relax, I'm not complaining - simply stating my opinion that PLEG is complex and likely more powerful than what is needed by 'average' user. I was making a suggestion that there was a gap-filler between the Vera native automation & PLEG.  You are clearly brilliant, so me thinking PLEG is complex if not exactly a stretch, even if you don't think it is complex. Futzle could tell me to pound sand, I'm fine with that. I hear it a lot in my line of work so I'm think skinned.

btw.. I did assume the Actions were ran in order, my mistake. And thank you for letting me know how to ensure they do.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: sirpinky on March 18, 2014, 06:01:53 pm
Hi guys,

Any news when (or if) this will be updated for UI6?

Just got my veralite last week and it prompted me right out of the box to upgrade to UI6 (it said "you have to upgrade before you continue") but now I see many things don't really work on UI6 yet.

This device shows up empty with no condition editor on UI6.

Thanks!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on March 18, 2014, 07:26:41 pm
Any news when (or if) this will be updated for UI6?

It's on my to do list. No schedule. It depends partly on how quickly the remote access apps I use add MMS authentication, because I'm not updating my own Vera till then.

Edit: Version 18 should work on both UI5 and UI6.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: rjmarshall on March 24, 2014, 11:39:07 pm
Ok, I know I'm doing something wrong....

Could someone please give the simplest possible example of the use of Combination Switch in UI5?

Here is a generic scenario- I have two lights, Light_A and Light_B. When Light_A is on, I would like Combination Switch to turn on Light_B. When Light_A is turned off, I would like Light_B to turn off. Thats it. I would appreciate if someone could tell me exactly what to do in Combination Switch to do this.

What I am really trying to do is more complicated, but I want to run through a very simple example first to understand how it works.

When it is done, I assume I will "run" the scene, and it will run continuously turning on and off Light_B according to the state of Light_A? How do I then stop a scene (I don't see a "stop running" button.)

Add'l request: Please don't refer to "Virtual Switch" sometimes and "Combination Switch" other times unless you are referring to two different things.

 
Thanks very much- sorry for such a simple question.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: wj on March 25, 2014, 04:26:39 am
Just to start?

Combination Switch and Virtual With are two separate and very different plugins and often used in combination.

A Scene ONLY runs when you press "Run" button or when it is"Triggered" as you specify in the Triggers tab or when it is "Scheduled" too in the schedules tab.

I have to say, it took me a while to get my head around this - you will have a eureka moment.

Lots more on Combination Switches starting here..

http://forum.micasaverde.com/index.php/topic,10995.0.html

Stick with it  - the Combination Switch can help you with majority of your Logic requirements.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on March 25, 2014, 04:42:57 am

Here is a generic scenario- I have two lights, Light_A and Light_B. When Light_A is on, I would like Combination Switch to turn on Light_B. When Light_A is turned off, I would like Light_B to turn off. Thats it. I would appreciate if someone could tell me exactly what to do in Combination Switch to do this.

You can't do this with _just_ a Combination Switch. A Combination Switch can only observe the states of devices on Vera, not directly control them. You would also need two scenes to do the actual switching. (I make a point of this because your wording suggests that you think that the Combination Switch can cause other devices to change state. It can't.)

1. Create a Combination Switch and add one condition: Light_A switch status is On. Set the threshold to 1.
2. Create a scene. Make the scene turn Light_B on. Add a trigger: Combination Switch state changes to On.
3. Create a scene. Make the scene turn Light_B off. Add a trigger: Combination Switch state changes to Off.

Of course, this specific example doesn't need a Combination Switch at all, and your two scenes can be triggered by Light_A directly. Where the Combination Switch comes into its own is when you have to react to Light_A1 _and_ Light_A2.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: rjmarshall on March 26, 2014, 02:00:26 am
Ok WJ and Futzle-

Still no joy...  Futzle told me to do the following:
"1. Create a Combination Switch and add one condition: Light_A switch status is On. Set the threshold to 1.
2. Create a scene. Make the scene turn Light_B on. Add a trigger: Combination Switch state changes to On.
3. Create a scene. Make the scene turn Light_B off. Add a trigger: Combination Switch state changes to Off."

Here is what I have done:

I created an instance of Combination Switch called "My 1st Combination Switch." I configured it as Switch Power Status, Brass Lamp is On, threshold is set to 1.

Then I created a scene called "Turn Yellow Lite on." On the device Yellow Lite I clicked the On button. I then created a trigger called "Turn Yellow Lite on" for device "My 1st Combination Switch" with the trigger "Poked While Virtual Switch is on" and saved.

I created another scene called "Turn Yellow Lite off." I clicked the off button on device Yellow Lite and created a trigger "Turn Yellow Lite off" for device "My 1st Combination Switch" with the trigger "Poked While Virtual Switch is off" and saved.

At this moment both lamps are off. I go to Devices and see "My 1st Combination Switch" which shows 0/1. I then turn on Brass Lamp and My 1st Combination Switch changes to 1/1. This is good. On the other hand, Yellow Lite doesn't turn on. This is bad. I then manually turn Yellow Lite on and off but nothing else changes (as expected.)

I now go to the Automation section. I have two scenes - Turn Yellow Lite On and Turn Yellow Lite Off. When I push "run" on Turn Yellow Lite on, the lite turns on. When I push "run" on Turn Yellow Lite off, the lite turns off.
 
I cannot get Yellow Lite to change state based on my action with Brass Lamp. I'm sure I am missing something - any idea what?

Thanks again much for your help.

Rick
Title: Re: Combination Virtual switch plugin (UI5)
Post by: PurdueGuy on March 26, 2014, 02:04:43 am
Don't use "Poke when on" but instead use the choice "Virtual switch status changes" and then either "Switch turns off" or "Switch turns on"
Title: Re: Combination Virtual switch plugin (UI5)
Post by: rjmarshall on March 26, 2014, 02:56:04 am
Hmm..... This is strange.

Don't use "Poke when on" but instead use the choice "Virtual switch status changes" and then either "Switch turns off" or "Switch turns on"

When I try to select "Virtual switch status changes" as the trigger variable, it doesn't give me the choice of "Switch turns off" or "Switch turns on" and, more distressingly, when I save, it goes back to Poke when on (or off). I tried it 5 times and same result.....
Title: Re: Combination Virtual switch plugin (UI5)
Post by: PurdueGuy on March 26, 2014, 02:56:56 am
Editing triggers is mostly broken.
Delete the trigger and add a new one.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on March 26, 2014, 08:37:51 am
Try to delete and create a new trigger.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: rjmarshall on March 26, 2014, 10:12:07 pm
Damn - it works!  Thanks.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: martynwendon on June 10, 2014, 06:52:05 am
Hey futzle,

Would you consider adding the room name or device id to the drop down list used when selecting a device on the Configure tab? 

All my devices are just called e.g. "Temperature", "Humidity", "PIR" so it makes it challenging to select the right one  ;D

I know I could rename all my devices, but that seems counter intuitive since they are already separated by room!

Thanks,

Martyn
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 10, 2014, 06:58:04 am
Seems reasonable. The device Id is nice and short and shouldn't cause too many word wrap hassles.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: PeterSHart on June 18, 2014, 06:41:28 pm
Hi futzle,

I have been using the Combination Switch for ages and it is by far the best Vera plugin.

However since upgrading to UI6 all I get under Configure is the "switch on when x or more items are true" setting (and none of the actual triggers).

A javascript debug gives me:
"Uncaught TypeError: undefined is not a function"

 between these lines:

html += pluginList.inject("", function(a, plugin) {
      return a + '<option value="' + plugin["id"] + '"' + (currentPlugin == plugin["id"] ? ' selected="selected"' : '') + '>' + plugin["name"].escapeHTML() + '</option>';


Any ideas?

Thanks,
Peter Hart
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 19, 2014, 05:22:11 pm
html += pluginList.inject("", function(a, plugin) {
      return a + '<option value="' + plugin["id"] + '"' + (currentPlugin == plugin["id"] ? ' selected="selected"' : '') + '>' + plugin["name"].escapeHTML() + '</option>';

That snippet of code is from a UI5-only version of the plugin.  Since version 18 the plugin should support UI6, and that line of code has changed.

What version of the plugin are you on?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: PeterSHart on June 19, 2014, 05:48:42 pm
I have version 16.0 so this explains the issue.

How do I get the latest version? I have the Auto-update box ticked which has obviously failed me :(
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 19, 2014, 06:13:52 pm

How do I get the latest version? I have the Auto-update box ticked which has obviously failed me :(

http://forum.micasaverde.com/index.php/topic,10995.msg80540.html#msg80540
Title: Re: Combination Virtual switch plugin (UI5)
Post by: PeterSHart on June 19, 2014, 07:16:43 pm
Ok the update completed and I am getting further.

However now which ever condition type I select (e.g. dimmer level etc) it just returns "Failed to get plugins...".
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 19, 2014, 08:53:39 pm
Did you reload the Luup engine (SAVE/Reload)?

Did you refresh your browser while clearing the cache?

Are you on the same LAN as Vera?

What browser are you using?

That error will pop up if any AJAX request that the browser makes returns something unexpected.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: PeterSHart on June 19, 2014, 09:14:33 pm
Did you reload the Luup engine (SAVE/Reload)?                      Yes

Did you refresh your browser while clearing the cache?           Yes, I have cleared the cache

Are you on the same LAN as Vera?                                           Yes

What browser are you using?                                                  Ok here is the fun bit:
                                                                                                                                       Broken in Google Chrome  (35.0.1916.153 m)   - My default browser
                                                                                                                                       Broken in Internet Explorer (11.0.9600.17126)
                                                                                                                                       Working in Firefox (26.0)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 19, 2014, 10:09:42 pm
Ah ha. I will try to figure out what is causing it to barf in Chrome. Thanks for discovering that.

I can't test IE because there are no Windows machines in my household.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: geoffbon on June 20, 2014, 12:58:09 pm
Ah ha. I will try to figure out what is causing it to barf in Chrome. Thanks for discovering that.

I can't test IE because there are no Windows machines in my household.

If you do want to test in IE, there's a VM you can use here:
https://www.modern.ie/en-us/virtualization-tools#downloads
Cheers,
Geoff
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jaseoz on June 24, 2014, 01:00:08 am
Hi there.
I too get the 'Failed to get plugins' message.
Chrome - Refreshed - Cleared cache - Same LAN - Saved/Reloded.
Ver lite ui6, Plugin version 18.
Further help would be great.
Thx.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 24, 2014, 05:30:38 am

I too get the 'Failed to get plugins' message.
Chrome

That's sufficient to produce this bug. (Safari seems to suffer from the same problem.)

Quote
Further help would be great.

Until I fix the bug you will need to use Firefox to configure your Combination Switches. Once configured they will operate irrespective of the browser that you use.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jaseoz on June 24, 2014, 05:50:34 am
Thanks for The Reply. I Will Try Firefox tomorrow And Report Back.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 24, 2014, 08:33:40 am
Have a try of this version of the JavaScript.  Unzip it first then upload it to Vera.

It improves things on Safari.  I'd like to know how it fares on Chrome and IE.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jaseoz on June 24, 2014, 09:14:04 pm
Okay. At work all day, will try to do it when home tonight. Not uploaded to Vera before....assume the process is simple?
Firefox works fine, just tried it.
Trying to configure an AEON labs Smart switch to turn off when wattage of connected equipment drops to 20 - 30 watts. Problem is when Smart switch is turned back on and reaches same 20 - 30 watts during equipment startup, the switch gets turned off again. I suspect this is detailed somewhere, but can't find it yet....any direction certainly welcomed.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 24, 2014, 09:50:51 pm

Problem is when Smart switch is turned back on and reaches same 20 - 30 watts during equipment startup, the switch gets turned off again.

Combination Switches have no concept of history. They can't tell if a value is decreasing or increasing. They literally know only about the state of variables _now_.

I've worked around a similar case by tying a Countdown Timer in. If the power stays within the range for (say) 60 seconds then fire the scene. Or I use a Virtual Switch; turn it on if the power is higher than the window, an add "Virtual Switch is on" as a condition to your Combination Switch. This can tell you if you've entered the range from above or from below.

To be honest, the complexity of your example is perhaps better served by using PLEG.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jaseoz on June 25, 2014, 02:04:09 am
Thanks futzle. Would you be able to elaborate on the Timer and VS a little more please.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 25, 2014, 02:36:15 am
Create a Virtual Switch, call it "Operating Power Reached".  Create a scene that turns this Virtual Switch on when the power goes over (say) 100 W.  Pick a number that you know the power-hungry device will exceed.

Test this out: turn your power-hungry device on, and wait until the power hits 100 W. Now the Virtual Switch comes on.

Create a Combination Switch with two conditions: Operating Power Reached is on, and Power is in range 20 to 30 W. Set the threshold to 2.

Make a scene that is activated when this second Combination Switch turns on. Make this scene turn off your power-hungry device and turn off the Operating Power Reached Virtual Switch.

Test this by letting the power-hungry device enter the 20 to 30 W range. Both conditions should now activate. The scene fires: the device goes off and so does the virtual switch.

Now when you turn your power-hungry device back on it won't turn off right away because the Operating Power Reached Virtual Switch will be in the wrong state.

This example doesn't need a Countdown Timer after all.

There are many, many variants on this theme. In all of them, you need to identify what the "state" variable is. In this example, it's whether the power-hungry device has been in a high-power state since being turned on.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jaseoz on June 25, 2014, 04:33:14 am
Yeah that's looking better like that, will give it a go. Apart from next (silly) question....Virtual Switch as opposed to Combination Switch (and best VS to use?)
Alternate method which does work in a different fashion, was I used a door sensor arm / bypass status, triggered by time delay (beyond start-up wattage used to shut off device), then had Combo switch wait until sensor went into changed state as well as power dropping to specified level. Worked but not so good when I will need more than one of theses total scenarios to work independently of each other. One door sensor for multiple scenarios...not so good.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 25, 2014, 05:00:10 am

Apart from next (silly) question....Virtual Switch as opposed to Combination Switch (and best VS to use?)

There's a plugin chixxi put on apps.mios.com called "Virtual On/Off Switches".  Use that. Despite the similar name this does something different, but something useful and complementary to the Combination Switch: it retains its state over time.

When I say "Combination Switch", I mean my plugin. When I say "Virtual Switch", I mean chixxi's plugin.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: jaseoz on June 25, 2014, 07:17:19 am
Righto all is sorted.
Scenario was to use a Smart Switch (SS) to turn on XBox etc and turn off SS when XBox was turned off, to eliminate standby power. Reason being, all the gear gets turned on, but no one turns off the SS when finished.
*So, create a Virtual Switch that is scene controlled to turn on after 1 minute from when SS is turned on. (this 1 minute allows for start up wattage to rise past the chosen standby wattage, otherwise the turn off sequence would be activated).
*Create a Combination Switch with 2 conditions - 1st Power of SS is between 10 - 20 watts, 2nd Virtual switch is on.
Another scene then is created to turn off the VS and also the SS 10 seconds after the CS is turned on (due to its 2 conditions being met).
Now when SS is turned on, the equipment starts and wattage rises to normal operating amount, after 1 minute the VS turns on and stays on. When XBox is shut down, the wattage reduces to between the 10 - 20 standby range, which meets the 2nd condition of the CS, therefore the CS is now on. Once the CS is on, the 2nd scene runs to turn off the VS and the SS.
Hope I got this all listed correctly and it helps a few others.
Loads of thanks to futzle.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Guimaraes on July 07, 2014, 01:40:47 pm
I can not schedule this plugin. It simply does not work on my vera! I would create a scene: When entering a password to open the lock pair, the room light turns on, but can only occur aopas 19:00 hours! How do I? Grateful for the assistance ... Guto
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 07, 2014, 05:32:20 pm

I can not schedule this plugin. It simply does not work on my vera! I would create a scene: When entering a password to open the lock pair, the room light turns on, but can only occur aopas 19:00 hours! How do I? Grateful for the assistance ... Guto

There are no conditions for "Time of Day" in the Combination Switch plugin. Instead you can create a Virtual Switch device and set a scene to turn it on at 19.00 (and off at some later time).

Check out PLEG as an alternative; it's designed for things like your use case.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on July 09, 2014, 07:16:49 am
Version 19 has been uploaded to apps.mios.com.  In this version:
- Safari now tested.  Probably works on Chrome too.
- Dropdowns for devices includes device ID number.
- Fixed a race condition which turned on a light in my house every time I turned it off.  Have you any idea how annoying that is?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: pulpman52 on July 21, 2014, 09:07:29 am
Not to beat a dead horse but...


It's not a case of reconsidering. It's a case of time-of-day not being a state that the plugin can check, or be informed when it changes. That's a consequence of the way Vera stores device state, and of how the Combination Switch stays completely in the background until one of those state variables changes. If I modify the Combination Switch plugin to poll the current time for a condition, it would cease to be efficient.

This wish is outside of the scope of the Combination Switch. Which is why I point at scenes, schedules and the Virtual Clock (http://apps.mios.com/plugin.php?id=2838) plugin as how to fill in this functionality.

This explanation makes sense, but after reading through a number of the requests I believe there is a relatively simple solution that will allow (most) people to use Time-of-Day in the switch without reducing the efficiency. Most people seam to want to do something (turn on lights) when a door is unlocked but only if it is after 7pm... If the switch remained idle until the door unlocked (or an other watched variable changed states) then and only then it check the system time, then the switch would remain in the background except at a time when it would be awake anyway. Day of week and date are also easily implemented if the switch checked there state at 12am each day.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on August 03, 2014, 12:25:49 pm
I just started using ComboVS as part of my DIY security system. I'm using it as a 'ready' indicator (all motion has stopped) to enable the system.

The reason I'm not using it more is that the logic is not precise enough for what I do with Vera and while I have PLEG, things like what I describe above are useful, and nice to do in ComboVS instead of PLEG

I do see a large value in adding the ability to check the 'time of day' as a variable for ComboVS.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on August 03, 2014, 07:22:32 pm
You can emulate the combination VS with a single condition in PLEG.

If you need a user interface for it that one condition can drive a multi switch.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on August 03, 2014, 10:10:28 pm
You can emulate the combination VS with a single condition in PLEG.

If you need a user interface for it that one condition can drive a multi switch.

Agreed, I'm going to move it over to PLEG. I posted a question in the PLEG forum on the situation I'm trying to solve for. Would love your input on it.

thanks
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on August 21, 2014, 10:23:26 am
futzle
I may still stick with Combo switch but finding that I need a way to disable/bypass the switches. Can you add this feature?

On benefit, other than programmatically (for scenes), is lower-Vera utilization.. I'm finding the Vera is often busy with status of these devices. See what I mean...

Quote
24   2014-08-21, 02:10:02.234   S   163   Master Bedroom Motion Sensor   Tripped   0
23   2014-08-21, 02:09:55.884   X   242   Away Mode Validation   Status   0
22   2014-08-21, 02:09:55.879   S   163   Master Bedroom Motion Sensor   Tripped   1
21   2014-08-21, 02:08:17.820   X   242   Away Mode Validation   Status   1
20   2014-08-21, 02:08:17.815   S   163   Master Bedroom Motion Sensor   Tripped   0
19   2014-08-21, 02:08:12.387   X   242   Away Mode Validation   Status   0
18   2014-08-21, 02:08:12.367   S   163   Master Bedroom Motion Sensor   Tripped   1
17   2014-08-21, 02:08:06.971   X   242   Away Mode Validation   Status   1
16   2014-08-21, 02:08:06.966   S   163   Master Bedroom Motion Sensor   Tripped   0
15   2014-08-21, 02:07:35.407   X   242   Away Mode Validation   Status   0
14   2014-08-21, 02:07:35.396   S   163   Master Bedroom Motion Sensor   Tripped   1
13   2014-08-21, 02:07:31.011   X   242   Away Mode Validation   Status   1
12   2014-08-21, 02:07:31.006   S   163   Master Bedroom Motion Sensor   Tripped   0
11   2014-08-21, 02:07:16.437   X   242   Away Mode Validation   Status   0
10   2014-08-21, 02:07:16.429   S   163   Master Bedroom Motion Sensor   Tripped   1
9   2014-08-21, 02:04:41.320   X   242   Away Mode Validation   Status   1
8   2014-08-21, 02:04:41.315   S   163   Master Bedroom Motion Sensor   Tripped   0
7   2014-08-21, 02:04:34.347   X   242   Away Mode Validation   Status   0
6   2014-08-21, 02:04:34.336   S   163   Master Bedroom Motion Sensor   Tripped   1
5   2014-08-21, 02:04:26.611   X   242   Away Mode Validation   Status   1
4   2014-08-21, 02:04:26.606   S   163   Master Bedroom Motion Sensor   Tripped   0
3   2014-08-21, 02:04:20.477   X   242   Away Mode Validation   Status   0
2   2014-08-21, 02:04:20.468   S   163   Master Bedroom Motion Sensor   Tripped   1
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Guimaraes on September 08, 2014, 01:19:21 pm
tks!  ;D


I can not schedule this plugin. It simply does not work on my vera! I would create a scene: When entering a password to open the lock pair, the room light turns on, but can only occur aopas 19:00 hours! How do I? Grateful for the assistance ... Guto

There are no conditions for "Time of Day" in the Combination Switch plugin. Instead you can create a Virtual Switch device and set a scene to turn it on at 19.00 (and off at some later time).

Check out PLEG as an alternative; it's designed for things like your use case.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: knutfinn on September 08, 2014, 01:45:56 pm
BEST little app (and free). Thanks!
I use numerous.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: arepand on September 13, 2014, 04:06:51 pm
I have updated my vera3 to UI7 and I'm feeling confused. Where do I add several combination virtual switches?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on September 13, 2014, 07:32:25 pm

I have updated [...] to UI7 [...]. Where do I add several combination virtual switches?

This is a known bug in 1.7 firmwares (http://forum.micasaverde.com/index.php?topic=26527.msg188090#msg188090).
Title: Re: Combination Virtual switch plugin (UI5)
Post by: antrock on September 17, 2014, 11:55:45 am
Could this plugin be modified or upgraded so it would be able to compare two different devices/sensors? I am looking for something that could compare outside and inside temperatures and run scenes accordingly. I've described my problem in this thread http://forum.micasaverde.com/index.php/topic,26782.0.html
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on September 17, 2014, 05:26:23 pm

Could this plugin be modified or upgraded so it would be able to compare two different devices/sensors?

It would need a new comparison type, one that takes two devices and compares their temperatures. I'll throw this idea onto the list for future consideration. Meanwhile, I bet you could do this in PLEG in short order.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: anup56 on October 09, 2014, 07:08:33 pm
Hi Futzle,
Is the Combination switch  plugin updated for Ui7, i cannot get the Configure button to show me the switch options selected I keep getting the error that says
"failed to get plugins" - 
 
Thanks
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on October 09, 2014, 07:12:29 pm
Is the Combination switch  plugin updated for Ui7

Sure is. I'm using it myself. Make sure that you are on the latest version.

Edit: and be on the LAN. Javascript tabs do not work well across the remote access tunnel.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: adaugeo on October 10, 2014, 10:25:51 am
Hi futzle,
I'm using not original vera lite, but branded unit Netichome. which should be almost 100% vera compatible.
Combination switch install without problems, but i se just 0/0 "Poke", and this also under configure tab. No way to add any settings on configure tab.
device_type is set to: urn:schemas-futzle-com:device:CombinationSwitch:1
device_fileis set to: D_CombinationSwitch1.xml

Do you have any idea, what could be wrong?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 10, 2014, 08:11:02 pm
Hi adaugeo,

Do you know if your Netichome is more like UI5 or UI6?  I'm guessing UI5.

Do you know what version of the plugin you have installed?

Also, what browser are you using?  The Configure tab is JavaScript and there have been troubles in the past with certain browsers running this plugin.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: adaugeo on October 11, 2014, 04:28:14 am
I think to it is UI5.
I see firmware version 1.5.732, but i really dont know how much this corespond to some Vera versions. Sorry im just new to this technology.
I try both version found on mios market place - 18 and 19.
Im primary using mac, so i access my unit almost from chrome or firefox, both of them are showing the same.
Thank you for your reply, when it helps i could add your account to my unit to check this.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: adaugeo on October 11, 2014, 04:37:27 am
Actually im not sure if it is not UI7, because of the bug descibed above.
I could not add another device throw plugin. I need to do this manually.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 11, 2014, 06:37:25 am
This is going to be difficult to debug (sorry). Giving me remote access won't help because you probably need a shell to diagnose (and I wouldn't do it anyway: you cannot and should not trust me).

First off: do you know if JavaScript tabs are even supported in your MiOS platform? Apart from asking your vendor, you could try other plugins that have JavaScript tabs. Sonos is one; Philips Hue is another; CurrentCost EnviR is s third. But these all require specific hardware so maybe that's not actually a useful test. Darn. Oh, I thought of one just now. There's a plugin that MCV distributed called HomeCare that has a JavaScript tab and doesn't require specific hardware. See if you can find and install that.

If you can get to your browser's JavaScript console it might be reporting an error that I can use. On a vanilla Vera on UI5 this doesn't really work well because the exception is caught and suppressed.

If you can get to a root shell and catch the LuaUPnP.log file while you visit the tab in your browser you can see if the plugin code is even being executed.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: adaugeo on October 11, 2014, 07:58:49 am
Actually it seems to be problem with JavaScript tabs. Home Care plugin were installed but with same issue - couldn't set anything exactly like your plugin. you can see this bellow
:-(
So it seems to be unusable for me, now, isn't it? Or some older version should worked?

It is currently used just testing device - all modules connected to its are used just for testing, so i could offer access for you, but i understand your point of view.
What vanilla Vera means?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 11, 2014, 06:57:51 pm
This plugin was made with JavaScript tabs right from version 1, sorry. If you wanted to use it you would have to add the variables yourself to the Advanced tab. This is possible but insanely tedious and error-prone (hence the UI to control it).

Perhaps your MiOS vendor has some suggestion on getting plugins with JavaScript tabs to work?

("Vanilla" is used in the metaphorical sense of "normal" or "unspecialized".)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: adaugeo on October 29, 2014, 06:00:36 am
Hi Futzle,
it seems that NeticHome vendor wouldnt support Java Tabs
Please could you send me or post here infos about used variables, so i could try to set it manualy? if you have it...
Thanks a lot
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on October 29, 2014, 05:51:04 pm
This is all internal implementation details so may change in the future...

PROGRAMMING A COMBINATION SWITCH FROM THE ADVANCED TAB

All variables are in the urn:futzle-com:serviceId:CombinationSwitch1 service ID namespace.

First decide how many conditions you will have.  Set the variable WatchCount to this number.

Decide how many conditions have to be met before the switch turns on.  Set the variable Threshold to this number.

Then, for each condition, starting at 1, set variables for that condition.  All of Condition 1's variable names start with 1, all of Condition 2's variable names start with 2, and so on.

Set the condition type with the 1Plugin (2Plugin, 3Plugin, ...) variable.  This is a string like "SecuritySensor" or "DimmerLevel" and corresponds to part of the name of the Lua file in the plugin which will compute the condition.

Set the device number that the condition is to watch in the 1DeviceId (2DeviceId, 3DeviceId, ...) variable.

Then set the condition's parameters.  This varies depending on the type.  Here are a few of the more common ones (replace 1 with 2 or 3 or ... as above):

DimmerLevel

SecuritySensor

SwitchPowerStatus

You can often figure out what the variables for a given condition should be by reading the source of the Lua files in the plugin; most of the files follow the same pattern so you can use the known examples above to see the pattern.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: anup56 on November 09, 2014, 10:30:26 pm
Right... After tech support fixed my local IP access to the ui7 interface the combination switch options work as you say on the local lan. Thx.


Sent from my iPhone using Tapatalk
Title: Re: Combination Virtual switch plugin (UI5)
Post by: slajgaj on January 03, 2015, 06:51:39 am

Will be a chance it will work in ui7 sometimes?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: bside on January 03, 2015, 06:05:00 pm
Just dropped by to say 'thanks' for the plugin. After having my Vera lite for almost 2 years now, and only doing the most minimal things with it, I installed more z-wave devices and started getting deeper into it, and this plugin has been super helpful! Thanks for your hard work!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: TwannieM on February 23, 2015, 05:43:17 pm
where can i find the latest verson?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: slajgaj on March 05, 2015, 09:41:36 am
Fitze!

Never be working remotelly the Combination Virtual plugin?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on March 05, 2015, 03:52:06 pm

Never be working remotelly the Combination Virtual plugin?

Configuration of a Combination Switch never worked over a remote connection. MCV never showed us a way to make JavaScript Ajax calls work through the remote portal. Configure on your LAN, then it'll work anywhere.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: slajgaj on March 07, 2015, 05:53:15 am
Futze!

Thank you for your answer, i'm sorry .
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Jim McGhee on April 04, 2015, 02:23:06 pm
I happy with my work around.  No need to help debug my problem.
Out of courtesy I'm simply reporting the problem to you.

a)  The description can't any simpler than:
  1. Add a new combination switch.
  2. Create a notification in the switch's "Notification" tab.
      Simply select "Poked while virtual switch is off".
  3. Poke it. ... and ...
   .... Luup restarts, and no notification is sent.
b) I have no idea how to get this log.  I do have a 4GB USB dongle on my Vera, but I am not aware of how to access the log.  If you could point me in the right direction here (getting the log), I might be able to figure this out on my own.  If it's something that I can fix, then great.  If I do find something potentially relative to the combination switch, I will pass you the information.

And as always, huge thanks for your plugins.  My home is smarter because of them.

Has this been fixed?  I'm having this problem.  What was the workaround mentioned?  Is this fixed in UI7?

Also:
The help page still points to the pre-release thread and should probably point to this one.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on April 05, 2015, 03:03:58 am
Has this been fixed?  I'm having this problem.

I'm guessing that no, it hasn't been fixed.

Quote
What was the workaround mentioned?  Is this fixed in UI7?

Two posts up: http://forum.micasaverde.com/index.php/topic,10995.msg119849.html#msg119849

Quote
Also:
The help page still points to the pre-release thread and should probably point to this one.

I've changed it, but it might not propagate to already-installed copies.  Thanks for the note.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: waddle33 on June 10, 2015, 11:07:36 pm
HI There,

I am new to this and finding my way through HA.

I have installed the plugin and it works beautifully but one for one device.
When I install a second device and try to configure it I get "Failed to get plugins".
I am running the latest version of UI7.

Any help would be greatly appreciated. I think this will make a big difference to the scenes I want to setup I just need to be able to create more devices.

Thanks in advance.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: pmusselman on June 12, 2015, 01:50:40 pm
I am getting the "Failed to get plugins" message after the plugin was installed.  I tried IE and Firefox and get the same message.  Any ideas?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 12, 2015, 09:36:50 pm
You will get "Failed to get plugins" if you try to configure a Combination Switch and you are not on your local LAN.  It does not work over a remote connection, and it does not work if you've turned on "Secure my Vera", because that makes all connections remote.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: pmusselman on June 13, 2015, 07:24:42 am
Thanks.  I just tried it on another PC and it appears to work.  Maybe the PC that I was on was restricted in some way.  But here from home all is good.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: TheKorn on June 16, 2015, 11:33:22 am
Any chance of adding a countdown timer (https://apps.mios.com/plugin.php?id=1588) as a condition?  (Just noticed you wrote countdown timer as well -- bravo!)

Trying to do "if my garage door has been up for five minutes AND garage lights are off, shut the door" logic, but since countdown timers aren't a supported type in combination switch I can't see a way to get here from there.

Thanks!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 16, 2015, 06:17:32 pm
That wouldn't work, because it relies on detecting the time of the edge transition from "timer running" to "timer stopped", and the Combination Switch detects only states, not transitions between states.

The workflow to use is to create a scene which fires when the timer completes, and which Pokes the combination switch.  The Combination switch has the garage light state as its condition.  You then create a second scene which uses the "Poked while switch is on" trigger, and that scene performs the action (shut the door).
Title: Re: Combination Virtual switch plugin (UI5)
Post by: TheKorn on June 17, 2015, 04:38:29 am
Well, I guess I'm glad I included what I'm intending to do!

I guess the genesis of the problem is that I don't understand what poking a combination switch does.  What does poking the combo switch do?  I re-skimmed the first few posts in this thread but didn't see a mention of it.

If I'm reading your solution correctly, I'd create a combination switch with only one input?  Wouldn't that mean I'd be ANDing the garage light status with...  nothing?  (Wouldn't that effectively be (1 && null) == false always??????)

Clearly I'm confused, but I think I'm confused enough that it feels like I'm not even asking intelligent questions!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 17, 2015, 05:45:12 pm
A lot of the confusion about scenes and Boolean operations is that people conflate instantaneous events (such as a timer finishing) with ongoing states (such as the garage light being on).  It's made worse when people join those into a sentence with a Boolean-like words like "and", even though there's nothing truly Boolean about the relationship.  Just because it works in English doesn't mean it works in programmerese.  Allow me to rephrase your example in terms that are more akin to the way Vera treats events and conditions:
Quote
WHENEVER the timer finishes,
IF the light is on,
DO THE ACTION close the door.
There's actually no "and" in it.

How the Combination Switch represents this kind of thing is that it lists the IF-conditions as its list of conditions, in this case only one, but that's OK*.  The Combination Switch keeps track of the state of these conditions (ahem, this condition) and its lightbulb status shows whether the IF condition is considered satisfied (on) or not satisfied (off).  The WHENEVER instantaneous event triggers a scene (scenes are also instantaneous) which activates the Poke action (also instantaneous) on the Combination Switch.  The Combination Switch generates its own (instantaneous) events that react to the Poke: either the Poke is passed through because the conditions are satisfied, or the Poke is suppressed and nothing happens.
Quote
WHENEVER the combination switch is Poked,
IF the combination switch's list of conditions is satisfied,
DO THE ACTION of running a scene.

Now map that back to the two scenes that I described in my previous post and you can see how it produces the logic in your example.

* ANDing with "nothing" is defined in Boolean logic as ANDing with true, which just returns the original thing again.  Though don't think of the Combination Switch as doing an "AND".  It's just counting how many of its conditions are true and turning itself on when a threshold of those conditions is met.  Which could be as low as 1.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: axon on June 19, 2015, 08:46:01 am
Hi futzle,

I am newbie on the forum, and I am not sure if I am out of topic, as my doubts is on UI7.
I have a Vera Edge with the firmware 1.7.1181 and I am trying to do a simple Combination Switch but I am having some trouble to save the changes.

For example, I want to do the following scene:
* Weather conditions - World Weather - Cloudy
* Weather conditions - World Weather - Mostly Cloudy
* Sun position - Heliotrope - Altitude - in range 8? to 90?
* Temperature - Outdoor - Temperature (NETATMO) - is in range 1? to 29?

Switch is on when 3 or more watched items are true

After configure the above settings on a CS I go back and Save the changes.
Then when I confirm the changes the configuration is different and it looks like this:

* Weather conditions - World Weather - Cloudy
*** Weather conditions - World Weather - Chance of Showers  :P
* Sun position - Heliotrope - Altitude - in range 8? to 90?
* Temperature - Outdoor - Temperature (NETATMO) - is in range 1? to 29?

Switch is on when 3 or more watched items are true

Doing other modifications to this CS it is very difficult and almost impossible to save any changes.
I am accessing the VERA by a local LAN.

Could you please help me to solve this issue?

Best regards,
axon
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 20, 2015, 03:02:21 am
*** Weather conditions - World Weather - Chance of Showers  :P

It might be just a display issue.  Go to the Advanced Tab > Variables and see what is listed for the variables that begin with a digit.  That is a better indicator of what the combination switch is really measuring.

UI7 broke a lot of things with plugins that use a lot of JavaScript, like this one.  I'm not really motivated to fix it until MCV provides better documentation on how they are supposed to behave.

(If you are new around here, see also the Program Logic plugins, which has its own subforum.  This is where users go when they find that they have grown beyond Combination Switches.)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 22, 2015, 06:30:39 am
The source for this plugin is now at https://github.com/futzle/MiOS-CombinationSwitch.  This is a clone of the SVN repository at code.mios.com.  From now on only the GitHub repository will receive updates.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: vikejriw on September 22, 2015, 03:51:30 pm
It might be just a display issue.  Go to the Advanced Tab > Variables and see what is listed for the variables that begin with a digit.  That is a better indicator of what the combination switch is really measuring.

UI7 broke a lot of things with plugins that use a lot of JavaScript, like this one.  I'm not really motivated to fix it until MCV provides better documentation on how they are supposed to behave.

(If you are new around here, see also the Program Logic plugins, which has its own subforum.  This is where users go when they find that they have grown beyond Combination Switches.)

So I am also a newbie and I installed this plugin, but cannot configure it. I get an error saying 'Failed to get plugins'. Not sure how to configure this at this point.
Any help would be appreciated. My setup is pretty simple :
- Two virtual switches which are toggled based on phone app (vera proximity).
- When they are both on switch the virtual switch to on.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on September 24, 2015, 06:59:57 am
I get an error saying 'Failed to get plugins'. Not sure how to configure this at this point.
This most commonly happens because you are not on the same LAN as your Vera (or you are using "Secure my Vera" which has the same effect).  You have to be directly connected to your Vera to configure a Combination Switch.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: B3rt on September 29, 2015, 03:13:46 pm
is it possible to add a function to this great plugin?

I would like to see if the switch is set to 'true' if would turn 'on' in the interface.
For example, when i add 7 lights and add a rule that at least 3 are 'on' it return '1' / 'true'

The UI displays only 3/7   but not that it is now 'true' or 'on'

Itg would be great if the icon of the switch turns red (or green) as in a security sensor when they are turned on. That way you can see immidiatly if the rules are met or not.

Is this possible to add in a feature update?

(i use it on a vera edge running UI7)
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on September 29, 2015, 05:20:47 pm
You can always have the scene that is triggered by the combination switch set a a Virtual Multi-Switch .... or just a string in a Multi-String plugin.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: B3rt on September 29, 2015, 05:27:44 pm
is that a reply to my question?

If so i know that a scene trigger is possible, i do this now a lot!
But it would be great if i can see instantly if a switch is turned on or off, this would make debugging a lot easier/quicker.
At the moment you cannot see if a switch is turned on or off if you do not know the rules of the switch, these rules are not visible on the dashbord. 
So if you use the switch in a scene and the scene does not work you cannot see instanly if the switch rules are met or not.

It does not add functionality but makes it just easier to see the status and therefore easier to use :)

Hope this can be added sometime....
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on September 29, 2015, 06:04:45 pm
is it possible to add a function to this great plugin?
I would like to see if the switch is set to 'true' if would turn 'on' in the interface.

In UI5 the icon changes to indicate whether the device is On or Off.  UI7 changed icon support in an incompatible way and I haven't added it back in.  One day I might do this, but it's been low on my list.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: specks on November 22, 2015, 11:54:18 pm
I have a scene (dimmer) triggered by MiniMote button 2, but I don't want it to trigger the scene if it's at 50%.  Is there a way to make it work with the combination switch?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on November 23, 2015, 11:18:41 am

I have a scene (dimmer) triggered by MiniMote button 2, but I don't want it to trigger the scene if it's at 50%.  Is there a way to make it work with the combination switch?

Yep, this is what the Poke button is for.

Make two scenes and one Combination Switch.

Scene 1 is activated by the Minimote. It performs the Poke action on the Combination Switch.

Scene 2 is activated by the Combination Switch event "switch is poked while on". It does whatever you want to happen (say, turn on a light).

Configure the Combination Switch conditions so that it is On when you want the Minimote to succeed at the action, and Off when you want the Minimote to have no effect.

There are other ways of doing this without Combination Switch. If you are willing to write a line of Luup code (see the Conditional Scene sticky topic) you can get away with using just one scene.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: specks on November 23, 2015, 03:48:56 pm

I have a scene (dimmer) triggered by MiniMote button 2, but I don't want it to trigger the scene if it's at 50%.  Is there a way to make it work with the combination switch?

Yep, this is what the Poke button is for.

Make two scenes and one Combination Switch.

Scene 1 is activated by the Minimote. It performs the Poke action on the Combination Switch.

Scene 2 is activated by the Combination Switch event "switch is poked while on". It does whatever you want to happen (say, turn on a light).

Configure the Combination Switch conditions so that it is On when you want the Minimote to succeed at the action, and Off when you want the Minimote to have no effect.

There are other ways of doing this without Combination Switch. If you are willing to write a line of Luup code (see the Conditional Scene sticky topic) you can get away with using just one scene.
Thanks! I'm willing to copy other people's Luup code, but too lazy to learn.
Thanks again for the great plugin.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: DesT on December 19, 2015, 09:47:03 pm
Hi,

Is it possible to change the refresh interval of the Combination Switch ?

Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on December 20, 2015, 12:04:56 am

Is it possible to change the refresh interval of the Combination Switch ?

There is no refresh interval. This plugin uses the Variable Watch feature to trigger instantly as soon as the condition changes.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: battars on March 17, 2016, 06:39:10 pm
Sorry in advance if this is a repeat question..

Is there a way to using this plugin in conjunction with the status of a button in the multiswitch plugin, instead of the status of a virtual switch?

I have a light that I want to turn on based on a motion event (which pokes the combination switch), and the setup works great with a virtual switch that gets reset to on each morning (and set to off when the light on scene runs), but I'm trying to consolidate from many virtual switches to just 1 multiswitch. Thanks!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on March 17, 2016, 07:05:43 pm

Is there a way to using this plugin in conjunction with the status of a button in the multiswitch plugin, instead of the status of a virtual switch?

Probably not. But the Combination Switch plugin is designed to be extensible so if you know what the service ids and variable names in the Multiswitch devices are then support could be added.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: battars on March 19, 2016, 10:08:41 pm
Thanks for the reply.

I see the service ID, but I'm not 100% sure what a variable name is? Based on what I'm assuming it means, then for button 1, the variable name is Status1. Withat that information in hand, is there a guide on how I can add support for the multiswitch? Thanks again for the help


(Below is from another thread)



device_type: urn:schemas-dcineco-com:device:MSwitch:1 or  urn:schemas-dcineco-com:device:MSwitchNN:1
                       The second form is used when button labels are customized. NN is the device number.

serviceId: urn:dcineco-com:serviceId:MSwitch1

Variables
Status1: "0" or "1"
Status2: "0" or "1"
 ...

Status8: "0" or "1"
BtnNames: json array of button labels "["label1","label2", ... "label8"]"  (This did not exist prior to V1.1)

actions:
SetStatus1  newStatus1=<"0","1","-1">  When newStatusX=-1, StatusX is toggled. This is the default action for the UI buttons.
SetStatus2  newStatus2=<"0","1","-1">
 ...
SetStatus8  newStatus8=<"0","1","-1">
Title: Combination Virtual switch plugin (UI5)
Post by: futzle on March 19, 2016, 11:52:42 pm
Yep, that's the information needed.

Adding support for a device type means making a file like one of the existing ones (https://github.com/futzle/MiOS-CombinationSwitch/blob/master/L_CombinationSwitch1Plugin_SwitchPowerStatus.lua) and then adding it to your Vera.  There's no guide for making a file except to read the comments in the file I linked to, and to use one of the 20 existing device files in the same directory for inspiration.  I'd start with the VariableContainer file as the closest prior art.

I wouldn't recommend it as a beginners' programming exercise, but if you are OK about writing Lua code that produces a string containing JavaScript code then you'll be fine.  Most of the code is boilerplate and doesn't require full comprehension; I haven't touched the plugin in two years and a lot of it is opaque to me now.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: tedp on April 04, 2016, 07:24:47 pm
Hello -- I'm working on integrating the Combo Switch with Vera Alerts and the Workflow feature of altUI to give me periodic repeated notifications if certain sensors are tripped. I am wondering if there is a way to infer which of the participating devices is causing the Combination Switch to show "true"?

For example, I have 4 sensors that make up my combo switch. I wrote up the following LUA in hopes of getting the names of the devices causing the combo switch to be on:
Code: [Select]
alertMsg = ""
for i = 1 , luup.variable_get("urn:futzle-com:serviceId:CombinationSwitch1", "WatchCount", 152) do
  founddevice=luup.variable_get("urn:futzle-com:serviceId:CombinationSwitch1", i.."DeviceId", 152)
  deviceinfo=luup.devices[tonumber(founddevice)].description
  alertMsg = alertMsg.." "..deviceinfo
 end
luup.call_action("urn:richardgreen:serviceId:VeraAlert1", "SendAlert", {Message = "Repeated timeout for "..alertMsg.."{tone:2}"}, 192)
return true

The good news is that the code works -- I can do a reverse lookup and get the names of all the devices that make up the Combo Switch! However, I only want to add the device names that causing the combo switch to be active (i.e. the open doors). Looking through the variables, I found the variables "nIsTripped" (where n is 1, 2, 3...). I was hoping to use these variables in my loop to find which devices are causing the switch to be active and send that info via the alert. However, it seems that nIsTripped is ALWAYS '1' regardless if the actual device is tripped or not.

Am I on the right track to implement this functionality, or is there something I'm missing?

Thanks
-Ted
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on April 04, 2016, 08:17:38 pm
Sorry, that information doesn't exist in the plugin. In fact, not every condition needs to be tied to exactly one device: some may not depend on a device at all and some may depend on more than one device. Just because the most common use cases are one-condition-per-device it doesn't mean that's true in general. I'd go so far as to say that what you want to do is not reflected in the data model of the plugin.

The nIsTripped variable you found doesn't describe the state of a sensor that the Combination Switch is monitoring; it specifies whether the state of a monitored sensor contributes to the count if the sensor is tripped (1) or not tripped (0).
Title: Re: Combination Virtual switch plugin (UI5)
Post by: tedp on April 04, 2016, 11:32:51 pm
Sorry, that information doesn't exist in the plugin. In fact, not every condition needs to be tied to exactly one device: some may not depend on a device at all and some may depend on more than one device. Just because the most common use cases are one-condition-per-device it doesn't mean that's true in general. I'd go so far as to say that what you want to do is not reflected in the data model of the plugin.

The nIsTripped variable you found doesn't describe the state of a sensor that the Combination Switch is monitoring; it specifies whether the state of a monitored sensor contributes to the count if the sensor is tripped (1) or not tripped (0).

Thanks .. I THINK I get it. Regardless, I realized I can just poll the status of the sensors directly. Of course, I have to ensure that all the inputs to the Combo Switch are all sensors. This is how I did it:

Code: [Select]
local alertMsg = ""
for i = 1 , luup.variable_get("urn:futzle-com:serviceId:CombinationSwitch1", "WatchCount", 152) do
  local foundDeviceStr, tstamp = luup.variable_get("urn:futzle-com:serviceId:CombinationSwitch1", i.."DeviceId", 152)
  local foundDevice=tonumber(foundDeviceStr)
  local deviceInfo=luup.devices[(foundDevice)].description
  local deviceState=luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped", tonumber(foundDevice))
  print (deviceState)
  if deviceState=='1' then
    alertMsg = (alertMsg .. " " .. deviceInfo)
  end
 end
luup.call_action("urn:richardgreen:serviceId:VeraAlert1", "SendAlert", {Message = "{tone:2}Sensor Timeout: "..alertMsg}, 192)
return true
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on April 05, 2016, 12:15:02 am
That'll work. To fully reflect what the Combination Switch is doing you should be comparing deviceState not against 1, but against the value in nIsTripped, which will be 0 if the condition is "is not tripped".
Title: Re: Combination Virtual switch plugin (UI5)
Post by: tedp on April 05, 2016, 12:21:40 am
Hmmm.. I guess I still don't fully understand the nIsTripped variable. For my setup, all of the "IsTripped" variables are always '1' regardless of whether or not the sensor is actually tripped. At least my klduge works. Technically, I can wrap a handler against each of the device types and have different behaviors based on whether it's a security sensor or something else. For now, what I have will suffice.

Thanks for all the feedback!

Regards
-Ted
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on April 05, 2016, 12:44:10 am
I still don't fully understand the nIsTripped variable. For my setup, all of the "IsTripped" variables are always '1' regardless of whether or not the sensor is actually tripped.

That'll be because all your conditions in the configurations of your Combination Switches are the first option in this dropdown list.  Change it to another option and see what the variable does.

Title: Re: Combination Virtual switch plugin (UI5)
Post by: tedp on April 05, 2016, 12:48:21 am
OK  -- now I get it.
Thanks
Title: Re: Combination Virtual switch plugin (UI7)
Post by: snovvman on April 29, 2016, 09:54:36 am
Somewhere between my transition from Vera Lite UI5 > Vera Lite UI7 > Vera Plus UI7, Combination Switch may have stopped working.

It is on Version 19.

My setup:
If Heliotrope altitude is within a certain range (night time)
AND
Motion sensor detects motion
AND
Virtual switch is on (this allows me to easily disable/enable the function)

The Combo Switch turns on.

It triggers a scene that turns on a light for a duration, then turns it off.  It sends a notification (via VeraAlerts).

I noticed that this setup no longer works.  For troubleshooting, I changed the scene trigger to "Combination Switch: Poked while virtual switch is on".  When I poke the switch, the light does not turn on.  I did notice that when I click on "Poke" from the Devices page, the color of the button does not change.  When I go to the device control, it does change color state when I press it.

Any ideas why?  Thank you...
Title: Re: Combination Virtual switch plugin (UI5)
Post by: RichardTSchaefer on April 29, 2016, 01:03:52 pm
Vera changed the Trigger API for security devices in UI7.
I believe Combination Switch has some hard coded logic that knows about these triggers.
So Combination switch might have problems with security devices.

I do not know if @futzle is actively maintaining this.

For PLEG and Scene Users, many users had to re-create the Security device input triggers. It may be as simple as that for Combination Switch, or she may need to create a separate UI5 and UI7 version of the code.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: snovvman on April 29, 2016, 01:53:57 pm
Vera changed the Trigger API for security devices in UI7.
I believe Combination Switch has some hard coded logic that knows about these triggers.
So Combination switch might have problems with security devices.

I do not know if @futzle is actively maintaining this.

For PLEG and Scene Users, many users had to re-create the Security device input triggers. It may be as simple as that for Combination Switch, or she may need to create a separate UI5 and UI7 version of the code.

Funny you should mention PLEG.  I started looking to recreate the functions in PLEG, but ran into a few questions.  I'll post them in the PLEG forum later today.  Cheers.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on April 29, 2016, 07:57:12 pm
snovvman, see if you can identify which of the conditions has stopped being counted, by making three separate Combination Switches, each with only one of the conditions in it.

I'm on an earlier UI7* and I haven't experienced the kind of problem you describe, but maybe an incompatible change has been introduced in a later release of UI7.

* I probably won't be upgrading my Vera any more. If and when it breaks due to API fatigue I will evaluate the options available at the time. I consider the Combination Switch plugin to be on life support: it will only get fixes that are small and easy to make. Any big shift in the underlying platform could kill it.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: snovvman on April 30, 2016, 11:41:22 am
snovvman, see if you can identify which of the conditions has stopped being counted, by making three separate Combination Switches, each with only one of the conditions in it.

I'm on an earlier UI7* and I haven't experienced the kind of problem you describe, but maybe an incompatible change has been introduced in a later release of UI7.

* I probably won't be upgrading my Vera any more. If and when it breaks due to API fatigue I will evaluate the options available at the time. I consider the Combination Switch plugin to be on life support: it will only get fixes that are small and easy to make. Any big shift in the underlying platform could kill it.

Thank you. [Applauded]  I will provide more info tomorrow when I'm home.  As far as I can tell, the only variable is the motion sensor.  Combo Switch properly reports 2 out of 3 (night and virtual switch on) and 1 of 3 (day and virtual switch on).  I need to observe if 3/3 appears when motion is deteced.  For testing, I changed the scene to turn on when Combo Switch is poked, then "poked", but the scene did not run.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: snovvman on April 30, 2016, 11:42:41 am
BTW, is this the end of the road for you with Vera?  If yes, where are you headed?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on May 01, 2016, 05:19:43 am
BTW, is this the end of the road for you with Vera?  If yes, where are you headed?
I haven't decided yet. I'm just going to weigh Vera on the same scale as I weigh the alternatives, without worrying about sunk costs.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: 8trek on June 14, 2016, 04:49:17 pm
I have a combination switch set to be on when a motion detector is armed.  I have a scene which always pokes this combo switch when a door is opened.  Another scene which is triggered when combo switch is poked and is on which in turn is supposed to turn on several lights.  Initially it seemed to work but now have about a 50% failure rate in which the lights do not turn on when conditions are true.  Any ideas?

btw... new to this forum... what's up with this verification process to send replies?  never seen something this painful just to prove you're human.  Have to use google just to get some of these answers.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 14, 2016, 07:19:02 pm
I have a combination switch set to be on when a motion detector is armed.  I have a scene which always pokes this combo switch when a door is opened.  Another scene which is triggered when combo switch is poked and is on which in turn is supposed to turn on several lights.  Initially it seemed to work but now have about a 50% failure rate in which the lights do not turn on when conditions are true.  Any ideas?

Your logic seems correct, so there's either a problem with the inputs, or a bug in the plugin, or a problem with the triggered (output) scene.  The only way to be sure is to capture a Luup log while you arm the motion detector and open the door. The log should have enough information to distinguish the possible failure modes.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: 8trek on June 14, 2016, 09:48:35 pm
I have "store logs on usb device" checked with a flash drive plugged into the vera plus.  Although I've never attempted to look at the flash drive to see what is stored on it.  All log checkboxes are selected actually.... but i'm guessing you are referring to some code i need to include in order to achieve what you're saying?  Please elaborate &/or better yet provide code to do this?  :-)

again btw.... what the h*ll is up with this verification bs?  These idiotic messed up images of what appear to be letters.... really?  We're supposed to decipher this just to post a question?  I'm on attempt number 4 as i type this.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on June 14, 2016, 11:46:32 pm
http://forum.micasaverde.com/index.php?topic=9958.0 or Google "Vera logs".
Title: Re: Combination Virtual switch plugin (UI5)
Post by: svanni on August 07, 2016, 04:30:32 pm
Any chance you can add a date/time window to the list of critieria options ?
ie: if MWF or if between May 1 and May 15 ???

Just a thought.

Thanks,
Steve
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on August 07, 2016, 10:39:51 pm
Any chance you can add a date/time window to the list of critieria options ?

It's been asked for before, but the architecture of the plugin makes it not possible. Read back in this topic for the discussions.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: slajgaj on September 06, 2016, 12:00:14 pm
Futze!

I have 3 motion detectors and the combination switch is show the 3/1 or 3/2
But the scene not running (trigger is Combination status)
I showed in the combination switch 'Advanced" and the status is 0 !
Title: Re: Combination Virtual switch plugin (UI5)
Post by: dpaik on January 17, 2017, 04:14:29 pm
Is anyone else having issues with 1.7.2406 firmware.  Although previously programmed Combination Switches still function the programing UI is missing. "Failed to get plugins" error on the configure tab.


Update:  Nevermind...I rediscovered that the Combination Switch Plugin must be programmed locally and not from a remote location.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Gr8hifi on February 04, 2017, 04:14:33 pm
I really like this plugin a lot but I'm having trouble with it.  my goal is for a motion detector (Aeon 6-1) to fire a lamp when it senses motion AND when the ambient light in the area is low.  I've tried several settings starting with 1-15.  i'm now down to "1 to 2" and it still thinks it's dark enough in the room to light the lamp.  Am I missing something?  I have set to where "Light Sensor Level" on "6 in 1 Multisensor (light) #82" is in range "1" to "2".

Any help is greatly appreciated.  Again, wonderful plugin.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: iHomeCtrl on March 27, 2017, 10:45:30 am
Has anyone had issues with using the Combination switch and doing configuration remotely?  I am getting a pluhin not found error when I try to configure the virtual combination switch.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Aaron on March 27, 2017, 11:10:48 am
Never have a problem... Been using for many years

Sent from my SAMSUNG-SM-G935A using Tapatalk

Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on March 27, 2017, 04:50:06 pm
Has anyone had issues with using the Combination switch and doing configuration remotely?  I am getting a pluhin not found error when I try to configure the virtual combination switch.

Configuration only ever worked locally (or through a VPN which is equivalent to being local).

One of many previous discussions about this: http://forum.micasaverde.com/index.php?topic=30155.msg233146#msg233146
Title: Re: Combination Virtual switch plugin (UI5)
Post by: JustDabbling on November 25, 2018, 12:30:50 pm
Hi Fuzle.
Old thread but just wanted to reach out if anyone still listening: what is actually required to be logged in locally? (I have the missing configuration options issue) I am logged in using local Nat'ed IP 192.168.x.x. But still I do not get the option to configure.
A previous poster mentioned tech support had fixed his local access. How? What was done? Ive tried multiple browsers, multiple platforms, all have same issue. Is it a networking issue at my LAN, is it my laptop/phone having too high security levels or what can be the cause?
BR,
/Lars
Title: Re: Combination Virtual switch plugin (UI5)
Post by: ckbsmartM on February 02, 2019, 03:59:44 am
Has anyone found a solution to get the combination switch configuration page working? I am on the same LAN and I have tried 2 pc and 4 browsers on each. Nothing. Thank you.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: blacey on February 02, 2019, 10:01:59 pm
Has anyone found a solution to get the combination switch configuration page working? I am on the same LAN and I have tried 2 pc and 4 browsers on each. Nothing. Thank you.

You might be better off trying the Reactor plugin because Futzle, the author of Combination Switch, is no longer active in the Vera forums but Reactor provides commensurate capability and more.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on February 06, 2019, 05:30:31 am
You might be better off trying the Reactor plugin because Futzle, the author of Combination Switch, is no longer active in the Vera forums but Reactor provides commensurate capability and more.

Please do use Reactor (or PLEG), everyone.  My Vera unit is now in a box and I'm not developing Vera plugins any more because it would be impossible for me to test them.

All the source code for this plugin (and my others) will remain on Github for the foreseeable future, and I welcome forks if anyone wants to adopt any of them.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Jim McGhee on February 07, 2019, 11:40:49 am
Please do use Reactor (or PLEG), everyone.  My Vera unit is now in a box and I'm not developing Vera plugins any more because it would be impossible for me to test them.

All the source code for this plugin (and my others) will remain on Github for the foreseeable future, and I welcome forks if anyone wants to adopt any of them.

But...
What if I really REALLY LIKE your CombinationSwitch (and everything else you've written here)??  :)
I don't claim to under stand this but when I was having some problems with CS I update it through the Vera Apps page.  After this, all my CS icons went away!!
I discovered my D_CombinationSwitch1.json that I got from the update was pointing to icons\/Binary_Light.png which does NOT exist anywhere on my VeraPlus.
I looked at the version on Git and its version of D_CombinationSwitch1.json refers to binary_light_default.png which DOES exist.
After loading the Git version the icons came back.
I'm confused as to why the Git version does not match Vera's version.
Isn't it supposed to?
Title: Re: Combination Virtual switch plugin (UI5)
Post by: HansW on February 07, 2019, 05:10:49 pm
Please do use Reactor (or PLEG), everyone.  My Vera unit is now in a box and I'm not developing Vera plugins any more because it would be impossible for me to test them.
Hello Futzle,

The main reason I use Vera is your Caddx plugin and although I love the openness of Vera I hate that fact that after 10 years of using always the newest unit, rebuilding from scratch every tedious time, it has never become stable in all these years and still hangs every now and then.

So my question is, what unit have you moved to and does it integrate with the Caddx alarm system?

Regards and thanks again for your great Caddx and CS plugins, hansW
Title: Re: Combination Virtual switch plugin (UI5)
Post by: futzle on February 07, 2019, 11:16:23 pm
I'm confused as to why the Git version does not match Vera's version.
Isn't it supposed to?

TBQH I don't remember if I gave up updating the Vera apps.mios.com release.  apps.mios.com is awful to update and has to be done through the point-and-click web UI, so it can't be scripted into a deployment process.  So it's totally possible that the Github files are tracking a bit ahead of the apps.mios.com files.

So my question is, what unit have you moved to and does it integrate with the Caddx alarm system?

I've migrated to ... less automation.  (Really.  I've changed jobs, and the hours are much more flexible, including working-from-home arrangements, so I don't need the home to run as autonomously as it did.)  The size of the Vera-shaped hole in my day-to-day life is just too small to bother filling with anything else.  That doesn't mean I've abandoned tinkering: I'm playing with a more federated approach to the parts that need to talk to each other, rather than a centralized server like Vera or its rivals.  I'm letting my Philips hue hub take care of its own light scenes.  The cameras record to a NAS independently of home control.  I'm teaching myself a new programming language and network message framework to make a daemon which listens to Caddx alarm panel events and publishes them to whatever other devices in my household need to know.  I'll stick that code on my Github page when I'm happy with it.
Title: Re: Combination Virtual switch plugin (UI5)
Post by: HansW on February 08, 2019, 11:42:10 am
I'm teaching myself a new programming language and network message framework to make a daemon which listens to Caddx alarm panel events and publishes them to whatever other devices in my household need to know.  I'll stick that code on my Github page when I'm happy with it.

Well, I like your approach and will certainly give your code a try when you publish it! Thanks in advance. I have been looking at NodeRed myself and like

In my setup I used the Skaro Automation Bridge to connect to Siri and Google. Apple and Google support a growing number of devices very stable so although I love the openness of Vera, I find it's role getting less and less a good thing. Not due to its horrible scene programming system, although improved over the years, but due to its rebooting daily and about once a month either hanging or not connecting to Caddx. 

Thanks again for your plugins!!
Title: Re: Combination Virtual switch plugin (UI5)
Post by: Catman on February 08, 2019, 03:51:52 pm
NAND data corruption may be a possibility from what I've been reading. Do you have a backup from before the issues?

C
Title: Re: Combination Virtual switch plugin (UI5)
Post by: ckbsmartM on February 18, 2019, 03:49:25 pm
i think there is something related to how the Ajax.Request("../port_3480/data_request" ... is written. given that the table of options is not shown....