Device Property usage

I’ve read the help, and am trying to set an input via Device property. The editor starts with Z-Wave listed, and I drop down to select my VContainer device. I can then select from a dropdown of VariableName1, Variable1… to 5. However, wheb I select either of these first two - not sure which it should be - then press Create, nothing happens. There are no other prompts or fields available for me to fill in.

That sounds OK. You should select VariableN as your property. After clicking Create, a line should appear showing the name and current state of the new input. You can change the name to something appropriate by clicking Edit - e.g. VCVar1.

Now you can refer to the selected VC variable by the name you have given in PLEG condition statetements. e.g.

TempHigh VCVar1 > 20

Note that, if you want to make numerical comparisons, the VC variable field must only contain valid numbers.

Thamks for that, create is working now, but I can’t get the condition statement to work, whatever I do I get various errors. In your reply, Rex, you have Temphigh VCVar1 > 20. I had effectively “Temphigh >18 and Templow <19”, where Temphigh and low were both device property names referring to variables from devices. Are you implying that you use the device property name and the variable name in the condition? I tried that too. Attaching screen shots of one error and the PLEG report of what I have. In this instance something is apparently nil, although the input screen shows the actual temperatures. (Note, not using Vcontainer in this one but real devices). Many thanks in anticipation!

First off, put parenthesis around each part of your condition expression to separate the terms. e.g.

CondName (Temphigh >18) and (Templow <19)

Secondly, unless Richard has fixed it recently, you should not use spaces or special characters in the names of inputs, schedules or conditions. Change Cold_Night to ColdNight etc.

Thanks Rex but what do you mean by CondName? In the condition editor it’s just a blank box. What does CondName relate to in your example? I have ColdNight etc as device properties, do I use those names or the variable names etc. sorry to still be confused!

I used CondName as an example of a condition name - which you assign to each condition. In your PLEG report you posted earlier, you used Cold_Night as the name of your condition.

You refer to the condition names when you assign actions to them or when you include them as terms in other condition expressions. It’s a good idea to make the names meaningful - you may want to modify the logic next year when you’ve forgotten how it works. ;D

Thanks Rex, got it, I was being dumb! No errors any more, but despite my lounge temp saying 23 and the bedroom 14 or so the action doesn’t happen, so not sure where now!

A condition and associated action will only fire when it becomes true - meaning that it has to be false first. You could try artificially manipulating one of the temperatures…

Thanks Rex, that would be it, the Lounge temp is stable at 23. But how does that work with less than and greater than conditions? It seems to me that by that logic I would have to take the bedroom above the trigger temperature manually, then let it cool down just so that the scene would trigger and warm the room up? I can see why in some cases this would be useful, but it doesn’t seem to make sense for climate control? I’ll have a think in case I can find a sneaky way of dong it. You are right, a manual change would trip it, but that kind of defeats the purpose of automating it!

@Robjsewell
You have a nightly schedule but you do not seem to use it.
Your condition probably tripped while you were playing with it before you had actions defined.

If you add:
ChangeAtNight NOT ((6:30:00;WarmLounge; 21:35:00) and (6:30:00;ColdBedroom; 21:35:00))

The previous condition is a tricky … It is true if either variables changes between: 21:35:00 and 06:30:00.

Then change:

ColdAtNight (WarmLounge > 12) and (ColdBedroom < 18) and (ChangeAtNight or Night)

With the changes above … The ColdAtNight will turn false during the day … and retrigger itself at night if the conditions are satisfied;

Otherwise, just change the name of the condition … A new name starts out as false. As soon as either temperature changes … it will trigger a re-evaluation and it will become trip and start the actions.

What is your Heat Transfer device ? Is this a fan ?

@Rex
There is no way to create variables with spaces in the name. Underscores are fine. At one time I had a problem if you did not have a space surrounding operators.

@Rex There is no way to create variables with spaces in the name. Underscores are fine. At one time I had a problem if you did not have a space surrounding operators.
Thanks for the clarification, Richard.

Many thanks, will try this. I was working on the opposite too, so if the lounge is too cold or the bedroom is too hot, the heat transfer and the bedroom heater are turned off respectively. The heat transfer is a vent in the ceiling above my wood burner with a fan, and an insulated tube that leads to an output vent in he bedroom. Common in NZ but not overly efficient. I planed to replace the bedroom heater with an Aircon/heatpump unit soon. All your help has been highly appreciated, clearly PLEG is very powerful and I have a lot to learn!

Sorry, me again. Please see attached, very useful, status report. In the condition editor, the NOT operator is in read and in the status report, the condition using it is showing a null state. Did I get something wrong from your post? Thanks again.

I will look into the NULL.

What bothers me is the value for WarmLoung.
This looks like a URL encoded property value string.
This will NOT compared correctly … It will be seen as 17 … not 17.8
What type of device is this ? Is this a variable container ?

Hi Richard, yes, the value was 17.8, and in the PLEG window it shows as 17.8. It’s the status window that shows it as 172E8, so I wasn’t sure what was actually being used for the comparison. The data does come from a VContainer, populated by the V3 Netatmo script from the forum.

Hope this helps! If there’s a way to take the integer before the decimal point or a way to perform rounding on the value that would be fine.

What I’m aiming to do is to say “if lounge temperature > bedroom temperature + 2” then “activate heat transfer” and if “bedroom temperature < 18” then “activate bedroom heater” - but in both cases only between 9:30pm or so and 6:30am. I will then have other logic to turn off the heat transfer if the lounge temperature drops (e.g. Wood burner runs out of logs in the night) and to turn off the bedroom heater if the bedroom gets too warm.

Ultimately I plan to use Netatmo devices for both temperature gauges, so there will be VContainers for both the lounge and the bedroom.

There is a bug in the reporting that shows the decimal or negative values incorrectly.
I already have a fix … but not sure when I will release it.

As far as the new conditions … you pretty much wrote the expression in your description … Just put it in parenthesis and add the and (ChangeAtNight or Night)

Thanks again Richard, all looks OK except the NOT clause - screenshots attached in case they help. By the way, I tried to send you a screen sot of the status report and it now just gives me a blank window. It worked before!

Thanks, Rob

I’m not sure why the condition editor is flagging NOT as an unknown variable. The expression looks OK to me. Does the PLEG save without throwing an error?

Try refreshing your browser page and see if the status report re-appears.

Thanks Rex, yes PLEG saves OK, and I did try the refresh. I’ll do a total restart and see.

OK, so I’ve coded Richard’s turn light on when motion sensor is triggered setup and it does nothing. So, I looked closer, and everywhere I have a NOT the editor shows it in red. I’m thinking perhaps my PLEG is corrupt? I installed the latest 4.4 by clicking all three links, entering my IP address, getting the OK messages and then reloading.

Is there a way to delete the plugins behind the “scenes” and reinstall without losing all the PLEG coing I’ve done? Or a way of re-installing over the top.

Thanks again!