Plain and simple, I’d like to know how to round an odd number down to an even number.
The reason being, I need to send a set point value to a thermostat that will only accept even numbers (0,2,4,6,8).
I want to sync my main thermostat with a split system on the same floor. so if the main thermostat is set at 71, I need it to round down to 70, but if it’s 72, it doesn’t change.
Any Ideas guys? I’ve been at google for hours but I am at a complete loss.
I’m thinking something like:
var Number SetPointState = SetPoint.state as DecimalType
SetPointState = SetPointState //some sort of math magic here...
Thanks in advance to anyone willing to lend a hand here, I’d really appreciate it.