I’m expanding my project from ESP8266 to ESP32 and I faced this weird behavior: I am unable to retrieve data from homeassistant using standard sensor commands:
Troubleshooting it I went down to the level of having absolutely no other code and just trying to retrieve data (no GPIOs defined as output, no inputs, only the sensor)
This is my current code:
sensor:
- platform: homeassistant
name: "Solar Power Generated"
id: current_power_generated
entity_id: sensor.solarinverter_datalogger_8266_pipsolar_pv_charging_power
- platform: homeassistant
name: "Solar Power Consumed"
id: current_power_consumed
entity_id: sensor.solarinverter_datalogger_8266_pipsolar_ac_output_active_power
- platform: homeassistant
id: discharge_current
entity_id: sensor.solarinverter_datalogger_8266_pipsolar_battery_discharge_current
- platform: homeassistant
id: charged_daily
entity_id: input_number.last_daily_ah_charged
- platform: homeassistant
id: battery_voltage
entity_id: sensor.solarinverter_datalogger_8266_pipsolar_battery_voltage
- platform: homeassistant
id: battery_charging_current
entity_id: sensor.solarinverter_datalogger_8266_pipsolar_battery_charging_current
This code causes ESP8266 to continuously read and drop the values to the output. I am able to use these numbers to display them on multiple TM1637s.
But since I ran out of GPIOs on ESP8266, I’m trying to achieve the same on ESP32. And this is where I got stuck - it just does not read anything from homeassistant. The program seems to be stopped at the very end of the stack and not performing any additional reads…
Tried with 3 boards, with the exact same result. If I include any other code (e.g. count to 10 and blink LED every time the counter reaches 10), this seems to be working, so it’s not the freeze - just never-ending wait for values from HA.
ESP32:
Is there any particular way of how to handle sensor information from HA on ESP32 platform?