elupus / hass_nibe

Home Assistant Nibe Uplink Integration
184 stars 54 forks source link

Feature request: System configuration to change "Write Access" #125

Open faanskit opened 2 years ago

faanskit commented 2 years ago

When I started to use the integration, I did not subscribe to the Premium Service. Therefore I did not enable "Write Access".

Having now opted in for Premium Service, I'd like to be able to update that configuration in the Configure System dialog. I suppose there are some configuration I can do to revise this, but the preference is to be able to change this in the Ui.

Please take note that the Premium Service is per system and not per account. In my case, I have Premium Service for one of my systems and not the other system.

So, the Write Access configuration should operate om system and not account.

frank8the9tank commented 2 years ago

This is something that i whould also like to see.

elupus commented 2 years ago

That is sadly complicated since it's re-authentication. So I'd have to add re authentication support. I'm happy to accept pull requests on it.

elupus commented 2 years ago

Also. You can't change per system, only per client connection.

EenerNL commented 1 year ago

Hi, is there any workaround for this? Or do I need to re-add the integration to change write-access?

elupus commented 1 year ago

Just re-add. All entities should come back the same.

EenerNL commented 1 year ago

Yes I know, but then I would lose my history. If there is no other option that’s my only option I guess.

Isn’t there an option to change some config files and re-initiate the integration?

Thanks for your quick response.

AnonymousRetard commented 1 year ago

Yes I know, but then I would lose my history. If there is no other option that’s my only option I guess.

Isn’t there an option to change some config files and re-initiate the integration?

Thanks for your quick response.

I was able to keep history on a Z-wave device that turned dead which I then had to remove and re-add. After re-adding it the device came back with the default name but after changing the name back to what I had changed it to previously (before it disconnected from the Z-wave network), it re-associated with the old entities and history.

I'm not 100% sure if it would work differently by removing and re-adding an entire integration though but when removing a device it seems like the old entities are still kept and can be re-associated with.

Might be worth a try, if you are worried about losing history you could also create a backup before the procedure.

samtygier commented 8 months ago

TLDR: It worked for me to delete the entry and readd it in "Write Access" mode. The history is preserved, and HA considers it to be the same device.

I did some experimenting by setting up a docker instance of HA, installing HACS and the nibe integration. Adding the heat pump in read only mode, and letting it record some data for a while.

Then I tried re-adding it (without deleting the existing entries), this did not do much, as it ignored everything for already existing: 2024-01-16 22:18:45.736 ERROR (MainThread) [homeassistant.components.sensor] Platform nibe does not generate unique IDs. ID 127xxx_40067 is already used by sensor.nibe_127xxx_40067 - ignoring sensor.nibe_127xxx_40067

Then I tried deleting the devices from the http://localhost:8123/config/integrations/integration/nibe, reboot to complete the remove, then do "Add Entry". This time choosing "Write Access". This successful connected everything with the same names as the first time. The history plots are continuous, i.e. it considers it to be the same device.


I repeated on my actual HA, and it went fine too. Though I had to rename one device, which had changed from water_heater.nibe_127xxx_40014_47387 to water_heater.nibe_hot_water, and so had disconnected its history. Change the name back in settings fixed it.