I have a solar-powered node and I put the ESP into deep sleep between readings. I use an MQTT message to enable or disable sleep so that I can use OTA.
Is there any way that I can get the device to post the state of ota_mode so that I can reflect the current mode on my Lovelace page? In other words, “I’m alive- go ahead with the OTA”.
mqtt:
broker: '192.168.1.124'
discovery: false
discovery_retain: false
birth_message:
will_message:
on_message:
#ota on = turn off deep sleep to permit OTA
- topic: solar/ota_mode
payload: 'ON'
then:
- deep_sleep.prevent: deep_sleep_handler
#ota off = turn on deep sleep
- topic: solar/ota_mode
payload: 'OFF'
then:
- deep_sleep.enter: deep_sleep_handler