Comments (9)
Díky za okamžitou reakci.
Měl jsem dočíst popis až do konce, nicméně vyzkouším.
from homeassistant_cz_energy_spot_prices.
Dík, chodí
from homeassistant_cz_energy_spot_prices.
Dobrý den.
Integrace je super. Mam jednoduché zadání. Potřebuji sepnout rele integrovane v HA při nejnižší ceně . . Pokouším se o to už nějakou dobu, ale jsem začátečník. Mohl bych poprosit o nějaký jednoduchý vzor takové automatizace ? Tuším že se to nastaví skrze známky 1-24 jako atribut, ale stále mě to nechodí. Děkuji velice za odpověď
from homeassistant_cz_energy_spot_prices.
To řeší hodnota sensor.current_spot_electricity_hour_order
1
je nejlevnější atd.
Tohle by mělo fungovat:
alias: sepnout rele integrovane v HA při nejnižší ceně
trigger:
- platform: state
entity_id:
- sensor.current_spot_electricity_hour_order
condition: []
action:
- if:
- condition: numeric_state
entity_id: sensor.current_spot_electricity_hour_order
below: 2
then:
- type: turn_on
entity_id: #relé, které chceš zapnout
else:
- type: turn_off
entity_id: #zajistí vypnutí pokud neplatí podmínka výše
enabled: true
mode: single
from homeassistant_cz_energy_spot_prices.
Dobrý den,
díky za super integraci.
Mám dotaz k automatizaci:
pro začátek bych chtěl vybíjet baterii do sítě ráno, kdy je špička většinou ve všední den v 8 nebo 9 hodin.
Dá se nějak vytvořit senzor current_spot_electricity_hour_order ale jen pro dopoledne?
Tím bych vybral nejvyšší cenu dopoledne.
Později bych využil to samé pro nabíjení a podobný senzor ale pro odpoledne.
Tím bych vybral nenižší cenu odpoledne/večer.
Děkuji moc
from homeassistant_cz_energy_spot_prices.
@Rotif Tady je příklad, jak najít nejlevnější hodinu v zadaném intervalu, to by Vám mohlo pomoct:
from homeassistant_cz_energy_spot_prices.
Senzory chodí bezvadně. Jde něco podobného udělat po 13:00 i pro příští den?
Dík
from homeassistant_cz_energy_spot_prices.
Nahradil jsem
{# Get value for that hour #}
{% set value = states.sensor.current_spot_electricity_hour_order.attributes.get(hour_dt.isoformat()) %}
tímto
{# Get value for that hour #}
{% set value = states.sensor.tomorrow_spot_electricity_hour_order.attributes.get(hour_dt.isoformat()) %}
ale nechodí mi to.
Senzor sensor.tomorrow_spot_electricity_hour_order není od 0:00 do 13:00 k dspozici a od 13:00 do 24:00 má hodnotu neznámé.
from homeassistant_cz_energy_spot_prices.
Takhle nějak by to asi šlo:
{# Define your intervals here as tuples (hour starting the interval, hour ending the interval (excluded)) #}
{% set intervals = [
(0, 8),
(8, 16),
(16, 24),
] %}
{# We need to use namespace so we can write into it in inner cycle #}
{% set min = namespace(price=None, dt=None, cheapest_hours=[]) %}
{% set cheapest_hours = [] %}
{% for interval in intervals %}
{# Reset min price from previous runs #}
{% set min.price = None %}
{# Go through all the hours in the interval (end excluded) and find the hour with lowest price #}
{% for i in range(interval[0], interval[1]) %}
{# Get datetime of current hour in current interval #}
{% set hour_dt = (now() + timedelta(hours=24)).replace(hour=i, minute=0, second=0, microsecond=0) %}
{# Get value for that hour #}
{% set value = states.sensor.tomorrow_spot_electricity_hour_order.attributes.get(hour_dt.isoformat()) %}
{# value is tuple (order, price), we'll use the price #}
{% set price = value[1] %}
{# Min price is not set or is higher than price of current hour => store the min price and hour #}
{% if min.price is none or price < min.price %}
{% set min.price = price %}
{% set min.dt = hour_dt %}
{% endif %}
{% endfor %}
{# Store cheapest hour in current interval #}
{% set min.cheapest_hours = min.cheapest_hours + [min.dt.hour] %}
{% endfor %}
{# use this to get the cheapest hours #}
{{ min.cheapest_hours }}
Vypisuje to, která hodina v zadaném intervalu je nejlevnější. sensor.tomorrow_spot_electricity_hour_order
má sice neznámou hodnotu, ale atributy fungují (když jsou k dispozici).
from homeassistant_cz_energy_spot_prices.
Related Issues (20)
- spot_electricity_is_cheapest_X_hours_block is time shifted by +2 hours HOT 3
- Timezone issues HOT 2
- entities dont show on/off values when creating automation HOT 6
- Aktuální cena není aktuální po update na 2023.9 HOT 13
- template sensor "Find cheapest hours in selected interval" HOT 3
- Median value HOT 3
- Item has no "Price" child or is empty
- Electricity Is Cheapest Looking X Hours Forward HOT 6
- device_class: monetary HOT 12
- Current Spot Electricity Hour not matching the hour of the day HOT 4
- X nejlevnějších hodin v zadaném intervalu HOT 5
- Timeout fetching prices HOT 1
- Error requesting CZE spot prices HOT 3
- Config flow could not be loaded: {"message":"Invalid handler specified"} HOT 1
- Tamplate sensor spravný zápis do config. Vyřešeno
- Dvoutarifní sazba D25d - řešení ceny HOT 5
- Cheapest X hours blocks - strange behavior HOT 5
- Prices shifted by one hour HOT 5
- incorrect electricity prices HOT 3
- Vzorové řešení reálných nákupních cen u dvoutarifních sazeb HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homeassistant_cz_energy_spot_prices.