Closed raman325 closed 2 years ago
This resolves https://github.com/codersaur/SmartThings/issues/32
What that ever merged?
This method does not resolve correct uptime, it replaces it with last bootup time of the device. You could take the timestamp of hub last boot and subtract current time to get real "uptime" of the device.
correct... I submitted it as a quick fix to get the rest of the properties written to InfluxDB properly and mentioned in the description that it does not calculate uptime. With that being said, I ended up fixing it on my end but did not update the original PR. I will add the changes shortly.
nice, thanks. I ended up merging with 46894f1a98c6494b1dada9b4253b271704bd99af from pull request 27
using h.hub.getDataValue("uptime")), I haven't verified it yet with my influx database.
I think you will run into the same issue that I had which led me to submitting this PR. But give it a shot, and if it doesn't work you can try the changes here
guess there's no interest in this. I've moved off of smartthings so time for me to move on!
Hub properties are not being written to InfluxDB
h.hub.getDataValue("uptime") is returning null which is causing the write to fail since Influx expects an integer and is instead getting the value "null". h.hub.uptime returns the unix timestamp of the last time the hub booted up and can be used to calculate uptime. Changed the variable name to better reflect the value being stored.