Struggling with getting Peak / Off-Peak set up for Electricity Meter.
I have 2 air conditioners and i want to track peak and off-peak energy for both. Peak tariff is from 07:00 to 23:00 for April-October and 06:00 to 22:00 for November-March.
The sensor is showing me the correct tariff according the current hour. But Energy is counted only in peak tariff.
Here is my configuration:
# Utility meter
utility_meter:
daily_energy_daikin:
source: sensor.shellyplus1pm_7c87ce6497b4_switch_0_energy
name: Daikin
cycle: daily
tariffs:
- peak
- offpeak
daily_energy_mhi:
source: sensor.shellyplus1pm_a8032ab8ad14_switch_0_energy
name: MHI
cycle: daily
tariffs:
- peak
- offpeak
sensor:
- platform: template
scan_interval: 120
sensors:
energo_tariff:
friendly_name: "Energo Pro"
value_template: >
{## Лятно време => Април-Октомври включително ##}
{% if now().month >= 4 and now().month <= 10 -%}
{## Лятна дневна тарифа - 07:00-23:00 ##}
{% if now().hour >= 7 and now().hour < 23 -%}
peak
{%- else -%}
offpeak
{%- endif %}
{## Зимно време => Ноември-Март включително ##}
{%- else -%}
{## Зимна дневна тарифа - 06:00-22:00 ##}
{% if now().hour >= 6 and now().hour < 22 -%}
peak
{%- else -%}
offpeak
{%- endif %}
{%- endif %}
energo_price:
friendly_name: "Energo Pro Цена"
unit_of_measurement: "{currency}/kWh"
value_template: >
{% set day_price = 0.255912 %}
{% set night_price = 0.144384 %}
{% if is_state("sensor.energo_tariff", "peak") -%}
{{ day_price }}
{%- else -%}
{{ night_price }}
{%- endif %}