ha-postnl icon indicating copy to clipboard operation
ha-postnl copied to clipboard

Ability to add multiple accounts

Open guyke01 opened this issue 1 year ago • 1 comments

At this moment it is not possible to add a second account with the PostNL integration. When we add a second account no entities are added. When i check the logs there is an error that the sensors are already exist.

Is it possible to make something like a prefix or suffix from a name that is given in the setup of the integration?

guyke01 avatar Mar 11 '24 18:03 guyke01

I will add support for multiple accounts. 😄

arjenbos avatar Mar 15 '24 10:03 arjenbos

@arjenbos thanks for the add-on for HA. Is there a timeline for support for multiple accounts?

tonyhollaar avatar Sep 17 '24 19:09 tonyhollaar

I added multi account support and will release it as a beta release. Please test it 😄 .

arjenbos avatar Sep 27 '24 10:09 arjenbos

After a reboot the sensors will be switched or new sensors are being created on the 2 accounts.

Account 1 image

Account 2 image

After a second reboot the sensors switched or new sensors are created. Is it possible to add the name of the integration to the sensor so each account has it's own persistant name instead of the _1, _2, _3 ...

guyke01 avatar Sep 27 '24 11:09 guyke01

I added multi account support and will release it as a beta release. Please test it 😄 .

Thank you for the code changes Arjen, I tested it for two accounts of PostNL and it works like a charm in Home Assistant.

Steps Taken:

  1. I updated the version of PostNL in the HACS store in Home Assistant
  2. I re-added the temporary browser extension here: https://github.com/arjenbos/ha-postnl-browser-extensions in Firefox.
  3. In Home Assistant > Settings > Devices & Integrations > +Integration I re-added the PostNL integration for the second account.

tonyhollaar avatar Sep 27 '24 21:09 tonyhollaar

After a reboot the sensors will be switched or new sensors are being created on the 2 accounts.

Account 1 image

Account 2 image

After a second reboot the sensors switched or new sensors are created. Is it possible to add the name of the integration to the sensor so each account has it's own persistant name instead of the _1, _2, _3 ...

The suffix are generated by HA. I would like to remove the _1, _2, etc as well, but I assume that people need to change their lovelace, automations, etc. That's why I didn't touch the name. I do not have a proper solutions right now.

arjenbos avatar Oct 01 '24 06:10 arjenbos

@arjenbos can you publish the 1.4.0 version? For now it's still beta.

guyke01 avatar Nov 13 '24 12:11 guyke01

That would be much appreciated! Would have saved me a lot of grey hairs.

Geheim49 avatar Nov 13 '24 12:11 Geheim49