TheBrain8791 / ha_awattar

Adds Awattar energy cost data to Home Assistant.
Other
11 stars 1 forks source link

Home Assistant Core update to 2023.5 broke integration #7

Open mf76130 opened 1 year ago

mf76130 commented 1 year ago

Hi,

Just updated to Home Assistant Core 2023.5 since that i get this error message Logger: homeassistant.config_entries Source: custom_components/awattar_energy_cost/init.py:26 Integration: Awattar Energy Cost (documentation, issues) First occurred: 06:13:14 (1 occurrences) Last logged: 06:13:14

Error setting up entry Awattar (at) for awattar_energy_cost Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/awattar_energy_cost/init.py", line 26, in async_setup_entry hass.config_entries.async_setup_platforms(entry, PLATFORMS) AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'

br michael

gerione commented 1 year ago

Seems to be linked to #5

marklad commented 1 year ago

Thank you @mf76130 for highlighting your problem. I am the author of #5 and will postpone my update to 2023.5 for some time.

I mostly use https://github.com/mampfes/ha_epex_spot instead of ha_awattar nowadays and have my own template sensors with a calculation including tax and service fees to have the final price per kWh.

The only thing I use this integration for is an apex card with a graph of the prices for today’s and tommorow’s prices.

Marown commented 8 months ago

@marklad can you maybe share your template sensors with your calculator with us/me? Thank you =)

marklad commented 7 months ago

@marklad can you maybe share your template sensors with your calculator with us/me? Thank you =)

Hi @Marown , I hope this will help you, my templates are in german and I assume you will speak german too.

I have created an entity:

# Epex Spot für aWATTar umrechnen. 3 % Aufschlag + Netzkost 20 % MWst.
  - name: Awattar Preis Epex
    unique_id: "AwattarPreisEpex"
    icon: mdi:currency-eur
    unit_of_measurement: ct/kWh
    state: >
      {{ ( ( ( states('sensor.epex_spot_at_price') | float(0) ) / 1000 ) * states('input_number.awattar_aufschlag') | float(0) ) | round(5, default=0) }}

input_number.awattar_aufschlag = 1.236 (1 1,03 1,2) #3 Prozent Aufschlag + 20 % MWst.

I put this in a number so that I can change it quickly without having to update all my entities If awattar changes their prices.

I also have an automation which activates when "Awattar Preis Epex“ changes state (happens once per hour) then a service to change a numeric value is called (doesn't work in visual editor):

service: input_number.set_value
data:
  value: >-
    {{ (states('sensor.awattar_preis_epex')|float(6)) +
    states('input_number.awattar_aufschlag_netzgebuhren') | float(5) }}
target:
  entity_id: input_number.aktueller_strompreis_cent_kwh

input_number.aktueller_strompreis_cent_kwh is then used in the energy dashboard and other instances to reflect the price including ALL costs except fixed monthly fees which are around 11 Euros (Leistungspauschale, Messentgelt, Gebrauchsabgabe (Energie + Netzentgelt)). You could add that too but I didn’t do it and only measure variable per kWh costs.

I got 98,35 % accuracy in October in relation to monthly invoice.

Edit: I don’t use the ha_awattar integration anymore, also switched to Epex entities in my apex cards.

J0s3f commented 5 months ago

How do you calculate the awattar_aufschlag_netzgebuhren value @marklad

marklad commented 5 months ago

How do you calculate the awattar_aufschlag_netzgebuhren value @marklad

thanks for asking! I forgot to mention it. It is a number input helper, which at the time of my writing back in December was "0,05 + 0,0059 + 0,001“ == 0,0801 ( that’s the total of Netzgebühren per kWh of Wiener Netze). There was a price increase in January but I have not adjusted it yet I have to wait for the invoice I get in a couple of days.

I hope that helps!