I was hoping for some help checking if a value hasn’t been updated for a while. I tried the different scripts posted around but I couldn’t get them to work.
I have a flow that fetches swimming temperatures from a couple of websites. The fetched value is then used to update a virtual device that displays swimming temperatures from different locations. However, during winter time, these sensors are physically taken down, leading to long periods without updating the value.
My wish is to have a script check how long ago a chosen value in this virtual device (or a variable if that makes things easier), and then output that as a number I can use in a flow.
I don’t know if the “Last Update” number one can see by tapping a sensor value is discoverable through Homey Script or not. But if it is, that would be really cool.
It looks like most of the scripts in that thread list all “unavailable” devices. What I’d like to do is to check a given value from a sensor, for example through a tag or a variable; one script that takes in a tag or variable as an argument, and returns how long since the last update as a number.