nordpool icon indicating copy to clipboard operation
nordpool copied to clipboard

Changes in VAT create new device and entity for Belgian, Finish and Estonian users

Open rrooggiieerr opened this issue 1 year ago • 9 comments

Version of the custom_component

0.0.15

Homeassistant version

Core 2024.10.2

Configuration

Default configuration for Belgium, Finland or Estonia

Describe the bug

I'm personally not affected by this issue, but a Belgian user told me a new device and entity are created after installing the latest update.

Looking into the code I see that the VAT for Belgium (also Finland and Estonia) is updated and that the VAT is part of the unique id. Which explains this behaviour.

Debug log

No debug logging, this makes the issue not meet the minimum requirements, so it wil probably be closed. So be it

rrooggiieerr avatar Oct 14 '24 09:10 rrooggiieerr

I'd better make VAT part of the configuration.

yozik04 avatar Oct 14 '24 11:10 yozik04

Same issue here. Got sensor configured in yaml. Cannot define entity name or atleast yaml check gives error when trying.

Used in many automations and templates so alot of work if needing to edit those all.

Pave87 avatar Oct 14 '24 12:10 Pave87

Same for me in Norway , had too delete old entity and create a new one

katla50 avatar Oct 14 '24 13:10 katla50

I already updated, but did not restart yet. 😅 Is there a plan to "fix" this, or do I just create a new entity like everyone before me?

Luoti avatar Oct 14 '24 15:10 Luoti

There no plan to fix it. Just set your own entity name in the ui and you don’t have to deal with it. There where api changes so there were some breaking changes for some users.

Hellowlol avatar Oct 14 '24 15:10 Hellowlol

I use templated approach because have additional costs rule that are not doable using UI. I don't know how to fix the changed name of the sensor now? Following used to work, sensor name was simply "nordpool".

nordpool:
sensor:
  - platform: nordpool
    friendly_name: Nordpool
    region: "FI"
    currency: "EUR"
    VAT: True
    precision: 3
    low_price_cutoff: 0.75
    price_in_cents: true
    price_type: kWh
    additional_costs: >
      {% 
        set s= {
            "hourly_fixed_cost": 0.027937+0.0038,
            "night": 0.0201,
            "day": 0.0287
      }%}
      {% if now().hour >= 7 and now().hour < 22 %}
          {{ s.day + s.hourly_fixed_cost | float }}
      {% else %}
          {{ s.night + s.hourly_fixed_cost | float }}
      {% endif %}

matkaan avatar Oct 14 '24 16:10 matkaan

@Hellowlol the name change of the device and entities are related to the VAT change, not the API change. The VAT changes were also breaking changes for those living in countries it applied to

rrooggiieerr avatar Oct 14 '24 18:10 rrooggiieerr

I learned that additional cost - template can now be added through UI. Did that (same code from above) and then renamed sensor. All good again! Thanks.

matkaan avatar Oct 15 '24 06:10 matkaan

I added option to define unique_id manually in yaml that is used as entity id for Nordpool sensor. Have opened pull request.

In case someone wants this change before its merged you can use https://github.com/Pave87/nordpool in mean time.

Pave87 avatar Oct 15 '24 06:10 Pave87