Lovelace: PostNL

Yeah well, after a restart it also broke down for me. I talked too soon :joy::rofl:, so no it isn’t working anymore haha

1 Like

I’ve reversed the API again… fix for now:

HA has requested me to remove the PostNL component from HA due to the instability :frowning:

:frowning:

image

I can still launch it as a custom component, which removes the dependency on a HA update :slight_smile:

3 Likes

too bad. But maybe it is “combinable” with the other custom component from UPS/Fedex?

Maybe it’s a good time to get in touch with PostNL so that a properly functioning API can be realized from both sides? Especially if it appears that they are trying to reduce traffic :stuck_out_tongue:

@ptnijssen alteady know what your next steps will be on this? Are you going to launch it as a custom component?

Due to personal circumstances I didn’t had much time yet. I am awaiting for a fix in the library which IcyPalm is looking at. I think we can afterwards still update the PostNL component so it stays part of HA, if we also make sure that the scan_interval is lowered so we are not refreshing every X minutes.

Thanks. I’ve added the required lines to my custom PostNL component and it working… for now! :slight_smile:

Sorry to bother, but it seem that the integration is not working anymore.
After a restart of HA I get the following log error.

Can’t connect to the PostNL webservice
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/postnl_api/postnl_api.py”, line 179, in _request_login
data = response.json()
File “/usr/local/lib/python3.7/site-packages/requests/models.py”, line 897, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/local/lib/python3.7/site-packages/simplejson/init.py”, line 525, in loads
return _default_decoder.decode(s)
File “/usr/local/lib/python3.7/site-packages/simplejson/decoder.py”, line 370, in decode
obj, end = self.raw_decode(s)
File “/usr/local/lib/python3.7/site-packages/simplejson/decoder.py”, line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/config/custom_components/postnl/sensor.py”, line 56, in setup_platform
api = PostNL_API(username, password)
File “/usr/local/lib/python3.7/site-packages/postnl_api/postnl_api.py”, line 57, in init
self._request_login()
File “/usr/local/lib/python3.7/site-packages/postnl_api/postnl_api.py”, line 182, in _request_login
raise (UnauthorizedException())
postnl_api.postnl_api.UnauthorizedException

So are there more people who having the same issue?

I had the same issue until I changed a few lines in the custom component (assuming you use @ptnijssen custom component and not the official core one).

Unfortunately I can’t reach my files now, but I can post updated files on my repo later tonight (after midnight though). They work fine for me.

The solution is also mentioned a few posts back, you need to change line 39 in sensor.py to the solution a few posts back. Else you can wait til I post the files on my repo for easy download.

Thankyou Jim for your reaction. Thats right I use the custom component of @ptnijssen and made the changes whiche you discribe in sensor.py. But it is still not working.

Did you change the manifest.json file as well? I honestly don’t remember how I got it to work again. I got the files from multiple sources. Unfortunately I am still at work, but I will upload the files to my repo when I get home (given that I don’t forget it :rofl::joy:).

Edit: I just restarted HA and it seems it is broken again (it did work a few hours ago as I did restart a few times today already). The screenshot can confirm this. However it seems to be not working again:

I will try some more, but it seems the “temporary” fixes are broken now.

Thanks Jim for sorting it out, hopefully I do not put you from your work :rofl: :rofl:. But I understand you having also the issue. I looks like it happening every week at the same time.

Yeah the solutions posted here only seem to work for a short time. I think that they will block us entirely in the future. So I am already counting on the removal of postnl entirely (including core). Ofc I am not sure, but the way postnl makes it harder and harder to get data from them makes me think they don’t want us to do this.

But only time will tell. The app seems to work fine though, so it isn’t something on their side I guess.

Hello everyone,

I’ve been trying to read every word in this topic to get closer to fixing my problem.
First of all let me say this is my first time trying home automation and that i am completely new to this. So bear with me if i ask stuff that seem really obvious to you.

I have been trying to get the postnl working in my hassio for 2 weeks now, I just simply can’t get it to work. Most of the solutions I find here are not working for me.

I installed the lovelace ui card from the community part. I downloaded the files and placed them in custom_components\postnl and I added the following to my configuration.yaml:

sensor:

  • platform: postnl
    username: ‘xxxxxx’
    password: ‘xxxxxx’

I added the following to the lovelace-ui.yaml:

resources:

  • type: module
    url: /community_plugin/lovelace-postnl-card/postnl-card.js

I restarted my raspberry Pi like 10 to 20 times already. After reading this topic I saw that most of you at least have the sensors available. I dont see any sensors related to postnl. So it seems I am really bad at installing stuff like this and would really love your help.

With Regards,

DeeKayNL

PostNL is currently really annoying everyone of us with changing stuff with their API all the time. Currently PostNL is broken (again). I will suggest to stop trying as it is no use. This happens all the time to this component lately which is a shame though.

I’d keep an eye on this thread, but better spend your time on building something else that is cool with HA. Because this doesn’t work for anyone atm.

Thank you for your quick answer, sad to see it doesnt work properly anymore. Wish I would have posted this sooner, could have saved me a lot of time :smiley:

Now to try to get started with smart lights and wall switches.