We have moved at community.getvera.com

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

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Combination Virtual switch plugin (UI5)
« Reply #45 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.
« Last Edit: July 22, 2012, 01:38:37 am by futzle »

Online Brientim

  • Sr. Hero Member
  • ******
  • Posts: 2497
  • Karma: +78/-7
Re: Combination Virtual switch plugin (UI5)
« Reply #46 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.

Offline tdinardo

  • Full Member
  • ***
  • Posts: 150
  • Karma: +1/-1
Re: Combination Virtual switch plugin (UI5)
« Reply #47 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?

Offline capjay

  • Hero Member
  • *****
  • Posts: 675
  • Karma: +9/-3
Re: Combination Virtual switch plugin (UI5)
« Reply #48 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

Offline tdinardo

  • Full Member
  • ***
  • Posts: 150
  • Karma: +1/-1
Re: Combination Virtual switch plugin (UI5)
« Reply #49 on: July 22, 2012, 09:30:16 pm »
Cool. Thanks.

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Re: Combination Virtual switch plugin (UI5)
« Reply #50 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
- veralite UI5 - veralite UI7 - 9 fibaro dimmers - 7 fibaro switches - 2 eminent movement sensors - remote control - opentherm gateway - remote powermeter reading - control of whr930 unit - control of washing machine -

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Combination Virtual switch plugin (UI5)
« Reply #51 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.
  • Create a Countdown Timer device. Call it Light timer.
  • Create a scene. Call it Daytime start. Create a schedule for this scene that comes on when daytime begins (sunrise or a fixed time). Go to the Advanced tab and add an action for Light timer: SetTimerDuration value 900 (15 minutes).
  • Create a scene. Call it Night start. Create a schedule for this scene that comes on when daytime ends (sunset or a fixed time). Go to the Advanced tab and add an action for Light timer: SetTimerDuration value 120 (2 minutes).
  • Now create scenes that connect the sensor to the timer and light devices, as described here.

Note that there are no Combination Switch devices in this setup.  It's not needed.

Offline akash1221

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Combination Virtual switch plugin (UI5)
« Reply #52 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

    Offline huib

    • Full Member
    • ***
    • Posts: 179
    • Karma: +0/-0
    Re: Combination Virtual switch plugin (UI5)
    « Reply #53 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
    - veralite UI5 - veralite UI7 - 9 fibaro dimmers - 7 fibaro switches - 2 eminent movement sensors - remote control - opentherm gateway - remote powermeter reading - control of whr930 unit - control of washing machine -

    Offline futzle

    • Beta Testers
    • Master Member
    • *****
    • Posts: 3260
    • Karma: +192/-9
    Re: Combination Virtual switch plugin (UI5)
    « Reply #54 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).  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).

    Offline futzle

    • Beta Testers
    • Master Member
    • *****
    • Posts: 3260
    • Karma: +192/-9
    Re: Combination Virtual switch plugin (UI5)
    « Reply #55 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.)
    « Last Edit: June 22, 2013, 08:40:51 pm by futzle »

    Offline akash1221

    • Newbie
    • *
    • Posts: 8
    • Karma: +0/-0
    Re: Combination Virtual switch plugin (UI5)
    « Reply #56 on: July 26, 2012, 09:19:39 pm »
    Quote
    It's a visual bug in MiOS (see here).  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

    Offline futzle

    • Beta Testers
    • Master Member
    • *****
    • Posts: 3260
    • Karma: +192/-9
    Re: Combination Virtual switch plugin (UI5)
    « Reply #57 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.

    Offline M2MExpert

    • Jr. Member
    • **
    • Posts: 95
    • Karma: +0/-0
    Re: Combination Switch for Toggle Function
    « Reply #58 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
    - M2MExpert
    Machine to Machine Communications Specialist

    Offline futzle

    • Beta Testers
    • Master Member
    • *****
    • Posts: 3260
    • Karma: +192/-9
    Re: Re: Combination Switch for Toggle Function
    « Reply #59 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