automation:
- alias: My esp is still alive and well
trigger:
- platform: mqtt
topic: home/sensor1
payload: alive
- platform: homeassistant
event: start
action:
- service: timer.start
entity_id: timer.timer_esp_sensor
- alias: ESP Sensor dying
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.timer_esp_sensor
action:
- service: notify.html5
data:
title: "ESP is dead"
message: "Save me! your esp"
timer:
timer_esp_sensor:
duration: '00:05:00'
In this example you need to publish an mqtt message on the topic home/sensor1 with the payload “alive” at most every 5 minutes. If this message is not received, an html5 notification is sent.
You rule Touliloup !!!
I understand exactly what I have to do now !
Thank you everybody for your help. Home assistant is really powerful but not easy to tame at first
I had posted something earlier that turns out did not work, but I have tested this. It does in fact work. You just need to have your MQTT sensors publish to a “I’m Alive” topic every 5 minutes or so. I tested it on my humidity sensor. It sends me a message every 10 minutes if the sensors has not checked in for over 5 minutes
Hi guys and gals
I had time (at last) tonight and I tested the solutions posted by touliloup and ericleejoe.
Both works ! My ESP can now die in peace
I thank you a lot again !!!
Awesome. Hey listen. I implemented my solution too, but I had a small issue. If I just sent “alive” to the MQTT broker from my ESP8266, HA saw it as never changing. So I had to publish 2 messages a “ping” and “pong” every 5 minutes so HA always saw it as changing.