rnovacek / homeassistant_cz_energy_spot_prices

Home Assistant integration that provides current Czech electricity spot prices based on OTE.
Apache License 2.0
75 stars 17 forks source link

Median value #34

Closed hipik634 closed 2 months ago

hipik634 commented 8 months ago

Hi, I am having issue with cheapest blocks. Sometimes it misses the night. I need to run battery recharge each night + each day (when there is not enough sun). My guess it would be median. And if value is under median, the sensor would go on signaling enable charging (to get over top prices) . Could that be managed or added to sensor set? The idea is to be able to utilize both graph lows, not only the main cheapest block. thanks 2023-10-13 13_56_40-Victron – Home Assistant

rnovacek commented 8 months ago

Median can be achieved by using Current Spot Electricity Hour Order. When it's value is <= 12 it's below the median, otherwise it's above it.

Or maybe I just don't understand the question :)

hipik634 commented 8 months ago

thanks, I have had issues with working with the hour order, i cannot correctly formulate the automation rules, because the values are in the attributes and i seem not to understand how to create a condition

Can you please give an example, how to create one? something like when current spot price is bellow <12 . Sorry to bother you.

rnovacek commented 2 months ago

Sorry for late answer, I missed the notification for this comment.

Try something like this:

description: ""
mode: single
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.current_spot_electricity_hour_order
    below: 12
condition: []
action: []

sensor.current_spot_electricity_hour_order is order of current hour when you sort all hours in a day by the price. So when value of this sensor is below 12, it means the price is below median.