I have to admit I'm quite annoyed. I just realised that I had lost connection to 2 of my contact sensors about a month ago and had no idea. So, when I ran the rule to check security (windows closed, etc.), it reported back as everything good. Meanwhile the sensor wasn't responding and happened to lose connection in the 'closed' state, so rule machine kept thinking all was closed. Doesn't also help that the check-in just shows a bunch of numbers (e.g. "lastCheckin : 1584527697589").
How can I show an actual date? Is it because of an issue with sensor type? Or because bad driver? Or cheap Xiaomi devices?
How can I prevent the system from picking up incorrect states of devices?
Any help would be appreciated.
Thanks
Alan
P.s. Got a similar question under rule machine around this
Strange about the time not displaying correctly.
Not sure what's going on there.
Maybe try re-saving the driver code.
Change the type for the device, save it, change it back and re-save it and see what happens.
I'm not sure what else to suggest about the time stamp not being displayed correctly.
The way it displays for @AlanB is how it would display without modifying the driver. The change needed to show as @bobbles have the date is a very minor one.
Replace all occurrences of "now()" with "new Date().toLocaleString()".
In answer to the other question by the OP: To keep track of when a device last had activity, the generic way is to look at "Last Activity At" at the bottom of the driver page. It is that date and time that a device monitoring app would look at to know if the device is still working.
Xiaomi devices can be complicated to get right, but it can be done if planned right. There are whole threads dedicated to only this topic. I have more than 65 Xiaomi/Aqara devices and my mesh is 100% stable, I still have more to add in a drawer and more coming, I like these little devices. Maybe I should count them... Anyway, they work, and they work for many others, but it all comes down to choosing routing devices well (and probably having more of them than you think are needed), understanding how to build the mesh and installing the devices in a proper order.Not going to elaborate on this more since there's enough written about it by now, but I have 7 routing devices which I've put there for ONLY this purpose. Then there are more routing devices on top of that as well.