mampfes / ha_epex_spot

Adds EPEX Spot data to Home Assistant.
MIT License
130 stars 19 forks source link

Price in ct/kWh seems to be a problem #107

Closed angeeinstein closed 6 months ago

angeeinstein commented 6 months ago

Having the price in ct seems to be a problem for Home Assistant. The calculation for the daily electricity cost is way too high when I select Net price as an entity for cost calculation. How does it work for other people?

Mightyjust commented 6 months ago

Same problem for me - it works as intended when using spot data price. Would love to know how to use the net price sensor too.

mampfes commented 6 months ago

The temporary solution is to add a template sensor which converts ct/kWh from the net-price sensor into EUR/kWh. The long-term solution is more complicated: Either I have to make the unit-of-measure configurable or the HA unit-of-measure system can be enhanced to convert between different energy prices.

knorp commented 6 months ago

Same issue here, I'll check out the template. Maybe just simply duplicating the sensor with a different unit would be an option as a quick fix without unit configuration?

mampfes commented 6 months ago

Example:

{{ states('sensor.epex_spot_data_net_price') | float / 100 }}

image

knorp commented 6 months ago

Got a working template now - I've tried the helper but it complained about missing device class / unit. Adding this template directly to configuration.yaml works fine for me (omit template/sensor if you've got that section already obviously):

template:
  sensor:
    - name: "Energy Net Price"
      state: "{{(states('sensor.epex_spot_data_net_price') | float / 100) }}"
      unit_of_measurement: "EUR/kWh"
      state_class: measurement
Mightyjust commented 6 months ago

thank you, both methods work perfectly!

gismo2004 commented 6 months ago

@mampfes Was there an action/issue/defect/feature on Home Assistant side in regard to unit conversion, or will that be the future solution to create this template sensor?

mampfes commented 6 months ago

@gismo2004 No, not yet.