Reset Pzem esphome

Bonjour a tous,

Je possede 3 pzem V3 sous esphome mais je n’arrive pas a faire un reset des valeurs j’ai le message suivant

INFO Reading configuration /config/esphome/3pzem.yaml...
INFO Detected timezone 'Europe/Paris'
Failed config

esphome: None
  name: 3pzem
  on_boot:  None
    - None
      priority: -100.0
      then:  None
        - None
          pzemac.reset_energy:  None
            
            Couldn't find ID 'pzemac_1'. Please check you have defined an ID with that name in your configuration. These IDs look similar: "pzem".
            id: pzemac_1 None
  build_path: .esphome/build/3pzem
  platformio_options: {}
  includes: []
  libraries: []
  name_add_mac_suffix: False

voici mon fichier

esphome:

  name: 3pzem
  platform: ESP8266
  board: d1_mini
  
  on_boot:
    ## configure controller settings at setup
    ## make sure priority is lower than setup_priority of modbus_controller
    priority: -1

    then:
    - pzemac.reset_energy: pzemac_1
  

######## define adresss ########

#  on_boot:
    ## configure controller settings at setup
    ## make sure priority is lower than setup_priority of modbus_controller
#    priority: -100
#    then:
#     - lambda: |-
#          auto new_address = 2;    # adress destination 
#
 #         if(new_address < 1 || new_address > 7) // sanity check
  #        {
   #         ESP_LOGE("ModbusLambda", "Address needs to be between 0x01 and 0xF7");
    #        return;
     #     }

      #    esphome::modbus_controller::ModbusController *controller = id(pzem);
       #   auto set_addr_cmd = esphome::modbus_controller::ModbusCommandItem::create_write_single_command(
        #    controller, 0x0002, new_address);

         # delay(200) ;
        #  controller->queue_command(set_addr_cmd);
        #  ESP_LOGI("ModbusLambda", "PZEM Addr set");

#modbus:
 # send_wait_time: 200ms
#  id: mod_bus_pzem

#modbus_controller:
 # - id: pzem
    ## the current device addr
  #  address: 3   # adresss source du PZEM
  #  modbus_id: mod_bus_pzem
   # command_throttle: 0ms
#    setup_priority: -10
 #   update_interval: 30s
 
# Enable logging
logger:

  baud_rate: 0 # (UART logging interferes with pzem)
  level: DEBUG
# Enable Home Assistant API
api:

ota:
  password: "b6a4df3aca1d8b31c86d594edfadbb87"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "3Pzem Fallback Hotspot"
    password: "nBqz0FUQIIt0"

captive_portal:


i2c:
  sda: GPIO4
  scl: GPIO5
  scan: true   

      

uart:
  - id: ubus1
    tx_pin: D6
    rx_pin: D5
    baud_rate: 9600
    stop_bits: 1     #pour un ESP8266, essayer plutôt la valeur 1
    
time:
  platform: sntp
  id: my_time
  
  on_time:
      - seconds: 57
        minutes: 59
        hours: 23
        then:  
          - sensor.template.publish:
              id: template_enedis_veille
              state: !lambda return id(enedis_puissance_du_jour).state;
  
sensor:
#### PZEM L'etage' ######

  - platform: pzemac

    address: 1
    current:
      name: "p2_courant"
      accuracy_decimals: 2
    voltage:
      name: "p2_tension"
      accuracy_decimals: 2
    power:
      name: "p2_puissance"
      unit_of_measurement: W
      accuracy_decimals: 2
      id: p2_puissance
    frequency:
      name: "p2_frequence"
      unit_of_measurement: Hz
      accuracy_decimals: 2
    power_factor:
      name: "p2_facteur_puissance"
      accuracy_decimals: 2
      id: p2_facteur_puissance
    energy:
      name: "p2_energy"
      unit_of_measurement: Wh
      accuracy_decimals: 1
      id: p2_energy
    update_interval: 5s

    
  - platform: template
    name: "p2_puissance_cumulee"
    unit_of_measurement: "kWh"
    accuracy_decimals: 1
    update_interval: 5s
    icon: mdi:power
    lambda: return (( (id(p2_energy).state)/1000.0));
    
  - platform: total_daily_energy
    name: "p2_du_jour"
    power_id: p2_puissance 
    unit_of_measurement: "kWh"
    accuracy_decimals: 2
    id: p2_puissance_du_jour
    filters:
        # Multiplication factor from W to kW is 0.001
        - multiply: 0.001
    icon: mdi:counter
    
  - platform: template
    name: "p2_veille"
    id: template_p2_veille
    unit_of_measurement: "kwh"
    accuracy_decimals: 2
    icon: mdi:power
    update_interval: 10s
    
  - platform: template
    name: "p2_puissance_apparente"
    id: p2puissance_apparente
    unit_of_measurement: "VA"
    accuracy_decimals: 2
    update_interval: 10s
    icon: mdi:power
    lambda: return ( (id(p2_puissance).state/id(p2_facteur_puissance).state));
  
  - platform: template
    name: "p2_puissance_reactive"
    id: p2_puissance_reactive
    unit_of_measurement: "VAr"
    accuracy_decimals: 2
    update_interval: 10s
    icon: mdi:power
    #lambda: return ( ((id(enedis_puissance_reactive).state)*sin(acos((id(enedis_facteur_puissance).state))) ) );
    lambda: return ( ( sqrt( (id(p2_puissance_reactive).state)*(id(p2_puissance_reactive).state)   -  (id(p2_facteur_puissance).state)*(id(p2_facteur_puissance).state) ) )  );
    

     #### PZEM-ENEDIS ####
    
  - platform: pzemac

    address: 2
    current:
      name: "enedis_courant"
      accuracy_decimals: 2
    voltage:
      name: "enedis_tension"
      accuracy_decimals: 2
    power:
      name: "enedis_puissance"
      unit_of_measurement: W
      accuracy_decimals: 2
      id: enedis_puissance
    frequency:
      name: "enedis_frequence"
      unit_of_measurement: Hz
      accuracy_decimals: 2
    power_factor:
      name: "enedis_facteur_puissance"
      accuracy_decimals: 2
      id: enedis_facteur_puissance
    energy:
      name: "enedis_energy"
      unit_of_measurement: Wh
      accuracy_decimals: 1
      id: enedis_energy
    update_interval: 5s

    
  - platform: template
    name: "enedis_puissance_cumulee"
    unit_of_measurement: "kWh"
    accuracy_decimals: 1
    update_interval: 5s
    icon: mdi:power
    lambda: return (( (id(enedis_energy).state)/1000.0));
    
  - platform: total_daily_energy
    name: "enedis_du_jour"
    power_id: enedis_puissance 
    unit_of_measurement: "kWh"
    accuracy_decimals: 2
    id: enedis_puissance_du_jour
    filters:
        # Multiplication factor from W to kW is 0.001
        - multiply: 0.001
    icon: mdi:counter
    
  - platform: template
    name: "enedis_veille"
    id: template_enedis_veille
    unit_of_measurement: "kwh"
    accuracy_decimals: 2
    icon: mdi:power
    update_interval: 10s
    
  - platform: template
    name: "enedis_puissance_apparente"
    id: enedis_puissance_apparente
    unit_of_measurement: "VA"
    accuracy_decimals: 2
    update_interval: 10s
    icon: mdi:power
    lambda: return ( (id(enedis_puissance).state/id(enedis_facteur_puissance).state));
  
  - platform: template
    name: "enedis_puissance_reactive"
    id: enedis_puissance_reactive
    unit_of_measurement: "VAr"
    accuracy_decimals: 2
    update_interval: 10s
    icon: mdi:power
    #lambda: return ( ((id(enedis_puissance_reactive).state)*sin(acos((id(enedis_facteur_puissance).state))) ) );
    lambda: return ( ( sqrt( (id(enedis_puissance_reactive).state)*(id(enedis_puissance_reactive).state)   -  (id(enedis_facteur_puissance).state)*(id(enedis_facteur_puissance).state) ) )  );
    

#### Pzem PV ######   
  - platform: pzemac

    address: 3
    current:
      name: "pv_courant"
      accuracy_decimals: 2
    voltage:
      name: "pv_tension"
      accuracy_decimals: 2
    power:
      name: "pv_puissance"
      unit_of_measurement: W
      accuracy_decimals: 2
      id: pv_puissance
    frequency:
      name: "pv_frequence"
      unit_of_measurement: Hz
      accuracy_decimals: 2
    power_factor:
      name: "pv_facteur_puissance"
      accuracy_decimals: 2
      id: pv_facteur_puissance
    energy:
      name: "pv_energy"
      unit_of_measurement: Wh
      accuracy_decimals: 1
      id: pv_energy
    update_interval: 5s

    
  - platform: template
    name: "pv_puissance_cumulee"
    unit_of_measurement: "kWh"
    accuracy_decimals: 1
    update_interval: 5s
    icon: mdi:power
    lambda: return (( (id(pv_energy).state)/1000.0));
    
  - platform: total_daily_energy
    name: "pv_du_jour"
    power_id: pv_puissance 
    unit_of_measurement: "kWh"
    accuracy_decimals: 2
    id: pv_puissance_du_jour
    filters:
        # Multiplication factor from W to kW is 0.001
        - multiply: 0.001
    icon: mdi:counter
    
  - platform: template
    name: "pv_veille"
    id: template_pv_veille
    unit_of_measurement: "kwh"
    accuracy_decimals: 2
    icon: mdi:power
    update_interval: 10s
    
  - platform: template
    name: "pv_puissance_apparente"
    id: pv_puissance_apparente
    unit_of_measurement: "VA"
    accuracy_decimals: 2
    update_interval: 10s
    icon: mdi:power
    lambda: return ( (id(pv_puissance).state/id(pv_facteur_puissance).state));
  
  - platform: template
    name: "pv_puissance_reactive"
    id: pv_puissance_reactive
    unit_of_measurement: "VAr"
    accuracy_decimals: 2
    update_interval: 10s
    icon: mdi:power
    #lambda: return ( ((id(enedis_puissance_reactive).state)*sin(acos((id(enedis_facteur_puissance).state))) ) );
    lambda: return ( ( sqrt( (id(pv_puissance_reactive).state)*(id(pv_puissance_reactive).state)   -  (id(pv_facteur_puissance).state)*(id(pv_facteur_puissance).state) ) )  );
    
  - platform: wifi_signal
    name: "cl_puissance_enedis"
    update_interval: 10s
    
  - platform: uptime
    name: "up"
    id: uptime_sec 
switch:
  - platform: restart
    name: "tableau_restart"


     
binary_sensor:
  - platform: status
    name: "tableau_status"    
    
    
text_sensor:
  - platform: template
    name: enedis_uptime
    lambda: |-
      int seconds = (id(uptime_sec).state);
      int days = seconds / (24 * 3600);
      seconds = seconds % (24 * 3600); 
      int hours = seconds / 3600;
      seconds = seconds % 3600;
      int minutes = seconds /  60;
      seconds = seconds % 60;
      return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
    icon: mdi:clock-start
    update_interval: 113s        

Je vous remercie pour votre aide

System Health

version core-2022.2.3
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 4.19.0-17-amd64
arch x86_64
timezone Europe/Paris
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 5000
Installed Version 1.22.0
Stage running
Available Repositories 988
Downloaded Repositories 70
AccuWeather
can_reach_server ok
remaining_requests 49
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Debian GNU/Linux 10 (buster)
update_channel beta
supervisor_version supervisor-2022.01.1
docker_version 20.10.8
disk_total 113.6 GB
disk_used 20.1 GB
healthy true
supported failed to load: Unsupported
supervisor_api ok
version_api ok
installed_addons Samba share (9.5.1), MQTT Server & Web client (1.2.0), Terminal & SSH (9.3.0), Spotify Connect (0.10.0), Grafana (7.4.1), Tydom2MQTT - Beta (release_v1.2.4), InfluxDB (4.3.0), Glances (0.14.2), Dnsmasq (1.4.4), Duck DNS (1.14.0), Studio Code Server (4.1.0), File editor (5.3.3), Zigbee2mqtt (1.23.0-1), Zigbee2mqtt Edge (edge), ESPHome (2022.1.3), Node-RED (10.4.0), Check Home Assistant configuration (3.9.0), Mosquitto broker (6.0.1)
Lovelace
dashboards 3
resources 45
views 17
mode storage
Spotify
api_endpoint_reachable ok