When it is ok to retain command topics

I’m in the process of building a solar powered light for a spot in the garden. The solar panels are big enough to support a RGB LED with 1~2w through the night and recharge the next day.

The controller node is a D1 mini and, for good measure I added some sensors in the process. As to not be too wasteful with the limited energy (the light is the most important), the controller will be on deep sleep, waking every 5 minutes to send the sensor data and receive the light commands.

The problem arives on that last bit: receiving the ligth commands. Most of what I have read comes in the way of sincronizing the state shown in HA to match what is in the node, but I can’t figure out a way to do the contrary and have a “dummy light” in HA that has it’s state mirroed by the node when it wakes up.

Another Idea could be going full custom with helper inputs, but that would require loads of automations and would take out the simplicity of just turning on a light on the ui that I am looking for.

I would appreciate any other ideas on how to implement this.

Thanks in advance!

Just wondering why you’re using MQTT instead of the HA ESPHome integration.

The integration being the native API? If so, it doesn’t work well with deep sleep. HA needs to initiate the connection and, as the node is only awake for a short time, nothing guarantees that they will be in sync to connect.

Beyond that, I measured that the connection with HA takes up to 10 seconds, while it takes at most 2s for a connection with the mqtt broker