Compared it to a similar thing I have working. I see some differences but none seem relevant. First guess would be two things: is the device online and added to HA in the integrations, and are you sure the entity in HA is a number? Does it have a unit_of_measurement there as well? If I look at the logs of the esp I see the value coming in and being logged. Do you see that or not?
So the device is online for sure as i get a continuous readout of the active powerconsumption in one of my dashboards.
If I check that specific entity in my developper tools, I have the following specifications :
state_class: measurement
unit_of_measurement: W
device_class: power
friendly_name: P1 meter (5c2faf00cc80) Active power
To your last question, when checking the logs, I dont see the value coming in, so that seems to be the culprit, yet I have no clue why this doesn’t work ?
I do not really know either. But when I look at the friendly name, could it be the entity id is
sensor.p1_meter__5c2faf00cc80__active_power instead of
sensor.p1_meter_5c2faf00cc80_active_power?
I copied the entity ID over from the integration (just double-checked) and it is truly sensor.p1_meter_5c2faf00cc80_active_power
For some reason the values are not relayed back to my ESP device but I dont know why.
Could it be related to an issue in ESPhome ? Is there a way to go back to an older version ?
@Edwin_D looks to have already asked this.
Is the device setup in HA integration.
This means the esphome device, not the main sensor device.
Your answer was abit ambiguous.
You won’t get an api sensor status from homeassistant if you haven’t added the esphome device via settings > devices & services. It needs to be configured there before it can find the sensor data from HA.
OMG !! This is so supid
I totally misunderstood @Edwin_D remark on the device being online and as you indeed suggested, it was not added to the integrations.
Now everything works as expected ! Thank you both so much!
It’s weird though, most of the time, my ESP’s are auto-discovered and this one was not, so that’s why I must have missed that step. What would be the reason for some devices getting auto-discovered and some not ?
Not sure about the auto-discovery, I always have to configure the few that I have done, although I compile mine in a separate HA test instance. I then add them to my main instance to get the HA sensor/s to show up.
I see now this is a bit cryptic, but @HasQT explained it way better. Glad you got it working.
As for autodiscovery - I set them up from the HA dashboard, and usually they are discovered once they boot. But every once in a while I heed a HA reboot to trigger autodiscovery. That happens mostly when I delete one from integrations because it has too many entities that are no longer present in the yaml.