I have a PZEM-017, a digital DC voltage, current, power, and power consumption meter connected to ESP32. The following configuration provides Home Assistant with four entities.
sensor:
- platform: pzemdc
current:
name: "PZEM-017 Current"
voltage:
name: "PZEM-017 Voltage"
power:
name: "PZEM-017 Power"
energy:
name: "PZEM-017 Energy"
update_interval: 60s
What I need is to have a fifth entity in HA which would measure ampere-hours and would build historical graphs. I require it to measure the capacity of the battery through its discharging. Dividing Energy by the Voltage to get amp-hours is not the solution, because the Voltage won’t be constant.
Who knows how to «create» such virtual sensor basing on the existing ones?