How do I reset an Energy sensor value created by ESPHome?

Hello here it is my config:

esphome:
  name: "qwer"
  friendly_name: electric_in

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "***********"

ota:
  password: "***********"

wifi:
  ssid: !***********
  password: !***********

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "***********"
    password: "**************"

captive_portal:
   
web_server:
  port: 80
uart:
  - id: u_pzem004phazeA
    tx_pin: GPIO13
    rx_pin: GPIO12
    baud_rate: 9600
    #stop_bits: 2

  - id: u_pzem004phazeB
    tx_pin: GPIO4
    rx_pin: GPIO5
    baud_rate: 9600
    #debug:
    #stop_bits: 2

  - id: u_pzem004phazeC
    tx_pin: GPIO16
    rx_pin: GPIO14
    baud_rate: 9600
    #stop_bits: 2

    
modbus:
  - id: m_pzem004phazeA
    uart_id: u_pzem004phazeA
  - id: m_pzem004phazeB
    uart_id: u_pzem004phazeB
  - id: m_pzem004phazeC
    uart_id: u_pzem004phazeC
    
sensor:
  - platform: pzemac 
    
    voltage:
      name: "PZEM004T phaze A Voltage"
    current:
      name: "PZEM004T phaze A Current"
    energy:
      name: "PZEM-004T phaze A V3 Energy"
    id: RV1
    power:
      name: "PZEM004T phaze A Power"
      id: PZEM004T_PHAZE_A
    frequency:
      name: "PZEM004T phaze A Frequency"
    power_factor:
      name: "PZEM-004T phaze A Power Factor"
    update_interval: 5s
    modbus_id: m_pzem004phazeA
    address: 0x10
    #0x12

  - platform: total_daily_energy
    name: "Споживання за день Фаза A"
    power_id: PZEM004T_PHAZE_A

    filters:
      - multiply: 0.001
    accuracy_decimals: 2
    unit_of_measurement: kW
    icon: mdi:counter 

  - platform: pzemac 
    
    voltage:
      name: "PZEM004T phaze B Voltage"
    current:
      name: "PZEM004T phaze B Current"
    energy:
      name: "PZEM-004T phaze B V3 Energy"
    id: RV2
    power:
      name: "PZEM004T phaze B Power"
      id: PZEM004T_PHAZE_B
    frequency:
      name: "PZEM004T phaze B Frequency"
    power_factor:
      name: "PZEM-004T phaze B Power Factor"
    update_interval: 5s
    modbus_id: m_pzem004phazeB
    address: 0x11
#address: 0x11
  - platform: total_daily_energy
    name: "Споживання за день Фаза B"
    power_id: PZEM004T_PHAZE_B

    filters:
      - multiply: 0.001
    accuracy_decimals: 2
    unit_of_measurement: kW
    icon: mdi:counter 

  - platform: pzemac 
    
    voltage:
      name: "PZEM004T phaze C Voltage"
    current:
      name: "PZEM004T phaze C Current"
    energy:
      name: "PZEM-004T phaze C V3 Energy"
    id: RV3
    power:
      name: "PZEM004T phaze C Power"
      id: PZEM004T_PHAZE_C
    frequency:
      name: "PZEM004T phaze C Frequency"
    power_factor:
      name: "PZEM-004T phaze C Power Factor"
    update_interval: 5s
    modbus_id: m_pzem004phazeC
    address: 0x12
#address: 0x10
  - platform: total_daily_energy
    name: "Споживання за день Фаза C"
    power_id: PZEM004T_PHAZE_C
    filters:
      - multiply: 0.001
    accuracy_decimals: 2
    unit_of_measurement: kW
    icon: mdi:counter 

button:
  - platform: template
    name: "RV1 kWh reset"
    on_press:
      then:
        - delay: 5s
        - pzemac.reset_energy: RV1
  - platform: template
    name: "RV2 kWh reset"
    on_press:
      then:
        - delay: 5s
        - pzemac.reset_energy: RV2
  - platform: template
    name: "RV3 kWh reset"
    on_press:
      then:
        - delay: 5s
        - pzemac.reset_energy: RV3

time:
  - platform: homeassistant
    id: hass_time

 
1 Like

pls edit your post and format it so it’s readable.
Instead of this

  • platform: homeassistant
    id: stoking_off_time
    entity_id: input_number.${location}_stoking_off_time #helper in home assistant
    force_update: true

like this

  - platform: homeassistant
    id: stoking_off_time
    entity_id: input_number.${location}_stoking_off_time #helper in home assistant
    force_update: true

Sorry, I`m new in Community. I reformat my post

1 Like

Perfect. Ok, it looks like this is a known issue.

Follow that thread for more info. It wouldn’t hurt to post your config and that you’re seeing the same problem.

Jeff

1 Like