I’m just programming my garden irrigation system relying on ESPhome and the sprinkler component. The system relies on two sensor values:
- soil moisture
- max temperature during the last 24h
Both are provided by HA. So far I’m only simulating the sensors using number components as I don’t have meaningful sensor values available (it’s winter).
My soil moisture sensor value is provided by a battery driven ESPhome device which most of the time is in deep sleep but delivers the value every 30 min.
As it might happen that the battery (of the soil moisture sensor) goes low, no further sensor values will be deliverd. Hence no more irrigation. Which might be bad, if I’m on holiday and cannot charge the sensor’s battery.
As I can see from the entity in HA, HA knows that the sensor/device is unavailable. In my case, due to deep sleep, directly checking availability seems to be meaningless. So I would like to have something which tells me if the device/sensor was available during the last 24h. So far, I have only made automations in HA “by clicking”. Therefore, I feel lost here. I guess, I would need to create a helper for that does the job. Still, I have no clue which one might be suitable.
Another possibility might be to get a kind of timestamp when the device/sensor was last available and evaluate this. Perhaps directly in ESPhome.
Any help is appreciated!
Matthias