Just checking, this library right?: https://github.com/iMicknl/python-postnl-api/
I have tried downloading these files and use them as a custom component, unfortunately it didnāt work.
Correct. If you have a fix, make a PR to that one and ask the maintainer to tag. I will update the component in HA when possible.
Thanks for your help!
Done! Waiting for a reply now
You could fix it short term by adding https://github.com/peternijssen/postnlpy to your /homeassistant/deps/lib/python3.7/site-packages/postnlpy and then modify the postnlapi.py
from:
DEFAULT_HEADER = {
'api-version': '4.16',
'X-Client-Library': 'PostnlPy',
}
to:
DEFAULT_HEADER = {
'api-version': '4.16',
'X-Client-Library': 'PostnlPy',
'User-Agent': 'PostNL/Android/6.5.1',
}
And then restart HA
User agent Android? Or does it not matter which device? Seems like it shouldnāt matter will try this!
User-Agent Firefox and Chrome did not seem work, Postman and the PostNL Android app seem to work so yeahā¦
ehmm, and all credit go to IcyPalm, I just fiddled it in the postnlapi.py
Thanks all. I will try to get this all in HA asap. Most important is that the library is getting merged. Hope this time it goes quick, last time it took about 20 to 30 days.
How do I easily acces these files?
Iāve created an issue in the repository of HA to track progress. I will write down the temporarily work around probably tonight when I am home.
Please follow this issue to stay up to date about the progress: https://github.com/home-assistant/home-assistant/issues/28726
How can I access the postnlapi.py file when I ssh into the RPi. My HA instance runs on Hassio.
Many thanks.
You need to download it from github (I even posted the URL) and copy the files to the structure as outlined in my previous post. Then edit the file, make the change and restart.
Hi all. Great news as the library has been updated.
Best work-around you can do right now:
- Use the files (only those in the components directory) from this PR: https://github.com/home-assistant/home-assistant/pull/27551
- Change
postnl_api==1.2.1
topostnl_api==1.2.2
Iāll try to get it in HA soon.
Hi all,
Iām new to HA so please be gentle
I try to install this great plugin into my system, though i understand that there are some issues related to PostNLās API.
My first steps are:
- Copy the files that are mentioned in the first post in /custom_components/postnl/:
- I added the sensor in the configuration.yaml that is documented in https://www.home-assistant.io/components/postnl/
- I donāt have the 3 sensors, but only one that is doing nothing. Even after restart HA.
- I copied https://github.com/peternijssen/postnlpy to /custom_components/postnl/ and edit the postnlapi.py file with the new header.
- Restarted HA
- Error:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/postnlpy/postnlapi.py", line 179, in _request_login
data = response.json()
- Downloaded the files from peters last post restart HA.
Strange thing is that i canāt connect to the webadmin anymore, just an error that the page canāt be displayed.
I can ping the system and connect through samba. When i delete the files mentioned in step 7, then i can use the webadmin again.
Any ideas ?
Kind Regards
Kevin
Iām not 100% sure where this goes wrong but my current advice is: wait for just a moment(few days/weeks) until the new version of the plugin is officially released and then you can just use the official new plugin without all the hassle of the file-copying and fixing
Will do! Thanks!
Hi all. Yet another update.
I just created a PR that fixes the PostNL component (without support for the lovelace card). That at least makes sure that many people already can use the component again, without needing my changes.
If you are not using the PostNL Lovelace card, keep an eye on this PR: https://github.com/home-assistant/home-assistant/pull/28794
If you are using the PostNL Lovelace card, keep an eye on this PR: https://github.com/home-assistant/home-assistant/pull/27551
I dont think they will fix it in the next version. At least the 0.102 dev / rc version will not fix this problem
My PR got merged yesterday. I think it will be in the next BETA of 0.102.