I am having an issue getting a comparison with Network Binding lastseen and now to work.
OH 2.2
MacOS 10.13.3
I have defined a pingable device as a Thing in PaperUI (I don’t have .thing files). This shows up just fine and the Last Seen is a DateTime, however not in UTC format (with Z in it).
My items file contains the following
DateTime Phone_LastSeen "Phone Last Seeen[%s]" <time> {channel="network:pingdevice:db6cfc77:lastseen"}
I also tried
DateTime Phone_LastSeen "Phone Last Seeen [%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tS]" <time> {channel="network:pingdevice:db6cfc77:lastseen"}
My rule file contains one rule with the following
rule "Phone Presence"
when
Time cron "0 * * * * ?"
then
logInfo("--DEBUG--","Runnig1")
var DateTimeType LastMotionPhone = Phone_LastSeen.state
logInfo("--DEBUG--","Runnig2")
logInfo("--DEBUG--","LM: " + LastMotionPhone)
But LastMotionPhone is NULL. I cannot get a date out of it. Any clues as to what I am doing wrong?
And how does the item know which channel to use ?? Phone_LastSeen is just a madeup name (like any other item name is )… confused
On the things configuration screen in the paperUI you can link a channel to an existing item
As you have defined an item Phone_LastSeen (Now without binding declaration), you can link it to the channel in the PaperUI