Open PulsarFX opened 3 years ago
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.
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.
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.
I think about an config option like:
alwaysonline: true|false
to prevent logging of possibly disconnected chargers. What do you think about this?
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.
Can I help with something to get this issue solved?
In the github readme you state:
What does the config look like for not always connected chargers? ;)