Hi all
I’ve had an issue on my POE Esp32 and it was offline for a while, so I decided to create an automation to monitor all my esp32.
You could identify any sensor in esphome device, I created a text sensor with esp32 board type/vendor and used it for monitoring.
So, you could add to your esphome yaml config file:
substitutions:
esphome_name: "esp-box"
esp32_board: WT32-ETH01
text_sensor:
- platform: template # Expose the board type as a sensor
id: espboard_type
icon: "mdi:developer-board"
name: $esphome_name ESPBoard
update_interval: 3600s
lambda: |-
return to_string("${esp32_board}");
Then automation will be:
alias: esphome_board_offline
description: check if esphome (esp32/esp8266) board is offline and then online
trigger:
- platform: state
entity_id:
- sensor.esp32_controsoffitto_espboard
to: unavailable
variables:
title: WARNING
text: Controsoffitto Esphome Board is offline
- platform: state
entity_id:
- sensor.esp32_controsoffitto_espboard
from: unavailable
variables:
title: NORMAL
text: Controsoffitto Esphome Board is back online
#add a pair of trigger for each of your esp32 board
condition: []
action:
- service: notify.persistent_notification
data:
message: "{{ text }}"
title: "{{ title }}"
- service: notify.family_app
metadata: {}
data:
message: "{{ text }}"
title: "{{ title }}"
mode: single