rule "Heater Runtime counter"
when
// Every minute, 5 seconds after the minute
Time cron "5 * * ? * * *"
then
if (MyDevice3.state == ON) {
MyDevice3_Time_Active.postUpdate((MyDevice3_Time_Active.state as Number) + 1)
if (MyDevice3_Time_Day.state != NULL) {
MyDevice3_Time_Day.postUpdate((MyDevice3_Time_Day.state as Number) + 1)
}
} else {
MyDevice3_Time_Active.postUpdate(0)
}
end
rule "Reset Daily Counter"
when
Time cron "0 0 0 * * ?" // Fires midnight every day
then
MyDevice3_Time_Day.postUpdate(0)
end
Hy, i try to use your rule to keep track of a heater runtime…but only the Heater ON Time gets updated then reverts back to 0 as it should, but Heater Daily ON Time never gets any update.
Other then the 2 items and the 2 rules is there anything else ??? or am i mising something?