Skip to content

Mean requires at least one data point #486

Description

@pxFIN

Lately i keep seeing this in the logs.. not sure if this is due to the 15min data ?


Logger: homeassistant.util.logging
Source: util/logging.py:167
First occurred: 5 August 2025 at 14:00:00 (20 occurrences)
Last logged: 07:00:00

Exception in handle_new_hr when dispatching 'nordpool_update_hour': () Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 462, in handle_new_hr self._update() ~~~~~~~~~~~~^^ File "/config/custom_components/nordpool/sensor.py", line 314, in _update self._off_peak_2 = mean(today[20:]) ~~~~^^^^^^^^^^^^ File "/usr/local/lib/python3.13/statistics.py", line 490, in mean raise StatisticsError('mean requires at least one data point') statistics.StatisticsError: mean requires at least one data point
Exception in handle_new_price when dispatching 'nordpool_update_new_price': () Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 476, in handle_new_price await self.handle_new_hr() File "/config/custom_components/nordpool/sensor.py", line 462, in handle_new_hr self._update() ~~~~~~~~~~~~^^ File "/config/custom_components/nordpool/sensor.py", line 314, in _update self._off_peak_2 = mean(today[20:]) ~~~~^^^^^^^^^^^^ File "/usr/local/lib/python3.13/statistics.py", line 490, in mean raise StatisticsError('mean requires at least one data point') statistics.StatisticsError: mean requires at least one data point
Exception in handle_new_day when dispatching 'nordpool_update_day': () Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 445, in handle_new_day await self.handle_new_hr() File "/config/custom_components/nordpool/sensor.py", line 462, in handle_new_hr self._update() ~~~~~~~~~~~~^^ File "/config/custom_components/nordpool/sensor.py", line 314, in _update self._off_peak_2 = mean(today[20:]) ~~~~^^^^^^^^^^^^ File "/usr/local/lib/python3.13/statistics.py", line 490, in mean raise StatisticsError('mean requires at least one data point') statistics.StatisticsError: mean requires at least one data point

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions