Closed luixal closed 1 year ago
Hey there @ottowinter, @jesserockz, @bdraco, mind taking a look at this issue as it has been labeled with an integration (esphome
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
esphome documentation esphome source (message by IssueLinks)
Please enable debug logging and post a log for when the device goes to sleep. Thanks
Hi,
This is the only log I find related to the sensor (sensor.sensor_ph_fill_level
):
2023-08-04 22:20:51.706 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.sensor_ph_wifi_dbms, old_state=None, new_state=<state sensor.sensor_ph_wifi_dbms=unavailable; state_class=measurement, unit_of_measurement=dBm, device_class=signal_strength, friendly_name=Sensor PH- WiFi dbms @ 2023-08-04T22:20:51.706358+02:00>>
2023-08-04 22:20:51.706 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.sensor_ph_wifi_percentage, old_state=None, new_state=<state sensor.sensor_ph_wifi_percentage=unavailable; unit_of_measurement=%, icon=mdi:wifi, friendly_name=Sensor PH- WiFi Percentage @ 2023-08-04T22:20:51.706922+02:00>>
2023-08-04 22:20:51.707 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.sensor_ph_fill_level, old_state=None, new_state=<state sensor.sensor_ph_fill_level=unavailable; state_class=measurement, unit_of_measurement=%, icon=mdi:water-percent, friendly_name=Sensor PH- Fill Level @ 2023-08-04T22:20:51.707391+02:00>>
2023-08-04 22:20:51.710 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=esphome>
[...]
2023-08-04 22:20:54.877 WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for ph-level-sensor @ 192.168.68.67: Error connecting to ('192.168.68.67', 6053): [Errno 113] Connect call failed ('192.168.68.67', 6053) (SocketAPIError)
2023-08-04 22:20:54.933 INFO (MainThread) [aioesphomeapi.reconnect_logic] Trying to connect to ph-level-sensor @ 192.168.68.67 in the background
Not sure if this what you're looking for.
Thanks!
You'll get a few log line for aioesphomeapi when the device goes to sleep. I need those and the ones for homeassistant.components.esphome
Make sure both loggers are set to debug level
Also it would be helpful if you posted the esphome yaml for the device
Hi @bdraco I updated the first post with the logs I got and the yaml config file.
This looks like it's working as expected on the Home Assistant side and the problem is with the device or esphome code
Processing unexpected disconnect from ESPHome API for ph-level-sensor @ 192.168.68.67
The device is supposed to send a disconnect request before it goes into deep sleep. Instead it just stops responding which is why it's being marked as unavailable
You'll probably need to attach a serial console to see why it's failing to tell Home Assistant that its going to sleep with a disconnect request
Please continue at https://github.com/esphome/issues/issues since it's going to need to be fixed on the device firmware
It was my bad, I mixed things up:
Sorry for wasting your time, everything seems to be working as supposed.
Thanks!
TIP: hope HA uses state
for state itself and another field like value
or last_value
for the value, as they're clearly different things :(
Thanks for following up
The problem
I'm experiencing exactly the same that was described in issue #90923 and solved in PR #90925.
I guess there was a regression of this bug in any version between May (2023.5) and now (2023.8 tested).
The original description is pasted below:
As soon as a ESPhome device disconnects from native api, the value in dashboards switches to 'unavailable', the history graph will get gaps till reconnect. In previous versions the last value was retained and the history graph was a solid line with last value as data points.
The problem gets visible with (battery powered) devices that use deep sleep and just connect a few seconds to transmit values. Just during the short transmission time, the value in dashboard is visible. As soon as device gets into deep sleep, the value switches to 'unavailable'. The history graph gets a dashed or dotted line (depends on update/connection frequency).
Maybe @bdraco can solve this again! :)
What version of Home Assistant Core has the issue?
core-2023.8.0
What was the last working version of Home Assistant Core?
core-2023.5.0
What type of installation are you running?
Home Assistant OS
Integration causing the issue
ESPHome
Link to integration documentation on our website
https://www.home-assistant.io/integrations/esphome/
Diagnostics information
No response
Example YAML snippet
This is the yaml config from the sensor:
Anything in the logs that might be useful for us?
Logs:
Additional information
No response