My Things are defined in PaperUI. I don’t use a .things file.
But, the only diff I see between your config and mine is that you don’t specify the Consider Home Interval in your client Thing config. But, I think there’s a default for that, and it shouldn’t have any bearing on the problem you’re having…
No I’ve been running this config for a while…but I have switched to a docker for unifi and a docker for openhab. But I can’t see how that can change things. I think the controller is reporting it correctly as I’ve got access ot the full api, and I can see for that device it’s definitely is_wired: False
Important: The online channel changed from a Contact to a Switch. If you install this version, you’ll need to update your items, as well as change any rules that check for OPEN/CLOSED to OFF/ON.
/* Unifi Items */
Switch S8_PRES "S8 Presence [MAP(Unifi.map):%s]" <switch> (gUnifi) {channel="unifi:client:Unifi_HomeR:S8:online"}
String S8_AP "S8 AP [%s]" <qualityofservice> (gUnifi) {channel="unifi:client:Unifi_HomeR:S8:ap"}
Number S8_RSSI "S8 RSSI [%s]" <qualityofservice> (gUnifi) {channel="unifi:client:Unifi_HomeR:S8:rssi"}
Number S8_UPTM "S8 Uptime [%d]" <time> (gUnifi) {channel="unifi:client:Unifi_HomeR:S8:uptime"}
String S8_UPTF "S8 Uptime F [%s]" <time> (gUnifi)
DateTime S8_TIME "S8 Last Seen [%1$tH:%1$tM:%1$tS]" <time> (gUnifi) {channel="unifi:client:Unifi_HomeR:S8:lastSeen"}
Unifi.map:
ON=Home
OFF=Away
NULL=Unknown
nice trick to display properly the uptime:
Unifi.rules
rule "Format S8 Uptime Display"
when
Item S8_UPTM changed
then
var int days = ((S8_UPTM.state as DecimalType).intValue / (86400))
var int hours = (((S8_UPTM.state as DecimalType).intValue / 3600) - (24 * days))
var int minutes = (((S8_UPTM.state as DecimalType).intValue / 60) - ((1440 * days) + (60 * hours)))
var int seconds = (((S8_UPTM.state as DecimalType).intValue) - ((86400 * days) + (3600 * hours) + (60 * minutes)))
var String result = ""
if (days > 0) { result = result + days + "d, " }
if (hours > 0) { result = result + hours + "h, " }
if (minutes > 0) { result = result + minutes + "m, " }
if (seconds > 0) { result = result + seconds + "s" }
S8_UPTF.postUpdate(result)
end
then put the formatted item (S8_UPTF) on your sitemap