Created
May 16, 2021 06:28
-
-
Save bessarabov/ec4abf6c63e4150d12cc954a4253552f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sensor: | |
- platform: template | |
sensors: | |
pzem_kwh: | |
unit_of_measurement: kWh | |
value_template: "{{ states('sensor.pzem_004t_v3_energy') | float / 1000 }}" | |
utility_meter: | |
daily_energy_pzem: | |
source: sensor.pzem_kwh | |
cycle: daily | |
daily_energy_pzem_tariff: | |
source: sensor.pzem_kwh | |
cycle: daily | |
tariffs: | |
- day | |
- night | |
automation: | |
- alias: Set day tariff | |
trigger: | |
- platform: time | |
at: "07:00:00" | |
action: | |
- service: utility_meter.select_tariff | |
entity_id: utility_meter.daily_energy_pzem_tariff | |
data: | |
tariff: day | |
- alias: Set night tariff | |
trigger: | |
- platform: time | |
at: "23:00:00" | |
action: | |
- service: utility_meter.select_tariff | |
entity_id: utility_meter.daily_energy_pzem_tariff | |
data: | |
tariff: night | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment