Hi all,
I have a power meter (vendor: ISKRA MT681) that I read out with IR interface from Hichi.
It works fine after the January 2022 update of HA (see screenshot).
I get a reading (via template code I found on Github) showing me instantaneous net consumption (“Nettobezug”) from grid under consideration of my photovoltaic production - this is what I need to charge my vehicle while I have more production than consumption.
However, I would also like to see my instantaneous production (negative active energy) and consumption (positive active energy). I tried with statistics and also riemann integration but to no avail (failures in parsing configuration.yaml).
I only get absolute readings (see screenshot) - could someone point me into the right direction of how to get the present consumption/production from my EDL21 sensors?
It would probably have to be calculated by (reading at time t2 minus reading at time t1)/(t2 minus t1).
It should be ok if the sensor value is aggregated over the last e.g. (t2 minus t1) = 10 to 30 seconds.
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Specific
sensor:
- platform: edl21
name: Stromzaehler
serial_port: /dev/ttyUSB0
#sensor:
# - platform: integration
# source: sensor.stromzaehler_positive_active_energy_in_tariff_t1
# name: Strombezug_180
# unit_prefix: k
# round: 2
template:
- sensor:
- name: Strombezug
state: >
{% set pwrin = states('sensor.stromzaehler_positive_active_energy_in_tariff_t1') | float %}
{{ pwrin / 1000 | round(3) }}
unit_of_measurement: kWh
state_class: total_increasing
device_class: energy
#zusätzlich 300122
- name: Einspeisung
state: >
{% set pwrin = states('sensor.stromzaehler_negative_active_energy_in_tariff_t1') | float %}
{{ pwrin / 1000 | round(3) }}
unit_of_measurement: kWh
state_class: total_increasing
device_class: energy
- name: Nettobezug
state: >
{% set pwrin = states('sensor.stromzaehler_sum_active_instantaneous_power') | float %}
{{ pwrin / 1000 | round(3) }}
unit_of_measurement: kWh
state_class: total_increasing
device_class: energy
#Experimental
#sensor:
# - platform: integration
# name: Strombezugintegriert
# source: sensor.Strombezug
# unit_time: min
# method: left
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml