Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to convert to float #11

Closed
Kaibob2 opened this issue May 28, 2021 · 6 comments
Closed

Unable to convert to float #11

Kaibob2 opened this issue May 28, 2021 · 6 comments

Comments

@Kaibob2
Copy link
Contributor

Kaibob2 commented May 28, 2021

When esphome looses connecting to a node the entity referred in the daily sensor becomes unavailable. This leads to a bunch of errors in the log until the connection is re-established and the entity becomes available again.

2021-05-28 06:35:22 WARNING (MainThread) [homeassistant.components.esphome] Can't connect to ESPHome API for energymeter (192.168.0.84): Timeout while connecting to ('192.168.0.84', 6053)
2021-05-28 06:35:34 WARNING (MainThread) [homeassistant.components.esphome] Error getting initial data for 192.168.0.84: Timeout while waiting for API response!
2021-05-28 06:35:43 ERROR (SyncWorker_46) [custom_components.daily.sensor] unable to convert unavailable to float.
2021-05-28 06:35:43 ERROR (SyncWorker_46) [custom_components.daily.sensor] unable to convert to float.
2021-05-28 06:35:43 ERROR (SyncWorker_46) [custom_components.daily.sensor] unable to convert unavailable to float.
2021-05-28 06:35:43 ERROR (SyncWorker_46) [custom_components.daily.sensor] unable to convert to float.
2021-05-28 06:35:43 ERROR (SyncWorker_46) [custom_components.daily.sensor] unable to convert unavailable to float.
2021-05-28 06:35:43 ERROR (SyncWorker_46) [custom_components.daily.sensor] unable to convert to float.
@jeroenterheerdt
Copy link
Owner

correct. How do propose to fix this? I mean, it's out of the hands of this component - it's a connectivity issue between home assistant and esphome.

@Kaibob2
Copy link
Contributor Author

Kaibob2 commented May 28, 2021

Hmmm. MAybe something like: If unavailable -> do nothing
I'm not a programmer. I thought maybe there is an easy fix around here

if state is not None and state.state != "unavailable":

@jeroenterheerdt
Copy link
Owner

that line does exactly that: is the state is not unavailable or not 'not present' we don't do anything. That's the standard way HA lets a component know the sensor is not there.

@Kaibob2
Copy link
Contributor Author

Kaibob2 commented May 28, 2021

I see. So i suppose i just have to live with the log errors :)
Thanks for the explanation. Have a nice weekend.

@Kaibob2 Kaibob2 closed this as completed May 28, 2021
@Kaibob2
Copy link
Contributor Author

Kaibob2 commented May 28, 2021

One last suggestion: Would it be possible to make the error a little more informative?
Like "energymeter is unavailable. unable to convert value to float." Or something similar.

@jeroenterheerdt
Copy link
Owner

I can absolutely look at that.

jeroenterheerdt added a commit that referenced this issue May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants