I’d like to configure a sensor that tracks my rain sensor its last state change agains the actual time.
With that information i know how long ago there was rain and i can build a better automation to start my garden irrigation.
Hope someone can help me with that.
Thanks in advance!
Will give you the human readable time. The templating docs and the items linked from it can explain more. You can do things like convert it to a timestamp (number of seconds since midnight on 1 January 1970) and then subtract that from the current timestamp.
So i have tried this and it works good! Only downside to this is when the sensor goes to unavailable, the state changes and the check is not reliable anymore. Is there a possibility to only allow this check between state changes ‘off’ and ‘on’?
So, what do you want to happen.
Do you need to know when it went unavailable (that would protect your garden worst case so maybe water early) or do you want to wait till its valid again (not sure what information that gives you.
Your best bet would be to get a more reliable sensor or maybe use 2 off them to double chances of reporting ???
I’d like to start the watering when there is no rain for a minimal of 5 hours.
So i started off with the template provided by @Tinkerer and adjusted it to my needs
Problem is that this template also reports ‘false’ when it went from ‘off’ (dry) to ‘unavailable’ because the state changed, which makes sense.
Best case scenario would be that this sensor remains ‘true’ even if it went from ‘off’ to ‘unavailable’ and back to ‘off’, after a reboot or a short interruption for example. But that is not how last_updated works, right?
So i have no clue how to tackle this
Hope this makes a bit sense.
Well, there is not. My knowledge of templates is close to non existing, excuse me for that:). That’s why I’m trying to get help from you guys to accomplish that.