core: Energy dashboard stopped working after updating to 2023.10.0: TypeError when compiling stats

The problem

After updating the Supervisor and Core in my HomeAssistant OS on my Yellow to latest version 2023.10.0 the energy dashboard did not update anymore with new data. Every sensor normally delivers data, but they are not reflected in the dashboard.

Restart of HA OS did not resolve the issue.

Seeing error messages in the log.

Same behavior like #101103 .

What version of Home Assistant Core has the issue?

core-2023.10.0

What was the last working version of Home Assistant Core?

core-2023.9.x

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-10-05 13:32:50.532 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 130, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:32:50.560 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 130, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 402, in compile_statistics
    compiled = _compile_statistics(hass, session, start, end)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 483, in _compile_statistics
    last_stats = statistics.get_latest_short_term_statistics(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:32:50.575 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 130, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 454, in compile_missing_statistics
    modified_statistic_ids = _compile_statistics(
                             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 528, in _compile_statistics
    compiled: PlatformCompiledStatistics = platform_compile_statistics(
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 402, in compile_statistics
    compiled = _compile_statistics(hass, session, start, end)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 483, in _compile_statistics
    last_stats = statistics.get_latest_short_term_statistics(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:32:50.594 ERROR (Recorder) [homeassistant.components.recorder.core] Error while processing event CompileMissingStatisticsTask(): unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 893, in _guarded_process_one_task_or_recover
    self._process_one_task_or_recover(task)
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 904, in _process_one_task_or_recover
    return task.run(self)
           ^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/tasks.py", line 177, in run
    if statistics.compile_missing_statistics(instance):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 609, in wrapper
    return job(instance, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 454, in compile_missing_statistics
    modified_statistic_ids = _compile_statistics(
                             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 528, in _compile_statistics
    compiled: PlatformCompiledStatistics = platform_compile_statistics(
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 402, in compile_statistics
    compiled = _compile_statistics(hass, session, start, end)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 483, in _compile_statistics
    last_stats = statistics.get_latest_short_term_statistics(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:35:10.276 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 130, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:35:10.282 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 130, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 402, in compile_statistics
    compiled = _compile_statistics(hass, session, start, end)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 483, in _compile_statistics
    last_stats = statistics.get_latest_short_term_statistics(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:35:10.288 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 130, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 477, in compile_statistics
    modified_statistic_ids = _compile_statistics(
                             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 528, in _compile_statistics
    compiled: PlatformCompiledStatistics = platform_compile_statistics(
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 402, in compile_statistics
    compiled = _compile_statistics(hass, session, start, end)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 483, in _compile_statistics
    last_stats = statistics.get_latest_short_term_statistics(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:35:10.295 ERROR (Recorder) [homeassistant.components.recorder.core] Error while processing event StatisticsTask(start=datetime.datetime(2023, 10, 5, 11, 30, tzinfo=datetime.timezone.utc), fire_events=True): unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 893, in _guarded_process_one_task_or_recover
    self._process_one_task_or_recover(task)
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 904, in _process_one_task_or_recover
    return task.run(self)
           ^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/tasks.py", line 165, in run
    if statistics.compile_statistics(instance, self.start, self.fire_events):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 609, in wrapper
    return job(instance, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 477, in compile_statistics
    modified_statistic_ids = _compile_statistics(
                             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 528, in _compile_statistics
    compiled: PlatformCompiledStatistics = platform_compile_statistics(
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 402, in compile_statistics
    compiled = _compile_statistics(hass, session, start, end)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 483, in _compile_statistics
    last_stats = statistics.get_latest_short_term_statistics(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:35:10.326 WARNING (SyncWorker_3) [custom_components.solarman.solarman] Querying [1 - 125] failed with exception [V5FrameError: V5 frame contains invalid sequence number]
2023-10-05 13:35:10.827 WARNING (SyncWorker_3) [custom_components.solarman.solarman] Querying [1 - 125] failed, [1] retry attempts left
2023-10-05 13:40:10.247 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 130, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:40:10.253 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 130, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 402, in compile_statistics
    compiled = _compile_statistics(hass, session, start, end)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 483, in _compile_statistics
    last_stats = statistics.get_latest_short_term_statistics(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:40:10.261 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 130, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 477, in compile_statistics
    modified_statistic_ids = _compile_statistics(
                             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 528, in _compile_statistics
    compiled: PlatformCompiledStatistics = platform_compile_statistics(
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 402, in compile_statistics
    compiled = _compile_statistics(hass, session, start, end)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 483, in _compile_statistics
    last_stats = statistics.get_latest_short_term_statistics(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:40:10.270 ERROR (Recorder) [homeassistant.components.recorder.core] Error while processing event StatisticsTask(start=datetime.datetime(2023, 10, 5, 11, 35, tzinfo=datetime.timezone.utc), fire_events=True): unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 893, in _guarded_process_one_task_or_recover
    self._process_one_task_or_recover(task)
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 904, in _process_one_task_or_recover
    return task.run(self)
           ^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/tasks.py", line 165, in run
    if statistics.compile_statistics(instance, self.start, self.fire_events):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 609, in wrapper
    return job(instance, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 477, in compile_statistics
    modified_statistic_ids = _compile_statistics(
                             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 528, in _compile_statistics
    compiled: PlatformCompiledStatistics = platform_compile_statistics(
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 402, in compile_statistics
    compiled = _compile_statistics(hass, session, start, end)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 483, in _compile_statistics
    last_stats = statistics.get_latest_short_term_statistics(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:40:14.389 WARNING (SyncWorker_8) [custom_components.solarman.solarman] Querying [1 - 125] failed with exception [V5FrameError: V5 frame contains invalid sequence number]
2023-10-05 13:40:14.703 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.wechselrichter_pv1_voltage is taking over 10 seconds
2023-10-05 13:40:14.890 WARNING (SyncWorker_8) [custom_components.solarman.solarman] Querying [1 - 125] failed, [1] retry attempts left
2023-10-05 13:42:44.707 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.wechselrichter_pv1_voltage is taking over 10 seconds
2023-10-05 13:45:10.239 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 130, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:45:10.244 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 130, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 402, in compile_statistics
    compiled = _compile_statistics(hass, session, start, end)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 483, in _compile_statistics
    last_stats = statistics.get_latest_short_term_statistics(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:45:10.251 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 130, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 477, in compile_statistics
    modified_statistic_ids = _compile_statistics(
                             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 528, in _compile_statistics
    compiled: PlatformCompiledStatistics = platform_compile_statistics(
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 402, in compile_statistics
    compiled = _compile_statistics(hass, session, start, end)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 483, in _compile_statistics
    last_stats = statistics.get_latest_short_term_statistics(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'
2023-10-05 13:45:10.259 ERROR (Recorder) [homeassistant.components.recorder.core] Error while processing event StatisticsTask(start=datetime.datetime(2023, 10, 5, 11, 40, tzinfo=datetime.timezone.utc), fire_events=True): unsupported operand type(s) for +: 'NoneType' and 'float'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 893, in _guarded_process_one_task_or_recover
    self._process_one_task_or_recover(task)
  File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 904, in _process_one_task_or_recover
    return task.run(self)
           ^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/tasks.py", line 165, in run
    if statistics.compile_statistics(instance, self.start, self.fire_events):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 609, in wrapper
    return job(instance, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 477, in compile_statistics
    modified_statistic_ids = _compile_statistics(
                             ^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 528, in _compile_statistics
    compiled: PlatformCompiledStatistics = platform_compile_statistics(
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 402, in compile_statistics
    compiled = _compile_statistics(hass, session, start, end)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/recorder.py", line 483, in _compile_statistics
    last_stats = statistics.get_latest_short_term_statistics(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 1941, in get_latest_short_term_statistics
    return _sorted_statistics_to_dict(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2110, in _sorted_statistics_to_dict
    "end": start_ts + table_duration_seconds,
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 3
  • Comments: 82 (37 by maintainers)

Most upvoted comments

Great. I’ll give it a spin when I finish up working on another issue

It’s on your way from half an hour ago.

The linked PR should hopefully make it into 2023.11.x and should automatically fix the issue for you. There are a very limited amount of people who can review database change PRs so it usually takes a bit longer for these type of changes to get in.