-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Daylight saving time #129
Comments
|
Logger: homeassistant.util.logging Exception in check_stuff when dispatching 'nordpool_update': () Traceback (most recent call last): File "/config/custom_components/nordpool/sensor.py", line 460, in check_stuff self._update(self._data_today) File "/config/custom_components/nordpool/sensor.py", line 315, in _update self._off_peak_1 = mean(offpeak1) File "/usr/local/lib/python3.9/statistics.py", line 316, in mean T, total, count = _sum(data) File "/usr/local/lib/python3.9/statistics.py", line 165, in _sum T = _coerce(T, typ) # or raise TypeError File "/usr/local/lib/python3.9/statistics.py", line 216, in _coerce raise TypeError(msg % (T.name, S.name)) TypeError: don't know how to coerce float and NoneType |
The sensor didn't work today because of a "Null" value in the price table (summer-time-adjustment today): @Hellowlol , would be very nice if the integration would skip non-numeric or something in your next release :-) |
wouldnt it be very easy to do a conversion of NULL to 0 before data is loaded into the sensor? |
The value should be removed rather than converted to 0. The hour between 02:00+01 and 03:00+02 does not exist, hence the null price. If converted to 0 it would be treated as a valid price, very very cheap, when using the data. On the night of entering DST the hour 02 is non-existent, as the time goes from 01:59:59+01 to 03:00:00+02. That day and night only contains 23 hours in localtime, not 24. In the fall, when leaving DST again, we will have a day and night containing 25 hours in localtime when the hour 02 exists twice (first 02:00+02 and then 02:00+01). |
Agree that it should not be set to 0. For instance I use the data to calculate the 3 consecutive hours with the lowest price. If the price is 0 the calculation will for sure be wrong. |
Same problem, sort would not work with "null" value. Any way to avoid this? |
I'll handle DST in an upcoming version. |
Sorry if it goes against Github etiquette. This issue still persist. Using null value bit hampers when piping attribute values to a list with Jinja2. |
Hi, Yeah, there is a regression bug. I should have checked i[value] |
Hello,
I'm getting an error if I want to sort the hours by the value of the energy price.
{% set l=state_attr('sensor.nordpool_mwh_ee_eur_3_10_02', 'raw_today')|sort(attribute='value') %}
TypeError: '<' not supported between instances of 'NoneType' and 'float'
It looks like it is related with the daylight saving time, since there is hour from 4:00 - 4:00 and value is "null"
end: '2022-03-27T04:00:00+03:00'
value: 63.744
end: '2022-03-27T04:00:00+03:00'
value: null
The text was updated successfully, but these errors were encountered: