Author Topic: Force turn on/off virtual switch  (Read 338 times)

Offline gabayarden

  • Newbie
  • *
  • Posts: 12
  • Karma: +1/-0
Force turn on/off virtual switch
« on: February 11, 2017, 03:48:05 am »
I am using virtual switch for triggering scences for example:
A virtual switch that represent the TV.
When I turn off the switch the tv will turned off by a scene and the same for turn on.
The problem is when the tv was turned off manually but the switch is in on mode. Now I cant turn on the switch because its already in turn on mode so I need to do it manualy or to turn off then turn on the switch.
Hope you understand  ???
How do I force turn off the virtual switch even if the switch is in off mode?

Offline gabayarden

  • Newbie
  • *
  • Posts: 12
  • Karma: +1/-0
Re: Force turn on/off virtual switch
« Reply #1 on: February 11, 2017, 07:53:45 am »
If any one will also face with this problem:
I added a new state to the virtual switch called "nothing"
then, in any mode switch (on/off) I am changing the switch to "nothing" and then I can switch it to ON or Off over and over again :)
Attached the new virtual switch files

Offline Martin79

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Force turn on/off virtual switch
« Reply #2 on: February 17, 2017, 11:32:20 am »
Hi,
this would be a great feature. but i got a problem to install it. i opened the json, copy the code, go to develop apps/ device simulator json, and paste the code. then i get invalid json error. do i have to add something to the code, or do something else?

Thank you

Offline dpaik

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: Force turn on/off virtual switch
« Reply #3 on: February 20, 2017, 12:20:34 pm »
This works great!!! Thanks for writing this.

Offline Martin79

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Force turn on/off virtual switch
« Reply #4 on: February 20, 2017, 06:05:43 pm »
ok, im really new with vera and i`m just a user without any knowledge in writing pc things, and it is not helpful that my mother tongue is another. could anyone tell me what to do please?
i opened the code on my mac, this happens with text edit, i`ve copied that and paste it into apps/ develop apps/ device simulator.
i get an error???  what am i doing wrong?
i would be very thankfully if anyone would take 2 minutes to explain me how to...

thank you for your time and best regards
martin

Offline Don Phillips

  • Sr. Member
  • ****
  • Posts: 281
  • Karma: +8/-3
Re: Force turn on/off virtual switch
« Reply #5 on: February 20, 2017, 06:40:26 pm »
Download those 2 files and then upload them onto your Vera here:
Vera 3, UI7 1.7.919, CT30 thermostat, Everspring motion detector, GE/Jasco switch, Leviton outlet, Vision door sensor, Insteon garage control, Blue Iris, Sricam SP011, iPhone locator, APCUPSD, VeraMate, VeraAlerts, PLEG, House Modes, Countdown Timer, DVR, Virtual & Multi Switch, Weather, System Mon.

Offline dpaik

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Re: Force turn on/off virtual switch
« Reply #6 on: February 20, 2017, 07:00:34 pm »
Apps>Develop Apps>Luup Files> check "Restart Luup after upload"> then upload the two files

Offline Martin79

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Force turn on/off virtual switch
« Reply #7 on: February 20, 2017, 07:32:06 pm »
this is working :-)
thank you very very much