custom-components / nordpool

This component allows you to pull in the energy prices into Home-Assistant.
467 stars 112 forks source link

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

Closed rrooggiieerr closed 2 weeks ago

rrooggiieerr commented 1 month ago

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

yozik04 commented 1 month ago

I'd better make VAT part of the configuration.

Pave87 commented 1 month ago

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.

katla50 commented 1 month ago

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

Luoti commented 1 month ago

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?

Hellowlol commented 1 month ago

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.

matkaan commented 1 month ago

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 %}
rrooggiieerr commented 1 month ago

@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

matkaan commented 1 month ago

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.

Pave87 commented 1 month ago

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.