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

[Q] Configure charger which is not always connected #42

Open
PulsarFX opened this issue Jul 18, 2021 · 6 comments
Open

[Q] Configure charger which is not always connected #42

PulsarFX opened this issue Jul 18, 2021 · 6 comments

Comments

@PulsarFX
Copy link

In the github readme you state:

setup your Charger in the configuration.yaml (for always connected chargers):

goecharger:
chargers:
  - name: charger1
    host: <ip of your charger>
  - name: charger2
    host: <ip or hostname of charger 2>

What does the config look like for not always connected chargers? ;)

@jmtatsch
Copy link

My charger is offline frequently due to weak wifi signal.
No need to configure anything differently. This module handles it gracefully.
Just don't expect your input amperage changes to get through after reconnection.

@PulsarFX
Copy link
Author

Gracefully? It spams my whole log with errors :-D

Unable to fetch state for Charger 111111
14:38:53 – (FEHLER) go-eCharger (benutzerdefinierte Integration) - 
Die Nachricht ist zum ersten Mal um 18. Juli 2021, 22:27:20 aufgetreten und erscheint 13805 mal 

with this content:

2021-07-18 22:36:10 ERROR (MainThread) [custom_components.goecharger] Unable to fetch state for Charger 111111
2021-07-18 22:36:10 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 134, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 453, in _async_write_ha_state
state = self._stringify_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 425, in _stringify_state
state = self.state
File "/config/custom_components/goecharger/sensor.py", line 191, in state
return self.coordinator.data[self._chargername][self._attribute]
KeyError: '111111'

it seems to be no difference wheter I use the new or the old config style.

@cathiele
Copy link
Owner

cathiele commented Sep 6, 2021

now there is really no difference of the configuration for permanently or non permanently connected chargers. i understand that it is not very helpful for non conntected chargers to report the network timeout :-) will see what i can do to improve this.

@cathiele
Copy link
Owner

I think about an config option like:

alwaysonline: true|false

to prevent logging of possibly disconnected chargers. What do you think about this?

@PulsarFX
Copy link
Author

I'd expect it to not throw errors if it is not available. Maybe a flag could indicate a successful connection to the charger. If not connected, all values would be zeroed.

@PulsarFX
Copy link
Author

Can I help with something to get this issue solved?

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

3 participants