Author Topic: New Plugin: Switchboard -- Virtual Switches Re-imagined  (Read 1888 times)

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1111
  • Karma: +184/-3
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #30 on: February 18, 2019, 06:17:51 pm »
I'm not finding tristate.xml file on github, the .json is there but not the .xml or am I looking in the wrong place?

Well, that's a typo! It should be a ".json" suffix. I went back and fixed that in the prior instructions linked, but you should see the JSON file, and that's the one you want to use. Thanks for pointing this out. I've missed that on no less than two re-reads of those instructions today.
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1223
  • Karma: +15/-5
  • Black Cat Control Systems
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #31 on: February 18, 2019, 06:34:25 pm »
Patrick, I'm still not having much luck with the tri-state switch.
I added the .json file, this took out the parent, so I'm left with only a tri-state child.
Is this what is expected?
Living in the Land of Oz, give me a vegemite sandwich. Home Seer, Vera Lite & Edge, Popp, Black Cat Smart Hub & Vera G, Black Cat Lite 1 & 2's a Black Cat Dimmer or 2, Fantem Tec and then some  Black Cat Cat's Eye PIR's & Door-Window Sensors, RFXComm, Broadlink RMPro & Mini plus a Z-UNO or 2.

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1111
  • Karma: +184/-3
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #32 on: February 18, 2019, 07:44:51 pm »
Patrick, I'm still not having much luck with the tri-state switch.
I added the .json file, this took out the parent, so I'm left with only a tri-state child.
Is this what is expected?

Nope. Kinda sounds like you changed the device_json attribute on the parent rather than the child...?
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1223
  • Karma: +15/-5
  • Black Cat Control Systems
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #33 on: February 18, 2019, 09:21:57 pm »
OK, got it now.
Can a timer be added to set the status to void from either the ON or OFF?
Presently I'm using a scene to do this on the "Nothing Virtual Switch" or will it complicate it to much?
Living in the Land of Oz, give me a vegemite sandwich. Home Seer, Vera Lite & Edge, Popp, Black Cat Smart Hub & Vera G, Black Cat Lite 1 & 2's a Black Cat Dimmer or 2, Fantem Tec and then some  Black Cat Cat's Eye PIR's & Door-Window Sensors, RFXComm, Broadlink RMPro & Mini plus a Z-UNO or 2.

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1111
  • Karma: +184/-3
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #34 on: February 18, 2019, 09:40:00 pm »
OK, got it now.
Can a timer be added to set the status to void from either the ON or OFF?
Presently I'm using a scene to do this on the "Nothing Virtual Switch" or will it complicate it to much?

As it happens right now, it only sets the timer auto-reset (impulse switch) timer when you set the switch to "on". I can't see any reason not to reverse the sense of this test and have it set the timer when you set the switch to anything other than "off." It would not change the behavior for binary switches, and I can see the utility for tri-state switches (and you have the option of not using the internal timer and/or using other facilities if you need different behavior).

If you want to hack this into your running code, the change will be to this line around 348 in L_Switchboard1.lua:

Code: [Select]
    if status == "0" or status == "2" then
just change it to...

Code: [Select]
    if state == "0" then
And I'll have this posted to stable by morning, and in the next release, unless there's great gnashing of teeth and wailing outcry from others that this shouldn't happen for some reason. :)
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline Jim McGhee

  • Full Member
  • ***
  • Posts: 139
  • Karma: +5/-1
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #35 on: February 19, 2019, 02:26:43 pm »
Ok, I'm POSITIVE this was working yesterday but today I reinstalled the stable version and every thing works except the 'state agnostic' part.  No matter which way I set the new box under 'options', it doesn't trigger a scene unless the state changes.
I'm sure this was working before I re-uploaded the plugin.

Am I the only one having a problem with the State Agnostic Switch setting on this plugin?  Is it working for anyone else?
TIA, Jim

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1111
  • Karma: +184/-3
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #36 on: February 19, 2019, 03:15:55 pm »
Ok, I'm POSITIVE this was working yesterday but today I reinstalled the stable version and every thing works except the 'state agnostic' part.  No matter which way I set the new box under 'options', it doesn't trigger a scene unless the state changes.
I'm sure this was working before I re-uploaded the plugin.

Am I the only one having a problem with the State Agnostic Switch setting on this plugin?  Is it working for anyone else?
TIA, Jim

What version number is showing on the control panel?
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline Jim McGhee

  • Full Member
  • ***
  • Posts: 139
  • Karma: +5/-1
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #37 on: February 19, 2019, 03:47:14 pm »
Am I the only one having a problem with the State Agnostic Switch setting on this plugin?  Is it working for anyone else?
TIA, Jim

What version number is showing on the control panel?

Sorry, I should have lead with that.   :-[

Switchboard ver 1.2 ? 2018,2019 Patrick H. Rigney, All Rights Reserved

It might be that I'm using it wrong. 

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1111
  • Karma: +184/-3
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #38 on: February 19, 2019, 03:50:58 pm »
Am I the only one having a problem with the State Agnostic Switch setting on this plugin?  Is it working for anyone else?
TIA, Jim

What version number is showing on the control panel?

Sorry, I should have lead with that.   :-[

Switchboard ver 1.2 ? 2018,2019 Patrick H. Rigney, All Rights Reserved

It might be that I'm using it wrong.

Seems right. Vera or openLuup? I should have asked that in my lead-in, too... :)
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline Jim McGhee

  • Full Member
  • ***
  • Posts: 139
  • Karma: +5/-1
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #39 on: February 19, 2019, 04:06:47 pm »

Seems right. Vera or openLuup? I should have asked that in my lead-in, too... :)

I'm on a VeraPlus which does have openLuup installed but I manually installed Switchboard on the actual VeraPlus.  And I am testing there too.
I also have a VeraLite testbed that does NOT have openLuup installed and I have the same problem.

I've set up the test with both Vera and AltUI.  Same story on both.

I took the liberty of adding a couple of calls to luup.log in SetVar and can see that it does, in fact set the Status even when the value hasn't changed but for some reason this does not trigger the scene.  ??
Do I need to set up the scene trigger special??

And, thanks for the quick reply.

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1223
  • Karma: +15/-5
  • Black Cat Control Systems
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #40 on: February 19, 2019, 04:20:55 pm »
Has everyone got different expectations of what the tri-state is meant to do?


For me, I've left the timer toggled off and created 2 scenes to alter the state from either ON or OFF to VOID.
It works as I expect it to.
Patrick, I'll have a play with the code later today (if I get some spare time) and see what the changes do.
Living in the Land of Oz, give me a vegemite sandwich. Home Seer, Vera Lite & Edge, Popp, Black Cat Smart Hub & Vera G, Black Cat Lite 1 & 2's a Black Cat Dimmer or 2, Fantem Tec and then some  Black Cat Cat's Eye PIR's & Door-Window Sensors, RFXComm, Broadlink RMPro & Mini plus a Z-UNO or 2.

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1111
  • Karma: +184/-3
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #41 on: February 19, 2019, 04:45:02 pm »

Seems right. Vera or openLuup? I should have asked that in my lead-in, too... :)

I'm on a VeraPlus which does have openLuup installed but I manually installed Switchboard on the actual VeraPlus.  And I am testing there too.
I also have a VeraLite testbed that does NOT have openLuup installed and I have the same problem.

I've set up the test with both Vera and AltUI.  Same story on both.

I took the liberty of adding a couple of calls to luup.log in SetVar and can see that it does, in fact set the Status even when the value hasn't changed but for some reason this does not trigger the scene.  ??
Do I need to set up the scene trigger special??

And, thanks for the quick reply.

I've also confirmed that it sets the Status value every time on both platforms. This is easily seen on both: openLuup always logs all variable changes, and Vera logs them at log level 6.

I'm able to confirm that Vera doesn't run the scene on repeats as expected. I can also confirm that watch callbacks are not being called when the variable is set but unchanged, so other subsystems and plugins, like Reactor, are also unaware of repeats.
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline Jim McGhee

  • Full Member
  • ***
  • Posts: 139
  • Karma: +5/-1
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #42 on: February 19, 2019, 05:32:34 pm »
I'm able to confirm that Vera doesn't run the scene on repeats as expected. I can also confirm that watch callbacks are not being called when the variable is set but unchanged, so other subsystems and plugins, like Reactor, are also unaware of repeats.

So it's not just me.  I feel a little better now.    ???
Except that I could swear it worked OK the first time.

This is the part of coding that I don't like. 
When everything is correct, except that it just doesn't work!!   :(

Offline rigpapa

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1111
  • Karma: +184/-3
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #43 on: February 19, 2019, 06:01:00 pm »
I'm able to confirm that Vera doesn't run the scene on repeats as expected. I can also confirm that watch callbacks are not being called when the variable is set but unchanged, so other subsystems and plugins, like Reactor, are also unaware of repeats.

So it's not just me.  I feel a little better now.    ???
Except that I could swear it worked OK the first time.

This is the part of coding that I don't like. 
When everything is correct, except that it just doesn't work!!   :(

Works great on openLuup! Just like we want! :)

For some reason, I think this is a behavior change. I was testing on 1040, which is the most current firmware for Vera3. I also have 963 on a Lite, so I just tested on that, and the behavior is the same. And maybe I'm thinking of openLuup, but I want to say that it hasn't always been like this. But 963 goes quite a way back, so I'm likely mistaken. If anyone else had any input to the history of this, your input would be welcome.

FWIW, I've also tried testing with the rarely used startup parameter to luup.variable_set, and testing with it both true and false, and all I learned was that (a) false doesn't change the behavior we're looking at, and (b) true doesn't work as documented.
Author of Reactor, DelayLight, SiteSensor, Rachio, Deus Ex Machina II, Intesis WMP Gateway, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3, Lite. Hassio, Slapdash.

Offline Jim McGhee

  • Full Member
  • ***
  • Posts: 139
  • Karma: +5/-1
Re: New Plugin: Switchboard -- Virtual Switches Re-imagined
« Reply #44 on: February 20, 2019, 03:50:21 pm »

FWIW, I've also tried testing with the rarely used startup parameter to luup.variable_set, and testing with it both true and false, and all I learned was that (a) false doesn't change the behavior we're looking at, and (b) true doesn't work as documented.

Any chance a workaround can be found?  Any way I can help?
So hard to believe Vera's documentation could be wrong.  (NOT!)   :( >:( :(
Thanks,
Jim