PLEG - SetVariable Action

I am stumped trying to pass a value to a VariableContainer field using PLEG.

I have a DeviceProperty Front_Time that reads a variable from VContainer1, and I would like to write the value to VContainer2. Persently the value reported by Status for Front_Time is 40, so I would like for “40” to appear in VContainer 2.

For the Action, I selected the Advanced tab, selected VContainer 2, selected SetVariable1, and put {(Front_Time)} in the blank field (as explained in the PLEG Basics document). What appears in VContainer2 is “{(Front_Time)}”.

I also tried {Front_Time}, b[/b] and Front_Time, in each case the VContainer2 field was populated with exactly what I wrote in the Advanced tab field, not the value of Front_Time.

Feels like I am missing something obvious.

Tom Williams

Please post your status report …

Status report attached.

I am trying to write the contents of a Device Property to an external device (Variable Container).

I am not a programmer, so most of this stuff takes a while for me to catch on.

Great software, by the way!


I have still never been able to put a device property value into a field in the Advanced tab of a PLEG Action. The “PLEG Basics” document says this:

More complex device actions can be defined on the ADVANCED tab. Here you can select the device on the Pick a device: pull-down and then click Add. Now there is a pull-down containing all of the device actions supported by the device. When you select one, if it requires a parameter, a blank field will appear. Enter the required parameter in this field. The parameter may be a number or a string depending on the selected device action. This is where you can enter {(yourexpression)} if you want the parameter value to be calculated by PLEG using yourexpression.

I can follow all of these directions, but since there is no example of placing “{(yourexpression)}” in the parameter field, I am not sure of the syntax for placing a DeviceProperty in a parameter field. I have tried every permutation I can think of, in 2 different PLEGs, different device properties, different device parameter fields, never worked.

Is it possible to simply pass a device property to a device parameter field in the Advanced Actions tab?

If you are using UI7 … you have to “Check” the box below the actions (Use expressions in Arguments)

I am using UI5.

I want to put the device property “pHeat_Setpoint” in a thermostat device setpoint field. Do I just type pHeat_Setpoint in the field, or surround it with (), “”, {()}, ???

Thanks for your help!

The General Format is:

{(PLEG Expression)}

In your case:


But you could get fancy and do something like:

{(pHeat_Setpoint > 70 ? 70 : pHeat_Setpoint)}

The above uses an expression in the action to limit the value to 70

Well, {(pHeat_Setpoint)} worked. I am baffled because I am positive that I have tried the same syntax more than once before and never got it to work before now. Oh well, it’s all good now!

Once again, thank you for the PLEG device, it makes the whole Micasa system useful!

Tom Williams