hello, is there a way to reset the pzem energy counter (esphome)?
For exemple with an automation…
Thanks
#FAST SENSORS FOR ENERGY CALCULATION & LOCAL DISPLAY
- platform: pzemac
current:
name: "PZEM-016 Current"
id: aac
internal: true
voltage:
name: "PZEM-016 Voltage"
id: vac
internal: true
power:
name: "PZEM-016 Power"
id: w
internal: true
frequency:
name: "PZEM-016 Frequency"
id: f
internal: true
power_factor:
name: "PZEM-016 Power Factor"
id: pf
internal: true
update_interval: 2s
- platform: total_daily_energy
name: "PZEM-016 Daily Energy"
power_id: w
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
unit_of_measurement: kWh
icon: mdi:counter
accuracy_decimals: 1
#SLOW SENSORS FOR HOME ASSISTANT
- platform: template #########################
name: "PZEM-016 Current Slow"
lambda: |-
if (id(aac).state) {
return (id(aac).state);
} else {
return 0;
}
unit_of_measurement: A
icon: "mdi:alpha-a-circle"
update_interval: 10s
- platform: template #########################
name: "PZEM-016 Voltage Slow"
lambda: |-
if (id(vac).state) {
return (id(vac).state);
} else {
return 0;
}
unit_of_measurement: V
icon: "mdi:alpha-v-circle"
update_interval: 10s
- platform: template #########################
name: "PZEM-016 Power Slow"
lambda: |-
if (id(w).state) {
return (id(w).state);
} else {
return 0;
}
unit_of_measurement: W
icon: "mdi:alpha-w-circle"
update_interval: 10s
- platform: template #########################
name: "PZEM-016 Frequency Slow"
lambda: |-
if (id(f).state) {
return (id(f).state);
} else {
return 0;
}
unit_of_measurement: Hz
icon: "mdi:alpha-f-circle"
update_interval: 10s
- platform: template #########################
name: "PZEM-016 Power Factor Slow"
lambda: |-
if (id(pf).state) {
return (id(pf).state);
} else {
return 0;
}
unit_of_measurement: PF
icon: "mdi:alpha-p-circle"
update_interval: 10s