lowest night hours #35
Replies: 4 comments 16 replies
-
Sorry, I'm not very familiar with this syntax - the example was provided by an user. Do you know the rank and the percentile sensor? Maybe they are sufficient for your request. |
Beta Was this translation helpful? Give feedback.
-
If you want to run a simple automation then your trigger for the automation should look like this: platform: template I am running an automation like that to heat up my water boiler |
Beta Was this translation helpful? Give feedback.
-
Hey there, maybe you could help me. But the sensor seems to be wrong. It should be 13:00 but show 01:00. edit - my sensor:
Thanks! |
Beta Was this translation helpful? Give feedback.
-
Epex releases the new prices daily at 13:00 oO Mine seems to work so far. I'll change the automations for charging now and keep an eye on it. |
Beta Was this translation helpful? Give feedback.
-
Hello!
Thanks for the nice integration - I want to use it to trigger battery charge during low cost night hours.
Therefore I have adapted your calculation:
state: >-
{% set ns = namespace(attr_dict=[]) %}
{% for item in (state_attr('sensor.epex_spot_at_price', 'data'))[0:24] %}
{%- set ns.attr_dict = ns.attr_dict + [(loop.index-1,item["price_eur_per_mwh"])] %}
{% endfor %}
{%- set price_map = dict(ns.attr_dict) %}
{%- set price_sort = price_map.values()|list %}
{%- set keys_list = price_map.keys()|list %}
{%- set ns = namespace(combo=[]) %}
{%- for p in keys_list %}
{%- set p = p|int %}
{%- if p < 22 %}
{%- set ns.combo = ns.combo + [(p, ((price_sort)[p] + (price_sort)[p+1] )|round(2))] %}
{%- endif %}
{%- endfor %}
{%- set ns.combo = ns.combo[0:8] %}
{%- set mapper = dict(ns.combo) %}
{%- set key = mapper.keys()|list %}
{%- set val = mapper.values()|list %}
{%- set val_min = mapper.values()|min %}
{{ key[val.index(val_min)]|string + ":00" }}
But I need to have it as time to trigger the Automation with it - could you help me on that ?
KR Niki
Beta Was this translation helpful? Give feedback.
All reactions