ESPresence with ESP32 - auto-restart possible?

Hi,

I have a few ESP32’s setup as a room presence nodes using ESPresence and mqtt-room.

works well for the most part, but the problem is, every 2 weeks or so, they devices are “disconnected” and I have unplug and plug the back in.

I realize you can setup a switch to toggle the ESP32 on and off, or even a timer. Problem is, the ESP32 devices don’t actually show up in Home Assistant as a controllable device but rather communicate via mqtt only because it was setup using the ESPresence web interface via serial.

Is there a way to incorporate ESPresence into ESPHome in HA so that I can make a switch entity with timer OR can I simply put a code into the ESP32 to autoreboot say, every 24 hrs?

thanks

1 Like

This would be a great feature.

Sorry to necropost, but this is the only semi-relevant page I found when searching for how to restart all ESPresense nodes via MQTT. So perhaps future visitors will find this information useful.

You could accomplish this via sending a restart command to all, or individual units, via MQTT. I couldn’t find this documented anywhere, but digging through the source I was eventually able to figure out:

If you send an MQTT message to the topic espresense/rooms/*/restart/set (I sent a payload of true, but I think the payload is completely ignored as far as I can tell), this will command all espresense nodes to restart.

You can send MQTT messages in automations via the “MQTT.publish” service.

(If you just want to tell a specific node to restart, I believe replacing the asterisk with your node’s name should work, e.g. espresense/rooms/office/restart/set, etc.)

1 Like

this works for me. Thanks very much for this :slight_smile: