ohme.list_charge_slots action failing whenever charge slots exist · Issue #138842 · home-assistant/core · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Ohme Home Pro Firmware: v2.65 Trying to migrate from latest production HACS version to core version of Ohme integration
If charge slots exist, using the Action ohme.list_charge_slots to retrieve charge slot information never works in my setup and generates an error. Note, if there are no charge slots (car not plugged in, or charge not approved, or charging finished) then the action does not trigger an error and correctly returns an empty collection. A full error listing is below, however in summary this is always returned:
energy = (slot["estimatedSoc"]["wh"] - wh_tally) / 1000
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
What version of Home Assistant Core has the issue?
core-2025.2.4
What was the last working version of Home Assistant Core?
2025-02-19 08:36:47.019 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: unsupported operand type(s) for -: 'int' and 'NoneType'
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/helpers/script.py", line 526, in _async_step
await getattr(self, handler)()
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/helpers/script.py", line 762, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<9 lines>...
)
^
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/helpers/script.py", line 727, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/core.py", line 2794, in async_call
response_data = await coro
^^^^^^^^^^
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/core.py", line 2837, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/components/ohme/services.py", line 67, in list_charge_slots
return {"slots": client.slots}
^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.13/site-packages/ohme/ohme.py", line 267, in slots
return slot_list(self._charge_session)
File "/srv/homeassistant/lib/python3.13/site-packages/ohme/utils.py", line 51, in slot_list
energy = (slot["estimatedSoc"]["wh"] - wh_tally) / 1000
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
2025-02-19 08:36:47.023 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [134777617936976] Error handling message: Unknown error (unknown_error) User from 10.27.125.4 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0)
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
await func(hass, connection, msg)
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/components/websocket_api/commands.py", line 816, in handle_execute_script
script_result = await script_obj.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
msg.get("variables"), context=context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/helpers/script.py", line 1808, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/helpers/script.py", line 464, in async_run
await self._async_step(log_exceptions=False)
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/helpers/script.py", line 528, in _async_step
self._handle_exception(
~~~~~~~~~~~~~~~~~~~~~~^
ex, continue_on_error, self._log_exceptions or log_exceptions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/helpers/script.py", line 558, in _handle_exception
raise exception
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/helpers/script.py", line 526, in _async_step
await getattr(self, handler)()
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/helpers/script.py", line 762, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<9 lines>...
)
^
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/helpers/script.py", line 727, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/core.py", line 2794, in async_call
response_data = await coro
^^^^^^^^^^
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/core.py", line 2837, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.13/site-packages/homeassistant/components/ohme/services.py", line 67, in list_charge_slots
return {"slots": client.slots}
^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.13/site-packages/ohme/ohme.py", line 267, in slots
return slot_list(self._charge_session)
File "/srv/homeassistant/lib/python3.13/site-packages/ohme/utils.py", line 51, in slot_list
energy = (slot["estimatedSoc"]["wh"] - wh_tally) / 1000
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
Additional information
Installation type | Home Assistant Core
Development | false
Supervisor | false
Docker | false
User | homeassistant
Virtual environment | true
Python version | 3.13.1
Operating system family | Linux
Operating system version | 6.8.0-52-generic
CPU architecture | x86_64
The text was updated successfully, but these errors were encountered:
Hey there @dan-r, mind taking a look at this issue as it has been labeled with an integration (ohme) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of ohme can trigger bot actions by commenting:
@home-assistant close Closes the issue.
@home-assistant rename Awesome new title Renames the issue.
@home-assistant reopen Reopen the issue.
@home-assistant unassign ohme Removes the current integration label and assignees on the issue, add the integration domain after the command.
@home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
@home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
The problem
Using Ohme Home Pro Firmware: v2.65
Trying to migrate from latest production HACS version to core version of Ohme integration
If charge slots exist, using the Action
ohme.list_charge_slots
to retrieve charge slot information never works in my setup and generates an error. Note, if there are no charge slots (car not plugged in, or charge not approved, or charging finished) then the action does not trigger an error and correctly returns an empty collection. A full error listing is below, however in summary this is always returned:What version of Home Assistant Core has the issue?
core-2025.2.4
What was the last working version of Home Assistant Core?
New Functionality
What type of installation are you running?
Home Assistant Core
Integration causing the issue
Ohme
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
The text was updated successfully, but these errors were encountered: