johnnyt Posted October 7, 2023 Posted October 7, 2023 Hi @Jimbo.Automates, As you know the Unix epoch timestamp is one of the fields available for each Airthings device (at least the Wave Plus devices anyway). I'd like to be able to use it to know how long it's been since a device was last updated in seconds or minutes and trigger an event/notification if it's been too long. I feel like I would need to either convert it to YYYYMMDDDHHMMSS or be able to get/calculate the current epoch time 'now' so I can do the math using ISY programs. About 99% of my google search results for the formula or algorithm to convert current time to unix epoch time were either online calculators for human consumption, how to do it in Excel, or talked about using built in linux or windows commands, e.g. date +%s in linux. (I tested the latter and it does work on the Polisy.) When I did find formula or algorithm info it was shell code or python, etc., which didn't translate well to ISY programming and made me think it was silly to try to do it using ISY programming. Instead I wondered if you could make the NS do the simple calculation of subtracting 'date +%s' from epoch time that the API provides (both have same 10 digit resolution) and display a "time since last updated" in minutes or seconds. As far as I'm concerned it could replace the current time field in NS/ISY because I can't see what other use the unix epoch time would have but if you wanted to have both, it's fine with me. Thanks for considering it.
Jimbo.Automates Posted October 7, 2023 Posted October 7, 2023 UDI is adding epoch time as a driver so it will be more useful soon. But yes I could add seconds or minutes since the last update as well.Sent from my Pixel 6 Pro using Tapatalk 1
Jimbo.Automates Posted May 22 Posted May 22 Issue created, will starting working on these next. https://github.com/UniversalDevicesInc-PG3/udi-poly-Airthings-Consumer/issues/20
Recommended Posts