I want to run some D1 Mini with sensors on battery and therefore I am looking for a very economical solution for the operation. In the meantime I have been able to realize all the optimizations I know (WiFi, deep sleep) under esphome.
Now I still want to replace the HA-API with MQTT and I am not sure how to proceed:
The MQTT broker is active, the values already end up in the topic homeassistant/sensor…
But: for this transfer it probably needs the HA-API in esphome after all, which I actually want to disable.
My question: Can I do without the HA-API in esphome and still perform OTA via ESPHome? Or should I do without esphome and build an independent solution with mqtt, for example with ESPEasy?
Thank you very much! That was my mistake, I had not read an error message correctly when I disabled the api:. MQTT is now active, however I do not get any values (not even via the MQTT Explorer). I had tried it as follows:
okay, sorry, it’s working now. I don’t know why, I only deactivated api: and rebooted HA. Thank you for your help!
ESPHome takes care of transferring the values itself via MQTT, which is convenient. OTA works fine, API is switched off. The values appear in my case under esp-dht11-01/sensor/....
Now only deepsleep is missing, controlled via MQTT, then I am satisfied. If it is any help, here is a simple script for the DHT11 on ESP8266: