tesla icon indicating copy to clipboard operation
tesla copied to clipboard

Issue #998 not fixed on latest version

Open MacTh3Mac opened this issue 6 months ago • 3 comments

Is there an existing issue for this?

  • [x] I have searched both the existing open issues & recently closed issues and did not find a duplicate of this issue.

Version of the Tesla component

3.25.3

Version of the Powerwall Gateway software

25.34.1.7e37ef9d

Model

3

Current Behavior

Battery % still showing unavailable and generating same errors as were reportedly fixed in #998 #1147

HAOS 16.2 Core: 2025.10.2

Expected Behavior

Battery % for Powerwall Shown.

Debug logs

2025-10-11 17:59:13.323 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 280, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 491, in _async_refresh
    self.async_update_listeners()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 190, in async_update_listeners
    update_callback()
    ~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 571, in _handle_coordinator_update
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1026, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1151, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1088, in __async_calculate_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1032, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 569, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tesla_custom/sensor.py", line 396, in native_value
    return round(self._energysite.solar_power)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/teslajsonpy/energy.py", line 189, in solar_power
    return self._site_data.get("solar_power")
           ^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'get'

Anything else?

No response

MacTh3Mac avatar Oct 11 '25 17:10 MacTh3Mac

Working fine for me after updating to 3.25.3

Faceless3882 avatar Oct 11 '25 23:10 Faceless3882

I've just bumped to 3.25.3 which does resolve the percentage. However, it just shows 0kWh for remaining battery. I've had to workaround that by editing sensor.py as follows:

             return round (self._energysite.percentage_charged*13500/100)
        """return round(self._energysite.energy_left)"""

It's not perfect but better than 0kWh. Not sure if others see the same, @Faceless3882?

johncuthbertuk avatar Oct 13 '25 19:10 johncuthbertuk

I've just bumped to 3.25.3 which does resolve the percentage. However, it just shows 0kWh for remaining battery. I've had to workaround that by editing sensor.py as follows:

             return round (self._energysite.percentage_charged*13500/100)
        """return round(self._energysite.energy_left)"""

It's not perfect but better than 0kWh. Not sure if others see the same, @Faceless3882?

Ah yes you're right. I only use the battery % so didn't notice it.

Faceless3882 avatar Oct 16 '25 00:10 Faceless3882