Author Topic: Use status of combination switch  (Read 129 times)

Offline Flexelex

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Use status of combination switch
« on: November 20, 2017, 06:31:23 am »
Hello All.

I'm trying to improve some of the scences i have setup. I'm using virtual switches and a combination switch to implement geofencing. This all works fine. What i now want to add is to trigger a scene based on the status of the combination switch. The end result should be the following:

When 16.30 comes and combination called "someone home" is true (not becomes true, but IS TRUE at that time), lights turn on. Seems something simple but i cannot get this to work.

Offline akbooer

  • Master Member
  • *******
  • Posts: 5346
  • Karma: +231/-68
  • "Less is more"
Re: Use status of combination switch
« Reply #1 on: November 20, 2017, 07:00:25 am »
See if the advice here help: 

Conditional Scene Execution: Some Examples

In your case, the scene trigger should be the time of day, then you'd have a little bit of Lua code to check the virtual switch status.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P.
Razberry, MySensors Arduino, HomeWave, AltUI, DataYours, openLuup, ZWay, ZeroBrane Studio.

Offline RichardTSchaefer

  • Master Member
  • *******
  • Posts: 9934
  • Karma: +750/-141
    • RTS Services Plugins
Re: Use status of combination switch
« Reply #2 on: November 20, 2017, 07:13:51 am »
You will need condition LUA logic in your scene.
You would trigger the scene at 16:30 and then test the status of the combination switch.

Or you can replace everything with PLEG and use the sequence operation:

Input Schedule:
FourThirtyPM         On every day at 4:30 PM,   off  Interval 10 minutes later

Input Triggers:
Person1Home      VirtualSwitch1 Set
Person2Home      VirtualSwitch2 Set
PernsonNHome    VirtualSwitchN Set

Condition:
AllHome             Person1Home and Person2Home and ... PersonNHome
SomeHome         Person1Home or Person2Hone or  ... PersonNHome
NoneHome          Not SomeHome
SomeHomeInAfternoon            SomeHome and (SomeHome;FourThirtyPM)
AllHomeInAfternoon            AllHome and (AllHome;FourThirtyPM)
NoneHomeInAfternoon            NoneHome and (NoneHome;FourThirtyPM)

Add actions to the above conditions
Condition you might want to also add is when someone comes home at night it turns on some entry lights.
I do this so that when I am carrying bags ... I do not have to try and fumble with light switches or trip over things.



Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3248
  • Karma: +188/-9
Re: Use status of combination switch
« Reply #3 on: November 21, 2017, 04:23:55 am »
When 16.30 comes and combination called "someone home" is true (not becomes true, but IS TRUE at that time), lights turn on.

This is what the trigger "Poked while switch is on" is for.

Create two scenes. One scene is triggered at 16.30, and its action is to poke the Combination Switch.

The second scene is triggered by the Combination Switch being Poked while Switch is On, and its action is to turn on the lights.

If the Combination Switch is poked when it is turned off, nothing happens.