-
Notifications
You must be signed in to change notification settings - Fork 133
Add option to define unique_id in yaml #416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
koopee
left a comment
There was a problem hiding this 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
|
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. |
koopee
left a comment
There was a problem hiding this 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.
|
Why is this still pending? I would really much like this to be added to next release. |
|
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. |
|
This goes against HA design principles, https://www.home-assistant.io/faq/unique_id/#can-i-add-a-unique-id-myself |
|
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.
|
|
Note there is a difference between |
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. nordpool/custom_components/nordpool/sensor.py Lines 203 to 212 in 8ed3483
|
These VAT changes are exactly reason why I did this. |
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.