Closed alexschwantes closed 1 year ago
Thanks for a awesome bug report. Your right that there are multiple issues they are all related to missing info from the api. Reload the sensors and see if i got time for a fix in sunday
Hi, this link might help to understand the problem. https://developers.nordpoolgroup.com/docs/da-introduction?fbclid=IwAR1ibGErGfykbqXbhyz834AIUdhtXx8w7iU6Cgu6m9Rgjmn9P2TwTjY1v64
Hi, this link might help to understand the problem. https://developers.nordpoolgroup.com/docs/da-introduction?fbclid=IwAR1ibGErGfykbqXbhyz834AIUdhtXx8w7iU6Cgu6m9Rgjmn9P2TwTjY1v64
I have got the same error, and the link you found seems to be the cause. Crossing our fingers that @Hellowlol is able to fix it quickly
Seems that Nordpool has closed down the API used in our sensor, and switched to the new API: https://developers.nordpoolgroup.com/docs/introduction-1
Ok, now I also do not have tomorrows prices? Is there any fix? EDIT: After nordpool app reload, tomorrows prices appeared again
@raudraido : It will fail again tomorrow. I have had the error every day the past 2-3 days.
Same problem here
Can also confirm this problem for DK2 - started a couple of days ago. If I restart HA the prices will appear, but if will fail the following day.
This problem seems to be solvable. However, I'm more concerned about that now Nordpool has officially depreciated this API. It can completely stop working any day. I remember reading a statement from them a year ago or so, that they were considering to offer a limited API for free for personal (non-profit) use. But I haven't seen anything about that lately.
Maybe it is possible to integrate FI,EE,LV,LT market data from link bellow. I was using it before I found this nordpool app. https://dashboard.elering.ee/assets/api-doc.html#/nps-controller
I also havent seen update notifications from their own app couple of days.
Also started experiencing this issue. Seems the data is fixed after "reloading" the integration so would it not solve for now to make the coordinator run more frequently than what seems to be once per day currently.
eg: run it every 5 minutes and if the values are not empty do the actual request otherwise do a NOOP.
Alternatively is there a way to automate the reload of an integration through a service call or similar?
duplicate of #124?
Anyone else experienced it again now?
Same
Been working fine since 20 March, then failed again yesterday.
Now it seams like it is totally dead.. 😭
Reload the integration will bring back values for tomorrow (if set up from interface rather than yaml)
Had to delete it complety and reistall it, then it worked :-) But it seams like when using setup from yaml it will not work... So I have no ideas on how to add aditional dost now :-(
I have nordpool sensor configured in yaml. Tried just a restart of Templates, that didn't work. But restart of Home Assistant solved it for me. I got tomorrow values without need to reinstall the nordpool sensor.
But something is wrong since we have to restart Home Assistant quite often to get the integration to work again. Crossing our fingers that @Hellowlol can spend his time to fix the sensor.
I use HACS and simply "reload" the integration and things are good again. Kinda annoying, might do an automation to reload it :D
So it has been working reliably for me of late, although I did make 1 change in the code. I set it back from updating at 13:00ish to 14:00ish to run the update. This is a crude hack of course, and the better option if you want to test things out is to try the code from #127 which is looking to make it more reliable.
nordpool/init.py
# Handles futures updates
cb_update_tomorrow = async_track_time_change_in_tz(
hass,
new_data_cb,
hour=14, // **** Changed this value from 13 to 14
minute=RANDOM_MINUTE,
second=RANDOM_SECOND,
tz=timezone("Europe/Stockholm"),
)
Instead of checking once at a particular time it should run every 5 minutes or similar and if there is already data simply do a NOOP.
If the system is down at 14:00 for one minute then your "fix" won't work 🤷🏻
So it has been working reliably for me of late, although I did make 1 change in the code. I set it back from updating at 13:00ish to 14:00ish to run the update. This is a crude hack of course, and the better option if you want to test things out is to try the code from #127 which is looking to make it more reliable.
nordpool/init.py
# Handles futures updates cb_update_tomorrow = async_track_time_change_in_tz( hass, new_data_cb, hour=14, // **** Changed this value from 13 to 14 minute=RANDOM_MINUTE, second=RANDOM_SECOND, tz=timezone("Europe/Stockholm"), )
worked for me as a temporary fix at least :)
Instead of checking once at a particular time it should run every 5 minutes or similar and if there is already data simply do a NOOP.
If the system is down at 14:00 for one minute then your "fix" won't work 🤷🏻
@dogmatic69 Yes that is correct, which is why I called it a crude hack until the new version is released that does properly check the api response and retries as required.
I’m having this issue as per today. Tomorrow values are null and it doesn’t help by reloading the plugin
@riksarchen please open a new issue using the issue template. Reload should work, if it don’t is most likely another problem.
I also still have this issue, since several months actually. Tomorrows prices were null
today, only way to get them was to restart HA.
How do you folks reload the plugin?
integration -> nordpool -> reload
Mhh, mine is installed via HACS and I don't have that option, but I can see it for the official integrations 🤔
Go to Configuration -> Devices & Services Find Nordpool and click the 3 little dots
And then click reload
This is only possible if you configured with GUI. Not with yaml configuration.
That explains it, I have mine configured via YAML and if I go to Configuration -> Devices & Services (where your screenshots are from) it's not there, it's in HACS -> Integrations and there is no Reload option from there. Thanks for helping, mystery solved :)
Have seen this once during ~May to end-Jun use of this 0.0.7. Couldn't reload as I have nordpool added via HACS (and there's no reload in that case afaik). And as it's been stated reloading isn't the correct way to solve it. I'm surprised that @Hellowlol has managed to do this this far but hasn't been able to fix this (critical) bug. For me it seems that tomorrow prices (tomorrow_valid) is considered ok without checking the result and it cannot be fixed in that class but requires another interface from sensor to set to true if received & it contains no null's. In my case I had only the first price and the rest were nulls and tomorrow valis stated true. It's clear that it needs to be flagged false in that case (check_stuff).
I wanted to have to have trigger if current price/max(next 8 (adjustable) hour prices) is less that 0.2 (adjustable), and wanted to do that without touching nordpool code... was able to do that finally by using python_scripts but now ended up having own version for this anyway (because of this bug). Dunno if it works really so I'm just waiting to see it fail again and then fix again... But anyway thanks for the integration anyway, it's essential !
Or the reason for this is somehow the inadequete precision ... default 3 in there clearly isn't enough. Also, wouldn't make sensor name (& unique id I guess) to include precision as it creates new sensor when you increase precision. Why precision needs to be an configurable option, why not just use 8 or something in there ?
@meljas having 8 digits would be way to much. It looks really ugly and 3 is more the enough imo. That’s why 3 is default. I added the possibility to have it configurable since some people uses other currency or unit where it might make more sense to have more digit’s. Setup the sensor in the ui and you can use reload. It has nothing to do with hacs..
Feel free to send a pr on all the things you complain about.
Are there any more information regarding this? I installed nordpool last week and have had these issues every day since.
I fixed it as follows:
init,py (comment the line commented) async def update_tomorrow(self, n: datetime): _LOGGER.debug("Updating tomorrows prices.") await self.update(type="tomorrow", dt=dt_utils.now() + timedelta(hours=24))
(add) def set_tomorrow_valid(self, state) -> None: self._tomorrow_valid = state
sensor.py (few changes in check_stuff): if self._data_tomorrow is None or None in self._data_tomorrow: _LOGGER.debug("NordpoolSensor _data_tomorrow is none, trying to fetch it.") tomorrow = await self._api.tomorrow(self._area, self._currency) if tomorrow: self._data_tomorrow = tomorrow if not None in self._data_tomorrow: self._api.set_tomorrow_valid(True) else: self._api.set_tomorrow_valid(False)
I had forgotten this just and let it update the integration -> lost these and error came back so added these back and seems to work again now.
Regarding digits: 3 is certainly not enough since that causes the price to show zero causing errors. I use 4 now. But anyway I don't consider it good to configure digits based on what it looks like. You need to have as much needed to calculate correcly and then only round when showing something on UI. Minimum for Finland from one year back is now 0.01snt/kWh which is 0.0001EUR/kWh rounded with 3 gives 0... I originally thought that 0 price is not possible until some days back read that even negative prices can happen (maybe not during these days .. ) so that'd likely bring up new errors here and there.
Yes. Negative prices are possible. In EE we had -0.00173 EUR/kWh on 2020-11-02.
While the supply may be negative, remember there is usually a "delivery" fee / kWh also.
Got values lost today as well. It did show tomorrow_raw: 21.3,,,,,,,,,,,,,,,,; so there was only one value for tomorrow, but still tomorrow_valid=true.
Seems to be fixed by method @meljas, thanks!
Home Assistant 2022.11.2, Supervisor 2022.10.2, Frontend 20221108.0 - latest
homeassistant\custom_components\nordpool/init.py
async def update_tomorrow(self, n: datetime):
_LOGGER.debug("Updating tomorrows prices.")
await self._update(type_="tomorrow", dt=dt_utils.now() + timedelta(hours=24))
#self._tomorrow_valid = True
def set_tomorrow_valid(self, state) -> None:
self._tomorrow_valid = state
homeassistant\custom_components\nordpool/sensor.py
if self._data_tomorrow is None or None in self._data_tomorrow:
_LOGGER.debug("NordpoolSensor _data_tomorrow is none, trying to fetch it.")
tomorrow = await self._api.tomorrow(self._area, self._currency)
if tomorrow:
self._data_tomorrow = tomorrow
if not None in self._data_tomorrow:
self._api.set_tomorrow_valid(True)
else:
self._api.set_tomorrow_valid(False)
@mmmahammm have you upgraded to the latest version?
Hi @Hellowlol, it seems that there is recent update i wasn't aware and which I didn't have installed. Will update and see how it goes to. Many thanks for your support and such a great integration!
Sorry to ruin the party but my tomorrow also contained yesterday only one value even though I had the "fix". And it happened also once before. So, my "fix" wasn't good enough but maybe you fixed it better ... Yesterday I just rebooted hass (and after I got all the data) as I don't have the energy to look at this. .. Or I've got issues because I configured many market areas to retrieve by several nordpool instances which seems to work. But if yesterday problem happened for others then that's not the case. Anyway I noticed yesterday that some of the other market areas had tomorrow ok while some didn't.
@meljas Please open a new issue using the issue template, your problem is not the same as the one initially posted here.
Thanks @mmmahammm!
@meljas Please open a new issue using the issue template, your problem is not the same as the one initially posted here.
With all the respect, the error is exactly the same. And it took over 2 months for anyone to react or have any interest to this though it's critical. This has been open 8 months !! With that experience there's really no other solution than to fix these self and skip all the surrounding nonsense, I'm sure you understand that.
LOL. Its really not the same, but now i cant be bothered anyway. 🤷♂️
As per #85, I'm raising a new issue with logs attached. It also appears to reference #82
Version of the custom_component
Latest version 0.0.4
Homeassistant version
Home Assistant 2022.2.0
Configuration
Describe the bug
Tomorrow's values fail to update. If I restart the system it works, but after a day, it no longer updates.
It appears that it first tries to check for tomorrow's price at 13:10:46 on the current day, which returns a value of 'inf', then it checks every hour and continues to fail. The first time it checkts, it logs a json response where all the values are 'inf', in all the other times (every hour) there doesn't appear to be a json response (at least not logged).
Is the first check for tomorrows values at the expected time of just after 13:00? Shouldn't it be some time after 14:00?
I'm also referencing #82 as it appears that tomorrow valid field is set to 'true' even though all values for tomorrow are null.
Without knowing too much of the workings of the plugin, it seems like there could be multiple issues, 1. with when to first check for the updated values, and 2. being able to check for values at a later stage (as the plugin is in an inconsistent error state potentially regarding the tomorrow valid state..).
Debug log
Received a generic warning
Setup of sensor platform nordpool is taking over 10 seconds.
in addition to the logs below: