Hi,
I would like to provide a sensor to home assistant, when to expect the next update of my ESP device before I put it to deep sleep. Idea is, that I can raise an alert in HA, when an ESP device is offline longer than expected…
I thought about something like a sensor value where I add the info about the “run duration”, the “deep sleep duration” configured in esphome and the current time. But I am struggling to parse the different options to define time intervals and do calculation.
Any thoughts about implementing something similar? Thanks!
These things always make me curious. What could that esp be reporting that is important enough to create a “check in” sensor in HA? Will it toggle the Panic mode switch if no temperature and humidity data come in every 6 hours?
I do have a drainage with a pump (not smart, just a simple swimm switch). During this winter period, the pump stopped working and the water flooded into the basement… As (one of two) alarm devices I added an ultrasonic sensor to measure the level. I want to get an alert on my phone via HA, when the level raises to a certain level or the device is offline longer than expected…
(The second alerting device is dumb and will just trigger a siren)
Using the status entity and some home assistant magic, I was able to generate an alarm:
alias: drainage sensor health check
description: Trigger an alert, if drainage sensor is offline longer than expeted
trigger:
- platform: state
entity_id:
- binary_sensor.drainage_drainage_water_sensor_status
from: "on"
for:
hours: 0
minutes: 15
seconds: 0
condition: []
action:
- service: notify.persistent_notification
metadata: {}
data:
title: ALERT - CHECK DRAINAGE!
message: Check the drainage sensor, it's offline longer than expected!
mode: single
The esp is sleeping for 10 minutes and then running for est. 1min. Haven’t found a way to transfer these to values from the esp to HA. But I don’t expect many changes 