alandtse / tesla

Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.
Apache License 2.0
588 stars 100 forks source link

Solar power sensor Unavailable #747

Closed ingo916 closed 11 months ago

ingo916 commented 11 months ago

Version of the custom_component

Version v3.18.0

Home Assistant 2023.10.3 Supervisor 2023.10.0 Operating System 11.0 Frontend 20231005.0 - latest

Configuration

# Tesla Solar
sensor:
  - platform: integration
    source: sensor.my_home_solar_power
    name: tesla_solar_production
    unit_prefix: k
    round: 2

Describe the bug

Entity ID sensor.my_home_solar_power status Unavailable

Debug log

This error originated from a custom integration.

Logger: custom_components.tesla_custom Source: helpers/update_coordinator.py:290 Integration: Tesla Custom Integration (documentation, issues) First occurred: 09:46:23 (51 occurrences) Last logged: 09:54:41

Unexpected error fetching tesla_custom data: 2252178626060772 Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tesla_custom/init.py", line 440, in _async_update_data return await self.controller.update( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/teslajsonpy/controller.py", line 825, in update return any(await asyncio.gather(*tasks)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/teslajsonpy/controller.py", line 716, in _get_and_process_site_summary self._site_summary[energysite_id].update(response)


KeyError: 2252178626060772

<!-- To enable debug logs check this https://www.home-assistant.io/components/logger/ -->

```text

Add your logs here.

```
![image](https://github.com/alandtse/tesla/assets/41309095/0825301f-c623-4005-97bc-4a97fc79fea2)
ingo916 commented 11 months ago

This error originated from a custom integration.

Logger: custom_components.tesla_custom Source: helpers/update_coordinator.py:290 Integration: Tesla Custom Integration (documentation, issues) First occurred: 10:10:01 (1 occurrences) Last logged: 10:10:01

Unexpected error fetching tesla_custom data: 2252178626060772 Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tesla_custom/init.py", line 440, in _async_update_data return await self.controller.update( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/teslajsonpy/controller.py", line 825, in update return any(await asyncio.gather(*tasks)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/teslajsonpy/controller.py", line 716, in _get_and_process_site_summary self._site_summary[energysite_id].update(response)


KeyError: 2252178626060772
ingo916 commented 11 months ago

2023-10-17 10:29:22.574 DEBUG (MainThread) [teslajsonpy.connection] Connecting with existing access token 2023-10-17 10:29:22.579 DEBUG (MainThread) [teslajsonpy.controller] 553 endpoints loaded 2023-10-17 10:29:22.579 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 7:16:59 2023-10-17 10:29:22.580 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/products {} 2023-10-17 10:29:23.554 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":[{"energy_site_id":2252178626060772,"resource_type":"solar","id":"43435c2f-5254-4a26-8fa0-1e7247c4752e","asset_site_id":"fe06d6e7-dc69-40b8-9b36-8063c2bfc57c","grid_installation_id":"43435c2f-5254-4a26-8fa0-1e7247c4752e","warp_site_number":"STE20180508-01155","solar_power":1560,"solar_type":"pv_panel","go_off_grid_test_banner_enabled":null,"storm_mode_enabled":null,"powerwall_onboarding_settings_set":null,"powerwall_tesla_electric_interested_in":null,"sync_grid_alert_enabled":false,"breaker_alert_enabled":false,"components":{"battery":false,"solar":true,"solar_type":"pv_panel","grid":true,"load_meter":false,"market_type":"residential"},"features":{"rate_plan_manager_no_pricing_constraint":true}}],"count":1} 2023-10-17 10:29:23.555 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 7:16:58 2023-10-17 10:29:23.555 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/2252178626060772/site_info {} 2023-10-17 10:29:25.437 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":"43435c2f-5254-4a26-8fa0-1e7247c4752e","site_number":"STE20180508-01155","installation_date":"2021-10-15T00:00:00-07:00","user_settings":{"go_off_grid_test_banner_enabled":false,"storm_mode_enabled":null,"powerwall_onboarding_settings_set":null,"powerwall_tesla_electric_interested_in":null,"sync_grid_alert_enabled":false,"breaker_alert_enabled":false},"components":{"solar":true,"solar_type":"pv_panel","battery":false,"grid":true,"backup":false,"gateway":"neo","load_meter":false,"tou_capable":false,"storm_mode_capable":false,"flex_energy_request_capable":false,"car_charging_data_supported":false,"off_grid_vehicle_charging_reserve_supported":false,"vehicle_charging_performance_view_enabled":false,"vehicle_charging_solar_offset_view_enabled":false,"battery_solar_offset_view_enabled":false,"energy_service_self_scheduling_enabled":true,"configurable":false,"grid_services_enabled":false},"time_zone_offset":-420,"geolocation":{"latitude":38.3948299,"longitude":-121.3686587,"source":"Site Address Only"},"address":{"address_line1":"9989 Park Glen Court","city":"Elk Grove","state":"CA","zip":"95624","country":"US"}}} 2023-10-17 10:29:25.437 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 7:16:56 2023-10-17 10:29:25.438 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/2252178626060772/live_status {} 2023-10-17 10:29:25.915 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"solar_power":1600,"grid_status":"Unknown","grid_services_active":false,"timestamp":"2023-10-17T10:29:25-07:00","wall_connectors":null}} 2023-10-17 10:29:25.916 INFO (MainThread) [custom_components.tesla_custom.teslamate] Un-subbing from all MQTT Topics. 2023-10-17 10:29:25.917 INFO (MainThread) [custom_components.tesla_custom.teslamate] Un-subbed from all MQTT Topics. 2023-10-17 10:29:25.917 DEBUG (MainThread) [custom_components.tesla_custom] Connected to the Tesla API 2023-10-17 10:29:28.395 ERROR (MainThread) [custom_components.keymaster.binary_sensor] Z-Wave integration not found 2023-10-17 10:29:28.407 WARNING (MainThread) [homeassistant.components.binary_sensor] Platform keymaster not ready yet: None; Retrying in background in 30 seconds 2023-10-17 10:29:28.420 ERROR (MainThread) [custom_components.keymaster] Error fetching keymaster data: 2023-10-17 10:29:28.611 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update() 2023-10-17 10:29:28.614 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_DATA for energysite: 2252178626060772 2023-10-17 10:29:28.614 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 7:16:53 2023-10-17 10:29:28.615 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/2252178626060772/live_status {} 2023-10-17 10:29:28.616 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_CONFIG for energysite: 2252178626060772 2023-10-17 10:29:28.621 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 7:16:53 2023-10-17 10:29:28.622 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/2252178626060772/site_info {} 2023-10-17 10:29:28.623 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_SUMMARY for energysite: 2252178626060772 2023-10-17 10:29:28.623 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 7:16:53 2023-10-17 10:29:28.623 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/2252178626060772/site_status {} 2023-10-17 10:29:28.981 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"solar_power":1600,"grid_status":"Unknown","grid_services_active":false,"timestamp":"2023-10-17T10:29:28-07:00","wall_connectors":null}} 2023-10-17 10:29:29.337 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":"43435c2f-5254-4a26-8fa0-1e7247c4752e","site_number":"STE20180508-01155","installation_date":"2021-10-15T00:00:00-07:00","user_settings":{"go_off_grid_test_banner_enabled":false,"storm_mode_enabled":null,"powerwall_onboarding_settings_set":null,"powerwall_tesla_electric_interested_in":null,"sync_grid_alert_enabled":false,"breaker_alert_enabled":false},"components":{"solar":true,"solar_type":"pv_panel","battery":false,"grid":true,"backup":false,"gateway":"neo","load_meter":false,"tou_capable":false,"storm_mode_capable":false,"flex_energy_request_capable":false,"car_charging_data_supported":false,"off_grid_vehicle_charging_reserve_supported":false,"vehicle_charging_performance_view_enabled":false,"vehicle_charging_solar_offset_view_enabled":false,"battery_solar_offset_view_enabled":false,"energy_service_self_scheduling_enabled":true,"configurable":false,"grid_services_enabled":false},"time_zone_offset":-420,"geolocation":{"latitude":38.3948299,"longitude":-121.3686587,"source":"Site Address Only"},"address":{"address_line1":"9989 Park Glen Court","city":"Elk Grove","state":"CA","zip":"95624","country":"US"}}} 2023-10-17 10:29:29.418 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"resource_type":"solar","asset_site_id":"fe06d6e7-dc69-40b8-9b36-8063c2bfc57c","solar_power":1880,"solar_type":"pv_panel","go_off_grid_test_banner_enabled":null,"storm_mode_enabled":null,"powerwall_onboarding_settings_set":null,"powerwall_tesla_electric_interested_in":null,"sync_grid_alert_enabled":false,"breaker_alert_enabled":false}} 2023-10-17 10:29:29.418 ERROR (MainThread) [custom_components.tesla_custom] Unexpected error fetching tesla_custom data: 2252178626060772 Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tesla_custom/init.py", line 440, in _async_update_data return await self.controller.update( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/teslajsonpy/controller.py", line 825, in update return any(await asyncio.gather(*tasks)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/teslajsonpy/controller.py", line 716, in _get_and_process_site_summary self._site_summary[energysite_id].update(response)


KeyError: 2252178626060772
2023-10-17 10:29:29.430 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 0.819 seconds (success: False)
2023-10-17 10:29:30.396 WARNING (MainThread) [homeassistant.components.media_player] Setup of media_player platform dlna_dmr is taking over 10 seconds.
2023-10-17 10:29:35.543 WARNING (MainThread) [zigpy.application] Zigbee channel 15 utilization is 96.64%!
2023-10-17 10:29:35.544 WARNING (MainThread) [zigpy.application] If you are having problems joining new devices, are missing sensor updates, or have issues keeping devices joined, ensure your coordinator is away from interference sources such as USB 3.0 devices, SSDs, WiFi routers, etc.
2023-10-17 10:29:38.053 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback _async_at_core_state.<locals>._matched_event(<Event homeassistant_start[L]>) at /usr/src/homeassistant/homeassistant/helpers/start.py:37
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 588, in state
    numerical_value = int(value)
                      ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 591, in state
    numerical_value = float(value)
                      ^^^^^^^^^^^^
ValueError: could not convert string to float: ''

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/core.py", line 1195, in _onetime_listener
    self._hass.async_run_job(listener, event)
  File "/usr/src/homeassistant/homeassistant/core.py", line 684, in async_run_job
    return self.async_run_hass_job(HassJob(target), *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 636, in async_run_hass_job
    hassjob.target(*args)
  File "/usr/src/homeassistant/homeassistant/helpers/start.py", line 40, in _matched_event
    hass.async_run_hass_job(at_start_job, hass)
  File "/usr/src/homeassistant/homeassistant/core.py", line 636, in async_run_hass_job
    hassjob.target(*args)
  File "/usr/src/homeassistant/homeassistant/components/template/template_entity.py", line 478, in _async_template_startup
    result_info.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1031, in async_refresh
    self._refresh(None)
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1211, in _refresh
    self.hass.async_run_hass_job(self._job, event, updates)
  File "/usr/src/homeassistant/homeassistant/core.py", line 636, in async_run_hass_job
    hassjob.target(*args)
  File "/usr/src/homeassistant/homeassistant/components/template/template_entity.py", line 429, in _handle_results
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 779, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 879, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 820, in _async_generate_attributes
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 785, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 595, in state
    raise ValueError(
ValueError: Sensor sensor.unavailable_entities has device class 'None', state class 'None' unit 'entities' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: '' (<class 'str'>)
2023-10-17 10:29:40.149 ERROR (MainThread) [custom_components.keymaster.binary_sensor] Z-Wave integration not found
2023-10-17 10:29:40.215 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2023-10-17 10:29:40.344 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_DATA for energysite: 2252178626060772
2023-10-17 10:29:40.345 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 7:16:41
2023-10-17 10:29:40.345 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/2252178626060772/live_status {}
2023-10-17 10:29:40.346 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_CONFIG for energysite: 2252178626060772
2023-10-17 10:29:40.347 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 7:16:41
2023-10-17 10:29:40.351 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/2252178626060772/site_info {}
2023-10-17 10:29:40.352 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_SUMMARY for energysite: 2252178626060772
2023-10-17 10:29:40.353 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 7:16:41
2023-10-17 10:29:40.353 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/2252178626060772/site_status {}
2023-10-17 10:29:40.829 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.172_30_33_7] Error from stream worker: Error opening stream (ERRORTYPE_111, Connection refused) rtsp://****:****@172.31.0.10:8554/wyze-1
2023-10-17 10:29:40.943 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.172_30_33_7_2] Error from stream worker: Error opening stream (ERRORTYPE_111, Connection refused) rtsp://172.31.0.10:8554/garage-cam
2023-10-17 10:29:41.614 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"id":"43435c2f-5254-4a26-8fa0-1e7247c4752e","site_number":"STE20180508-01155","installation_date":"2021-10-15T00:00:00-07:00","user_settings":{"go_off_grid_test_banner_enabled":false,"storm_mode_enabled":null,"powerwall_onboarding_settings_set":null,"powerwall_tesla_electric_interested_in":null,"sync_grid_alert_enabled":false,"breaker_alert_enabled":false},"components":{"solar":true,"solar_type":"pv_panel","battery":false,"grid":true,"backup":false,"gateway":"neo","load_meter":false,"tou_capable":false,"storm_mode_capable":false,"flex_energy_request_capable":false,"car_charging_data_supported":false,"off_grid_vehicle_charging_reserve_supported":false,"vehicle_charging_performance_view_enabled":false,"vehicle_charging_solar_offset_view_enabled":false,"battery_solar_offset_view_enabled":false,"energy_service_self_scheduling_enabled":true,"configurable":false,"grid_services_enabled":false},"time_zone_offset":-420,"geolocation":{"latitude":38.3948299,"longitude":-121.3686587,"source":"Site Address Only"},"address":{"address_line1":"9989 Park Glen Court","city":"Elk Grove","state":"CA","zip":"95624","country":"US"}}}
2023-10-17 10:29:41.985 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"solar_power":1600,"grid_status":"Unknown","grid_services_active":false,"timestamp":"2023-10-17T10:29:41-07:00","wall_connectors":null}}
2023-10-17 10:29:42.285 DEBUG (MainThread) [teslajsonpy.connection] 200: {"response":{"resource_type":"solar","asset_site_id":"fe06d6e7-dc69-40b8-9b36-8063c2bfc57c","solar_power":1880,"solar_type":"pv_panel","go_off_grid_test_banner_enabled":null,"storm_mode_enabled":null,"powerwall_onboarding_settings_set":null,"powerwall_tesla_electric_interested_in":null,"sync_grid_alert_enabled":false,"breaker_alert_enabled":false}}
2023-10-17 10:29:42.671 ERROR (MainThread) [custom_components.tesla_custom] Unexpected error fetching tesla_custom data: 2252178626060772
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tesla_custom/__init__.py", line 440, in _async_update_data
    return await self.controller.update(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/teslajsonpy/controller.py", line 825, in update
    return any(await asyncio.gather(*tasks))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/teslajsonpy/controller.py", line 716, in _get_and_process_site_summary
    self._site_summary[energysite_id].update(response)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 2252178626060772
2023-10-17 10:29:42.794 DEBUG (MainThread) [custom_components.tesla_custom] Finished fetching tesla_custom data in 2.579 seconds (success: False)
2023-10-17 10:29:51.885 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.172_30_33_7_2] Error from stream worker: Error opening stream (ERRORTYPE_111, Connection refused) rtsp://172.31.0.10:8554/garage-cam
2023-10-17 10:29:51.900 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.172_30_33_7] Error from stream worker: Error opening stream (ERRORTYPE_111, Connection refused) rtsp://****:****@172.31.0.10:8554/wyze-1
2023-10-17 10:30:01.306 DEBUG (MainThread) [custom_components.tesla_custom] Running controller.update()
2023-10-17 10:30:01.845 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_DATA for energysite: 2252178626060772
2023-10-17 10:30:01.846 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 7:16:20
2023-10-17 10:30:01.966 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/2252178626060772/live_status {}
2023-10-17 10:30:01.968 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_CONFIG for energysite: 2252178626060772
2023-10-17 10:30:01.974 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 7:16:20
2023-10-17 10:30:01.975 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/2252178626060772/site_info {}
2023-10-17 10:30:02.026 DEBUG (MainThread) [teslajsonpy.controller] Updating SITE_SUMMARY for energysite: 2252178626060772
2023-10-17 10:30:02.027 DEBUG (MainThread) [teslajsonpy.connection] Token expiration in 7:16:19
2023-10-17 10:30:02.253 DEBUG (MainThread) [teslajsonpy.connection] get: https://owner-api.teslamotors.com/api/1/energy_sites/2252178626060772/site_status {}
2023-10-17 10:30:05.100 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback async_track_point_in_utc_time.<locals>.run_action(<Job time cha...0x7f9f4fe3e0>>) at /usr/src/homeassistant/homeassistant/helpers/event.py:1401
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 588, in state
    numerical_value = int(value)
                      ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 591, in state
    numerical_value = float(value)
                      ^^^^^^^^^^^^
ValueError: could not convert string to float: ''

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1416, in run_action
    hass.async_run_hass_job(job, utc_point_in_time)
  File "/usr/src/homeassistant/homeassistant/core.py", line 636, in async_run_hass_job
    hassjob.target(*args)
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1676, in pattern_time_change_listener
    hass.async_run_hass_job(job, dt_util.as_local(now) if local else now)
  File "/usr/src/homeassistant/homeassistant/core.py", line 636, in async_run_hass_job
    hassjob.target(*args)
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1008, in _refresh_from_time
    self._refresh(None, track_templates=track_templates)
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1211, in _refresh
    self.hass.async_run_hass_job(self._job, event, updates)
  File "/usr/src/homeassistant/homeassistant/core.py", line 636, in async_run_hass_job
    hassjob.target(*args)
  File "/usr/src/homeassistant/homeassistant/components/template/template_entity.py", line 429, in _handle_results
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 779, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 879, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 820, in _async_generate_attributes
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 785, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 595, in state
    raise ValueError(
ValueError: Sensor sensor.unavailable_entities has device class 'None', state class 'None' unit 'entities' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: '' (<class 'str'>)
alandtse commented 11 months ago

Dupe #738

Vansmak commented 11 months ago

I have the some issue. If this was closed, duplicate then where is the duplicate and what was the fix?

skipishere commented 11 months ago

I have the some issue. If this was closed, duplicate then where is the duplicate and what was the fix?

Literally the comment before yours, #738