Virtual Panel Plugin

Thanks for pointing that out, BOFH. I’ve included the updated files and also added 18px padding to the top of the label & variable so everything lines up - I assume the slider has a lot of space above it.

I have another anomaly. Two of my rooms have Danfoss TRVs fitted to the radiator and I would like the ability of easily turning heating to that room on/off by setting the TRV to either 22[sup]o[/sup]C or 5[sup]o[/sup]C. I’ve included a Toggle Button on the Virtual Panel to turn On (Occupied) or Off (Vacant).

The Toggled On State is tied to variable CurrentSetpoint == 22 and Toggled Off State to variable CurrentSetpoint == 5 (see image)

Currently, one room is set to 22[sup]o[/sup]C and the other 5[sup]o[/sup]C but, as you can see, both buttons are showing as Vacant (i.e off) but both showing the switch in an On state (which contradict each other).

What an I doing wrong?

@OldManse,

Are you sure the value of the CurrentSetPoint is 22 or is it something greater than or less than that value (point something…etc.). Open the device Danfoss College and take a look at the value CurrentSetpoint on the variables tab. Perhaps I can trick this into using an operator like > or <.

@rstrouse

Thanks for your reply. Yes, according to Device->Advanced->Variables both CurrentSetpoint and CurrentSetpoint Heat are at 22 & 5 respectively for each room.
It still seems peculiar that the button is displaying text (VACANT) at odds to the switch status (green On).

Whatever state the button is in, clicking the button runs the command to set the device to On/22 so, presumably, it believes the current state is Off/Vacant.

Interesting. Let me do some things to see if I can duplicate the scenario. I have a number of these where the state sets text on the control with no issues. I’ll see if I can duplicate the control exactly.

@OldManse,

I think I have an idea of what is going on with this. By chance does this thermostat record in 1/10ths of a degree? If so change the value 5 to 5.0 and 22 to 22.0 for the state. I will see if there is something that can be done similar to what was done for the state icon where I detect the difference between a numeric 5 and a textual 5.0.

There appears to be variation on how many decimal places are reported. The temperature on the icon and control has one decimal point (22.0) whereas looking at the variables section for CurrentSetpoint there are two (22.00). I tried using both in the panel layout and a double decimal point did have an effect - one thermostat is set to 5[sup]o[/sup] so the text is still ‘Vacant’ but displays On (as before), but the other is set to 22[sup]o[/sup] which now the text has changed to ‘Occupied’ and the switch to Off - an improvement but still not quite right.

In this state, clicking the Vacant/On button runs the command, but nothing appears to happen with the Occupied/Off button - I would expect it to toggle to the opposite state.

Also, I notice on the Command Action Parameters there is a check box which says ‘Check this box to use the value of the control’ - does this mean, if checked, it will use the value that is set as the variable being tested (in this case 22), or what does it do?

Correct me if I’m wrong, but my interpretation/understanding is that the ‘Toggled On State (used to set the ON state of the toggle)’ box sets the criteria which, if met, will turn the button to the right and colour green - in my case when CurrentSetpoint == 22.00.
The ‘Command (action to be performed when ON state is selected)’ is the what happens when the button is clicked when in the ON state (so will toggle to the OFF state).

@OldManse,

Yes you are correct on your assumptions. However, make sure you use 22.00 and 5.00 or your command variables or I’ll bet the value gets stuck into the variable as 22 and 5 by the command. I’ll take a look at the underlying device JSON to see if it will accept our unquoted numeric value as a substitute for the text version of the value. This should make the numeric state work like it should.

For the control that does not have the correct text but has the correct state, could you shoot a screenshot of that. I cannot seem to duplicate the mixup in the states vs. text. If you know how to get the device JSON for the panel that would be ideal.

Thanks for taking the time to look at this. I wasn’t sure which JSON file you needed so I downloaded everything with VirtualPanel in the title and attached in the zip file. Also in the file is a photo of the panel (Plugin.png) showing the two switches in different states - these correspond to the Danfoss devices shown in the Danfoss.png picture. Also shown in the picture are two other switches for hot water (one ON and one OFF) - they seem to be behaving themselves where the variable values are HeatOn / Off.

To clarify, Danfoss College has CurrentSetpoint set to 22.00 but showing 22.0. The panel switch should, therefore, be showing ON / Occupied, but is displaying OFF / Occupied.
Danfoss Harthope has CurrentSetpoint set to 5.00 but showing 5.0. The panel switch should, therefore, be showing OFF / Vacant, but is displaying ON / Vacant.

In these states, when I click Harthope switch (ON / Vacant) it issues a command to the Danfoss Harthope device but the CurrentSetpoint is ‘Undefined’ and displays NaN [sup]o[/sup]C - the panel display didn’t change.
I then unchecked the ‘Check this box to use the value of the control’ box and put in the values 22.00 & 5.00. Now when I click the switch it issues a command and (once the battery device wakes up) sets CurrentSetpoint to 22.00 and the panel switch changes state to OFF / Occupied.

When I click College switch (Off / Occupied) nothing appears to happen. I then set the CurrentSetpoint to 20[sup]o[/sup]C (not matching any of the variable values) and the panel switch changed to ON / Vacant. Clicking the switch now changes the device to 22.00 and the switch changed state to OFF / Occupied. Again, now in an OFF state, nothing happens when this is clicked.

By way of experiment, I changed the text on the Hot Water switches from HEAT / OFF to OCCUPIED / VACANT and that continued to work just fine (displaying OCCUPIED when On and VACANT when Off)

@OldManse,

Well I did some deep diving into the implementation for the multi-state button on Vera and it boils down to a couple of things. First, I assumed the states for the buttons are indexed in that the first state is the on state and the second is the off state. However, this is not the case. It appears their (Vera’s) code looks at the value that is being compared and uses the lowest value as the off state and the highest value as the on state.

So what does this mean for your implementation since Occupied = 5.00 and Vacant = 22.00 this means that the thumb shifted to the left (commonly referred to as off) is going to be the 5.00 value no matter what you do. The value on the right is always going to be the thumb shifted to the right (commonly referred to as on). Yuck!

I am looking at ways to get around this silliness so more to follow…

I’m sure you’re correct in your findings, but what you’ve described is exactly what I want, i.e. 5.00 to be Off state (slider to the left) and 22.00 On (slider to the right) but, for some reason, Vera doesn’t want to play like that. I have tried deleting the devices and adding new one’s from scratch without changing the default text - the text is correct (5.00 = Off) but the switch is wrong (5.00 = On).

@OldManse,

Unfortunately, my response was so tied up in me changing things around I meant Vacant = 5.00 and Occupied = 22.00.

Your assessment is correct when you compare the 5.00 to 22.00 as a numeric value. However, the Vera code compares these as strings so “5.00” ends up being the “On” value since “5.00” > “22.00”. There is code in there that checks to see if the values are numeric then surprisingly compares them as strings. If all that weren’t bad enough, the code that selects the label works by comparing the numeric value while the code that sets the switch position compares the strings… ugggh!

Still throwing some overcooked pasta at this wall to see what I can make stick.

I’ve just begun playing around with V-Panels - Very cool! I’m having trouble getting a dimmer slider to work properly. My device uses D_DimmableLight1.xml and D_DimmableLight1.json

Brandon,

The action you specified is correct however the parameter you are using is not correct. Set it up like below and you will be in business. newLoadlevelTarget is case sensitive for D_DimmableLight1.xml.

@rstrouse thanks for the help. Is there any way to make sliders appear in the Vera Remote App? I have 3 vpanels all with sliders that work well in the Vera Dashboard on my PC web browser, but don’t even show up in the Vera Remote App. And you can see the text for the multi-state button isn’t correct.

Support for that would have to come from the Vera app developers rather than rstrouse. The Vera app at this time doesn’t support any plugins other than the house modes one I believe. I would love for it to support the virtual panel one as well.

When monitoring a device variable, is there a way to set it to monitor a range and not only a set value. In my screen shot for example, I’d like to monitor LoadLevelStatus between 34 and 66, but it only gives me an option for equality. If not, @rstrouse can you implement this feature request? Thanks.

@Brandon,

I have it working for operators but not for a range yet.

Brandon,

The attached files should allow you to set a monitoring range. It also includes the horizontal spinner control to put on your panels. Try it out and let me know if you have issues.

@rstrouse it works like a charm! Thank you very much. Now we need Vera to add plug-ins into their iOS app so the sliders appear and work. I appreciate the added feature.