Core: PostNL component broken

Created on 2 Feb 2019  路  26Comments  路  Source: home-assistant/core

Home Assistant release with the issue:
0.86.4

Last working Home Assistant release (if known):
0.85.1

Operating environment (Hass.io/Docker/Windows/etc.):
Ubuntu Linux 18.04 (kernel 4.15.0-43-generic)

Component/platform:
sensor.postnl

Description of problem:
Details are no longer displayed in the sensor's card. Previously this listed packages and their status.
screen shot 2019-02-02 at 16 17 39
[object Object] isn't very helpful

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

sensor
 - platform: postnl
    username: <secret>
    password: <secret>

Traceback (if applicable):
n/a

Additional information:
It looks like this issue broke it: https://github.com/home-assistant/home-assistant/pull/18334
It looks like there's a closed issue to revert this commit: https://github.com/home-assistant/home-assistant/pull/20430

From an end user endpoint it's really crappy to release break functionality (caused by a new/Lovelace UI?) and then say "oh, it needs more development". It was better before...

postnl

Most helpful comment

some history about this component

@basbl Changed some stuff in #18334 that resulted into [object object] @balloob approved that.
He wanted to change something so all known information can be used somewhere else (not well documented in https://github.com/home-assistant/home-assistant/pull/18334#issue-229713762)

@iMicknl Has said that there is now a custom Lovelace card needed for the change
there isn't any information about the Lovelace card in https://www.home-assistant.io/components/postnl/

@peternijssen Came across a possible card https://community.home-assistant.io/t/usps-fedex-ups-custom-ui-card-lovelace-updated-11-27/79648 (documentation and testing is needed)

@TheLastProject Suggested an revert #20430 @balloob Did no approve and suggested to build an Lovelace card.

@peternijssen Came across this https://gathering.tweakers.net/forum/list_message/55934285#55934285
I think it works with the old component but i am not 100% sure.

my opinion

In normal operation it should just work and give package information or there need to be documentation in home-assistant.io.
Removing existing information is not the proper way ether.
There needs to be documentation or the change (#18334) should not have been approved.

Possible solutions

1. Revert to the old version and let someone document on how to use an new custom Lovelace card and then revert back https://github.com/home-assistant/home-assistant/pull/20430

2. Use my version (#15389) that is the old version but with PostNL letter support (see picture below)

3. Fix the component so it does not look ugly in the UI and accept that there will be no package information

4. Accept the change and enjoy the broken component with the ugly [object object].


postnl lovelace
It is the standard package sensor, a standard letter sensor and an group with icon. If you click on the sensor you can see the graph and package information.


sources:
https://github.com/home-assistant/home-assistant/pull/18334#issue-229713762
https://github.com/home-assistant/home-assistant/pull/18334#issuecomment-457663600
https://github.com/home-assistant/home-assistant/issues/20696#issuecomment-459974338
https://github.com/home-assistant/home-assistant/pull/20430
https://github.com/home-assistant/home-assistant/issues/20696#issuecomment-466793501
https://github.com/home-assistant/home-assistant/pull/20430#issuecomment-457709797

All 26 comments

I believe the other issue states that a lovelace card should be created for this. I think it would even be better if somehow all package sensors (UPS, PostNL, FedEX, 17track, etc) can share a single, common lovelace card for packages/mail.

I agree with your last sentiment: a package lovelace card would work well. I don't have a UPS account, so wonder how its info is shown.
I see in the issue there's some discussion over how to format dates. Honestly, anything is better than what we have now, a list of senders like it used to be for instance on the left side.

Just came across this card; https://community.home-assistant.io/t/usps-fedex-ups-custom-ui-card-lovelace-updated-11-27/79648
No clue if it can support PostNL. I'm afraid all "providers" are using a different setup since packages/mail are not a generic component I believe. I guess it would be a good start to align all package providers and create a lovelace card out of it, but that's just my opinion :P

I do like the fact that I can now loop over shipments and do something with them rather then only displaying them. It kinda solved this:
https://gathering.tweakers.net/forum/list_message/55934285#55934285

But yes, display can definitely be improved. I tried to figure out yesterday how to create a lovelace card, but didn't start anything yet.

I'm having problem with the 'package' sensors (postNL and UPS) sinds 0.86.4 as well.
Before, I worked just fine. The sensors ar still in sensors.yaml, but they don't show up anywhere anymore...

Looking closer at it, seems https://github.com/home-assistant/home-assistant/pull/18334#issuecomment-457661990 refers to the PR as the culprit no?

Reverted the changes to the postnl and now it seems to be working again:
image

@riemers, someone made changes to the component in #18334 whereby the default card won't show the details anymore. It is necessary to built a custom (lovelace) card...

More the reason to revert the changes, now its broken. @balloob, think rolling back https://github.com/home-assistant/home-assistant/pull/18334 would be the proper thing to do untill an update & custom card exist.

Anything on this?

@SaturnusDJ I am going to dive into this.
I have got an version working with Lovelace.

@scheric Sounds good. Let me know if you need a tester, although not much incoming packages anymore for me.

some history about this component

@basbl Changed some stuff in #18334 that resulted into [object object] @balloob approved that.
He wanted to change something so all known information can be used somewhere else (not well documented in https://github.com/home-assistant/home-assistant/pull/18334#issue-229713762)

@iMicknl Has said that there is now a custom Lovelace card needed for the change
there isn't any information about the Lovelace card in https://www.home-assistant.io/components/postnl/

@peternijssen Came across a possible card https://community.home-assistant.io/t/usps-fedex-ups-custom-ui-card-lovelace-updated-11-27/79648 (documentation and testing is needed)

@TheLastProject Suggested an revert #20430 @balloob Did no approve and suggested to build an Lovelace card.

@peternijssen Came across this https://gathering.tweakers.net/forum/list_message/55934285#55934285
I think it works with the old component but i am not 100% sure.

my opinion

In normal operation it should just work and give package information or there need to be documentation in home-assistant.io.
Removing existing information is not the proper way ether.
There needs to be documentation or the change (#18334) should not have been approved.

Possible solutions

1. Revert to the old version and let someone document on how to use an new custom Lovelace card and then revert back https://github.com/home-assistant/home-assistant/pull/20430

2. Use my version (#15389) that is the old version but with PostNL letter support (see picture below)

3. Fix the component so it does not look ugly in the UI and accept that there will be no package information

4. Accept the change and enjoy the broken component with the ugly [object object].


postnl lovelace
It is the standard package sensor, a standard letter sensor and an group with icon. If you click on the sensor you can see the graph and package information.


sources:
https://github.com/home-assistant/home-assistant/pull/18334#issue-229713762
https://github.com/home-assistant/home-assistant/pull/18334#issuecomment-457663600
https://github.com/home-assistant/home-assistant/issues/20696#issuecomment-459974338
https://github.com/home-assistant/home-assistant/pull/20430
https://github.com/home-assistant/home-assistant/issues/20696#issuecomment-466793501
https://github.com/home-assistant/home-assistant/pull/20430#issuecomment-457709797

I personally would love to see the letters also being displayed. It's a shame the merge request never got through and the original library is not fully complete/working. I'll have a look if I can get it all somehow working.

I did some work this week. First results here, but not yet public:
https://community.home-assistant.io/t/lovelace-postnl/112433

Topic has been updated with instructions. Looking forward to everyone's feedback.
Let's continue the discussion in the forums.

@peternijssen why not fork the original repository and contribute there? Not really nice to copy an open source package fully and not contribute back to the original package.. This would also benefit users using the postnl_api package.

Great work by the way with the Lovelace card! Would be nice to have those cards by default in Home Assistant.

Thanks @iMicknl. I guess it's my incompetence with Python itself. I only knew how to test by releasing those packages and then adapting my temporarily custom_component to use that package. I had to do quite some releases to figure out what I needed and this was for me the quickest method to figure it out. It's also based on a different package a created earlier for the Spider Component.

So I am sorry if I offended you, but I am happy to merge towards your repository, although changes are massive and breaking since it goes a complete different direction. My intensions were good (https://community.home-assistant.io/t/lovelace-postnl/112433/48)

@peternijssen I didn't doubt about your intensions, was just wondering why it had to be in a new component. :-)

If you want, I can have a look if I can merge your changes in the existing postnl-api version used by HomeAssistant. Not sure how many breaking changes there are. Next time, easiest way to base your work on an existing package is to fork the package on Github. From there on it is easy to merge all the changes in the original package or to keep it as a separate version of the package.

I forked your lib and will create a pull request. :+1:

Sorry for the delay. Will create the PR this weekend.

It worked once....now I only get this statement when restarted:

Setup of platform postnl is taking longer than 60 seconds. Startup will proceed without waiting any longer.

IS there any way to start the component when HA is already started?

I just restarted HA on my side and I don't have that issue over here.

I plan on updating the component in HA, but waiting till my PR is accepted within the original library; https://github.com/iMicknl/python-postnl-api/pull/13

JUst repoend the tab.....and it was there, working like a charm! But ty for the quick reply !!

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 馃憤
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Didn't hear about this being fixed, but sadly can't check right now to confirm due to #29002.

Someone has made a workaround for PostNL's stupid lack of a good API.

https://github.com/ToonSoftwareCollective/postnl/blob/master/postnl.sh

I've confirmed it to be able to receive a json file with all the post data (packages, can't check for letters).

Was this page helpful?
0 / 5 - 0 ratings