PLEG - Variable increment in Action - advanced

Hi Richard,

Is it feasible to programatically increment an existing variable in the Action/Advanced setting without having to declare each variable in the Input/Device Properties section ?

ie.

SetCurrentSetpoint NewCurrentSetpoint {(SetCurrentSetpoint}) +1

Not sure if possible and what the correct syntax would be if so…the above just causes PLEG to barf when it restarts.

I’ve got 20 TRVs that I want to increment/decrement each existing setpoint by 1 depending on an external trigger (already done)

Cheers

David

A few minor changes will work …

From the docs the syntax is:
{(ConditionOrExpression)}

In the Advanced tab for your actions you can use the following:
{(CurrentSetPoint + 1)}

Where CurrentSetPoint is an Input Variable or Condition variable that holds the current setpoint value.

In the PLEG code you could also compute a DELTA value and then have all of your actions use:
{(CurrentSetPoint + DELTA)}

And of course DELTA could be negative !
Then you would use this same Action any time you want to change all 20 TRVs at once.

Thanks Richard for your help,

My only challenge with this approach is that I think I’d have to declare an input/condition variable for each of of the TRV’s current setpoint which seems a bit of an overhead. I was hoping there would be a way of just using a single Action for a “Plus one” trigger and then referencing each device within using {(CurrentSetPoint + 1)} but it barfs with an “attempt to compare nil with number”…noteably because PLEG cannot enumerate the CurrentSetPoint…as it’s not been defined as an input variable.

Was just hoping to save memory without needing all those variables…especially as the current set point is already known.

Cheers

David

Do you want to set them all to the same value + an increment or increment each one by one ?

In the second case you will need 20 input variables … unless the TRVs have an action to change the setpoint by some delta value.

What do you mean by “especially as the current set point is already known” ?

Hi Richard,

I want to increment/decrement each one by 1c. So if one is @ 19c and one is @ 22c, then the result would be 20c and 23c respectively.

I am starting to realise I’ll need 20 separate variables in that case.

“especially as the current set point is already known” - I meant that the value is already stored in Vera so creating a further variable to store the same value only to temporarily add 1 to it seemed crazy.

I’ll fall back to plan B later and create the 20 variables, stop giving myself a hard time for trying to save memory.

Did you look to see if these devices have an action to add a delta to a setpoint …

You can find the list of available actions for a device in the Advanced tab of a scene or the actions editor … pick the device … then it will allow you to pick one of the supported actions for the device.

Hi - I did, but alas no. These are the StellaZ so the actions/variables are quite limited within the device.

On a similar note - I’ve also got a cunning plan to use PLEG to change the battery wakeup interval on these devices to deep sleep at night time (once every 4 hours) and just drowsy during the day (once every 10 mins)…that’ll be next