OhmeStatisticsCoordinator setup failure & NumberFormatException: For input string: \"None\"
wralb opened this issue · 3 comments
What happened?
Using Ohme Home Pro (FW 1.22); Nissan Ariya; Octopus Intelligent Go.
- Ohme integration logs four errors on start-up then an error every 30s.
- Accumulative Energy Usage is always marked as unavailable
Perhaps startTS is not being passed properly to chargeSessions/summary?
To Reproduce
Always happens
Expected behavior
No errors and all data available in HA
Log Output
On startup:
2024-02-13 08:19:04.853 ERROR (MainThread) [custom_components.ohme.api_client]
Ohme API response error: /v1/chargeSessions/summary/users/[Removed in case it is sensitive]?
&startTs=None&endTs=1709251199000&granularity=MONTH, 400;
{"timestamp":1707812344473,"status":400,"error":"Bad Request","message":
"Failed to convert value of type 'java.lang.String' to required type 'long';
nested exception is java.lang.NumberFormatException: For input string:
\"None\"","path":"/v1/chargeSessions/summary/users/[Removed in case it is sensitive]"}
2024-02-13 08:19:04.853 ERROR (MainThread) [custom_components.ohme]
OhmeStatisticsCoordinator failed to setup.
This coordinator is optional so the integration will still function,
but please raise an issue if this persists.
2024-02-13 08:19:05.407 ERROR (MainThread) [homeassistant.components.sensor] ohme: Error on device update!
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/entity_platform.py", line 599, in _async_add_entity
await entity.async_device_update(warning=False)
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/entity.py", line 1259, in async_device_update
await self.async_update()
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 530, in async_update
await self.coordinator.async_request_refresh()
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 263, in async_request_refresh
await self._debounced_refresh.async_call()
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/debounce.py", line 93, in async_call
await task
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 289, in async_refresh
await self._async_refresh(log_failures=True)
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 412, in _async_refresh
self.async_update_listeners()
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 183, in async_update_listeners
update_callback()
File "/home/homeassistant/.homeassistant/custom_components/ohme/sensor.py", line 296, in _handle_coordinator_update
if new_state <= 0:
^^^^^^^^^^^^^^
TypeError: '<=' not supported between instances of 'NoneType' and 'int'
2024-02-13 08:19:15.456 ERROR (MainThread) [custom_components.ohme.coordinator] Unexpected exception from <bound method DataUpdateCoordinator.async_refresh of <custom_components.ohme.coordinator.OhmeChargeSessionsCoordinator object at 0x7f2b11072330>>
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/debounce.py", line 114, in _handle_timer_finish
await task
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 289, in async_refresh
await self._async_refresh(log_failures=True)
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 412, in _async_refresh
self.async_update_listeners()
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 183, in async_update_listeners
update_callback()
File "/home/homeassistant/.homeassistant/custom_components/ohme/sensor.py", line 296, in _handle_coordinator_update
if new_state <= 0:
^^^^^^^^^^^^^^
Every 30s:
2024-02-13 08:19:45.162 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 256, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 412, in _async_refresh
self.async_update_listeners()
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 183, in async_update_listeners
update_callback()
File "/home/homeassistant/.homeassistant/custom_components/ohme/sensor.py", line 296, in _handle_coordinator_update
if new_state <= 0:
^^^^^^^^^^^^^^
TypeError: '<=' not supported between instances of 'NoneType' and 'int'
Home Assistant Version
Home Assistant Core 2024.2.1 running on Ubuntu VM in Python 3.12 venv
Integration Version
0.6.1
Additional context
Installed for the first time a couple of days ago; seems to have always been a problem since installation.
Many thanks for developing this integration; much better than having to parse Ohme Android notifications!
This may be fixed in v0.6.2-beta.1, but I've just put out v0.6.2-beta.2 which disables the accumulative energy usage sensor unless you enable it from the configure menu on the integration. Its been the source of many issues and to be honest isn't something I think theres much demand for - with some accounts it just flat out doesnt work for certain dates (see #33).
Especially now there is the session specific sensor, I'd like to deprecate this one, as how it works is a bit wasteful anyway.
Thanks. v0.6.2-beta.2 with the accumulative energy usage sensor disabled does not trigger the error messages; other sensors work. I'm happy with this sensor being deprecated as I cannot currently see how I would use it.
Good to hear - I'll promote it to stable in the next couple of days. I like to try and charge my car with betas first and I haven't needed to yet! 😁