Hello,
I wrote a script collecting data from my SmartMeter and pushes data through RESTAPI in Openhab.
Its Working fine, but now i want to check if the Last Update was older than 5 Minutes and set HEARTBEAT(OFF)
and my Value to 0.
But i now i am struggeling finding the right Syntax for this RULE. Even the documentation could not Help me…
I hope someone can help me…
Here are my rules… Rule 1 is working fine … for Rule2 i need some help.
rule E750_HEARTBEAT
when
Item E750_HEARTBEAT changed
then
E750_LASTUPDATE.postUpdate( new DateTimeType() )
end
rule CheckHeartbeat
when
Time cron "0 0/1 * * * ?"
then
// IF (E750_LASTUPDATE.STATE is older than NOW-5Minutes
// then
E750_POWER_ALL_PHAESES..postUpdate(0)
E750_HEARTBEAT.postUpdate(OFF)
// ENDIF
end
Best Regards,
Stephan Mullis