cyrilcc / org.openhab.binding.rflink

RFLink binding for OpenHAB 2.0
23 stars 32 forks source link

Changes in temp conversion and added time of observation #32

Closed majherek closed 6 years ago

majherek commented 6 years ago

Correction in negative temperatures.

majherek commented 6 years ago

Added time of observation to implement watchdog.

Items file:

DateTime observationTime "Time of observation [%1$td/%1$tm/%1$tY - %1$tH:%1$tM:%1$tS]" <time> { channel="rflink:OregonTempHygro:usb0:AlectoV4_5379:observationTime" }
Switch watchdog { expire="10m,command=OFF" }

Rules file:

rule "RfLink changed"
when
    Item observationTime changed
then
    if (watchdog.state != ON)
        logWarn(logfile, "RfLink Sensors Visibility: ONLINE")
    watchdog.sendCommand(ON) // resets the watchdog
end

rule "RfLink watchdog"
when
    Item watchdog changed from ON to OFF
then
    logWarn(logfile, "RfLink Sensors Visibility: OFFLINE")
    watchdog.sendCommand(OFF)
end