Perform arithmetic in PLEG ?

Is it possible to perform simple arithmetic within PLEG ?

I’m using MultiString as a user friendly variable container, and need to add a temp. offest to a reading before applying it to a radiator thermostat.


PLEG can certainly perform arithmetic. Have you seen PLEG Basics?

You can add an offset in a Condition using a simple expression:

OffsetTemp MSTemp + 5

You can use a calculated value in an Action using the special {(expression)} syntax. So, to set a thermostat to the above calculated value you could use the Action:

MyThermostat SetCurrentSetpoint, NewCurrentSetpoint={(OffsetTemp)}

The expression can also include arithmetic so it could be:

MyThermostat SetCurrentSetpoint, NewCurrentSetpoint={(MSTemp + 5)}

Doh…Schoolboy error!

Have read the excellent PLEG Basics, but it only talks about arithmetic within conditions.

I did try it out but think I was using {(x)+(y)} rather than {(x+y)}

thanks :wink: