Integer Resolution from PLEG

Good morning!

I’m capturing temperature changes from my 1Wire string of temperature sensors. I’m using the OWServer and PLEG plugins.

Similar to how Mr. Schaefer help me solve capturing sensor changes on the thermostat, I’m trying to do the same thing here.

The problem is I don’t need the decimal resolution. I don’t need a report every time the temperature changes from 77.1 to 77.3, for example. I only need integer changes (77 to 78).

I copied the PLEG report below. The logic for Y2 works great but gives me fraction changes.

The code for Y1 seems logical, but I get this error: Program Logic : math.floor(y1Temperature) != math.floor( Oldy1Temperature): Invalid Expression Operator: . in:math.floorTMP_1 != math.floorTMP_2 (copied from the top of the CasaVerde screen).

I fear I’m doing something incorrect with a very simple solution I’m not seeing. Might someone be able to point that out?

Thanks!!

Device Properties
Name Device Name Device Variable
y1Temperature Temperature[43000802AB7F6C10] CurrentTemperature
y2Temperature Temperature[C8000802AB8BCE10] CurrentTemperature

Conditions
Name Expression
cy1Temperature math.floor(y1Temperature) != math.floor( Oldy1Temperature)
Oldy1Temperature y1Temperature
cy2Temperature (y2Temperature ne Oldy2Temperature)
Oldy2Temperature y2Temperature

PLEG does not provide access to functions that are available to LUA.
So the math.xxx are invalid syntax.

Thank you for taking the time to answer.

For some reason I read: http://forum.micasaverde.com/index.php/topic,12494.msg98812.html#msg98812 where you state
’ Also support for math and string operations and comparisons have been provided’
and took off with it!!

Now a different direction (lua) to figure this out.

Thanks.

Why not just check if the difference is greater than 1