Hi.
I’ve multiple ESP32 boards that are in deep sleep mode for the most of the time and only for few seconds for minute are awake.
I need to monitor it on HA and, for this purpose, I’ve implemented anything like this:
esp32_ble_tracker:
ble_client:
- mac_address: 34:94:54:25:26:2e
id: ESP32_BLE_Remote
on_connect:
then:
- lambda: |-
id(ESP32_text_sensor_name2).publish_state("AWAKE");
on_disconnect:
then:
- lambda: |-
id(ESP32_text_sensor_name2).publish_state("Deep Sleep");
- mac_address: c8:c9:a3:cf:14:6e
id: ESP32_Lolin32_Stireria_Remote
on_connect:
then:
- lambda: |-
id(ESP32_text_sensor_Lolin32_Stireria).publish_state("AWAKE");
on_disconnect:
then:
- lambda: |-
id(ESP32_text_sensor_Lolin32_Stireria).publish_state("Deep Sleep");
And the needed text sensors:
text_sensor:
- platform: template
name: "Stato ESP32 remote"
id: ESP32_text_sensor_name2
icon: "mdi:arrow-up-circle"
- platform: template
name: "Stato ESP32 Lolin32 Stireria remote"
id: ESP32_text_sensor_Lolin32_Stireria
icon: "mdi:arrow-up-circle"
Anyway this code don’t seems to works rightly.
It seems to me that altenatively on the HA dashboard the connection’s data from multiple ESP32 board are not updated.
The question is: is there any wrong in the code ?
How I should do it better?
Any idea?
Thanks in advance