Skip to content

Conversation

@Pave87
Copy link

@Pave87 Pave87 commented Oct 15, 2024

Added option for user to configure unique_id that is used as entity id.
This can help people who use Nordpool sensor in alot of places.

Copy link

@koopee koopee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least to me this looks very ok. I don't know if some tests should be added to this though.

Also the documentation would need updating to reflect this change as well.

Copy link

@koopee koopee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation would need some changes as well.

Documentation for overriding entity id
@Pave87
Copy link
Author

Pave87 commented Oct 16, 2024

Added some documentation of this to README.md

Will look into making tests for this but might take some as very new to Python and Home Assistant components.

Copy link

@koopee koopee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not manage to find testing for any other functionality for nordpool integration, so if there is no required testing for nordpool integration, I approve this.

@koopee
Copy link

koopee commented Nov 8, 2024

Why is this still pending? I would really much like this to be added to next release.

@sim642
Copy link

sim642 commented Jan 1, 2025

This seems like quite an important thing to have. For UI configuration the README recommends renaming the device, but for YAML configuration there's no way.

@WebSpider
Copy link

@koopee
Copy link

koopee commented Oct 8, 2025

Thanks for the links and reference to the principles, which are very understandable. However I think the nordpool sensor is a bit borderline case. I think unique_id is supposed to keep things static, but in nordpool case when VAT changes the sensor id also changes and things are not static anymore.

I would very much like an option for the nordpool sensor that would just provide me an easy "finnish nordpool price inclusive VAT" -unique id option without having to care about changing VATs that cause the need for me to revisit all my nordpool dependent automations if VAT changes again.

Back in 2022-2023 Finnish parlament decided to temporarily lover the electricity Vat from 24% to 10% and 25.5% in September 2024. So I had to refactor my automations three times in those times. Quite a chore because of an "unique_id that is not user selectable" but still changes seemingly arbitrarily.

This goes against HA design principles, unique_id should not be user changeable

https://www.home-assistant.io/faq/unique_id/#can-i-add-a-unique-id-myself https://developers.home-assistant.io/docs/entity_registry_index?_highlight=unique_id#unique-id

@WebSpider
Copy link

Note there is a difference between entity_id and unique_id

@koopee
Copy link

koopee commented Oct 8, 2025

Note there is a difference between entity_id and unique_id

Good point, thanks! Maybe entity_id would work as well. Still, I think nordpool unique_id definition maybe should not change if Vat changes. At least for me the unique_id change does not make much sense.

@property
def unique_id(self):
name = "nordpool_%s_%s_%s_%s_%s_%s" % (
self._price_type,
self._area,
self._currency,
self._precision,
self._low_price_cutoff,
self._vat,
)

@Pave87
Copy link
Author

Pave87 commented Oct 14, 2025

Thanks for the links and reference to the principles, which are very understandable. However I think the nordpool sensor is a bit borderline case. I think unique_id is supposed to keep things static, but in nordpool case when VAT changes the sensor id also changes and things are not static anymore.

I would very much like an option for the nordpool sensor that would just provide me an easy "finnish nordpool price inclusive VAT" -unique id option without having to care about changing VATs that cause the need for me to revisit all my nordpool dependent automations if VAT changes again.

These VAT changes are exactly reason why I did this.
I know my solution here is a bit hack.
But having entity id staying same after sensor has been created makes sense.

@Hellowlol Hellowlol added the enhancement New feature or request label Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants