Besoin d'aide pour configurer mon smart meter gateaway via ESPHome

Bonjour,

Je viens d’installer mon Smart Meter Gateway ESPHome editition sur HA.
La connexion internet est fonctionnel et l’intégration semble avoir eu lieu correctement. mon appareil est visible est les sensors aussi. Mais il ne fournissent aucune donnée. Ce qui me semble normal parce que je n’ai pas encore donnée la clé de chiffrement pour les donnée du compteur.

Mon problème est que je ne sais pas ou insérer cette clé de chiffrement. Mon appareil n’est pas visible dans ESPHome Builder et du coup je ne sais pas comment éditer le code pour intégrer ma clé de chiffrement.

J’ai reçu ça avec, mais je ne sais pas ou l’intégrer

esphome:
  name: smart-gateways-smart-meter
  friendly_name: smart_gateways_smart_meter
  name_add_mac_suffix: false
  project:
    name: smartgateways.smartmeter
    version: "1.0"

substitutions:
  device_name: smart_gateways_smart_meter
  device_description: "Smart Gateways Smart Meter Gateway"

esp32:
  board: nodemcu-32s
  framework:
    type: arduino

# Enable logging
logger:
  baud_rate: 0

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

ota:
#  password: "xxxxx"

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

# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Smart Gateways Smart Meter"
    password: "smartgateways"

captive_portal:

web_server:
  port: 80

uart:
  baud_rate: 115200
  rx_pin:
    number: GPIO18
    inverted: true
  rx_buffer_size: 3000
#  data_bits: 8
#  parity: NONE
#  stop_bits: 1

# enable the next lines if you want to debug
#  debug:
#    direction: RX
#    after:
#      delimiter: "\r\n"
#    sequence:
#      - lambda: UARTDebug::log_string(direction, bytes);

dsmr:
  max_telegram_length: 3000
  id: dsmr_instance
  receive_timeout: 200ms
# enable the next line if you encounter crc checksum mismatch errors (for some swedish and lithuanian meters)
#  crc_check: false


switch:
  - platform: gpio
    name: "Built-in LED"
    pin: 2
    id: led_wifi_connected

interval:
  - interval: 1s
    then:
      if:
        condition:
          wifi.connected:
        then:
          - if:
              condition:
                api.connected:
              then:
                - switch.turn_on: led_wifi_connected
                - delay: 200ms
                - switch.turn_off: led_wifi_connected
                - delay: 200ms
              else:
                - switch.turn_on: led_wifi_connected
                - delay: 500ms
                - switch.turn_off: led_wifi_connected
                - delay: 500ms
        else:
          - switch.turn_off: led_wifi_connected



sensor:
  - platform: dsmr
    energy_delivered_tariff1:
      name: "Energy Consumed Tariff 1"
    energy_delivered_tariff2:
      name: "Energy Consumed Tariff 2"
    energy_returned_tariff1:
      name: "Energy Produced Tariff 1"
    energy_returned_tariff2:
      name: "Energy Produced Tariff 2"
    power_delivered:
      name: "Power Consumed"
      accuracy_decimals: 3
    power_returned:
      name: "Power Produced"
      accuracy_decimals: 3
    electricity_failures:
      name: "Electricity Failures"
      icon: mdi:alert
    electricity_long_failures:
      name: "Long Electricity Failures"
      icon: mdi:alert
    voltage_l1:
      name: "Voltage Phase 1"
    voltage_l2:
      name: "Voltage Phase 2"
    voltage_l3:
      name: "Voltage Phase 3"
    current_l1:
      name: "Current Phase 1"
    current_l2:
      name: "Current Phase 2"
    current_l3:
      name: "Current Phase 3"
    power_delivered_l1:
      name: "Power Consumed Phase 1"
      accuracy_decimals: 3
    power_delivered_l2:
      name: "Power Consumed Phase 2"
      accuracy_decimals: 3
    power_delivered_l3:
      name: "Power Consumed Phase 3"
      accuracy_decimals: 3
    power_returned_l1:
      name: "Power Produced Phase 1"
      accuracy_decimals: 3
    power_returned_l2:
      name: "Power Produced Phase 2"
      accuracy_decimals: 3
    power_returned_l3:
      name: "Power Produced Phase 3"
      accuracy_decimals: 3
    gas_delivered:
      name: "Gas Consumed"
  - platform: uptime
    name: "SmartMeter Uptime"
  - platform: wifi_signal
    name: "SmartMeter Wi-Fi Signal"
    update_interval: 60s

text_sensor:
  - platform: dsmr
    identification:
      name: "DSMR Identification"
    p1_version:
      name: "DSMR Version"
  - platform: wifi_info
    ip_address:
      name: "Smart Gateways SmartMeter IP Address"
    ssid:
      name: "Smart Gateways SmartMeter Wi-Fi SSID"
    bssid:
      name: "Smart Gateways SmartMeter Wi-Fi BSSID"
  - platform: version
    name: "ESPHome Version"
    hide_timestamp: false

Pouvez-vous m’aider?

Merci d’avance

Renseigner votre problème

Ma configuration


System Information

version core-2025.4.2
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.13.2
os_name Linux
os_version 6.12.23-haos
arch aarch64
timezone Europe/Zurich
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
HACS Data ok
GitHub API Calls Remaining 5000
Installed Version 2.0.5
Stage running
Available Repositories 1665
Downloaded Repositories 4
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 Home Assistant OS 15.2
update_channel stable
supervisor_version supervisor-2025.04.0
agent_version 1.7.2
docker_version 28.0.4
disk_total 28.0 GB
disk_used 8.7 GB
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization
board green
supervisor_api ok
version_api ok
installed_addons Get HACS (1.3.1), Mosquitto broker (6.5.0), File editor (5.8.0), Matter Server (7.0.0), Plex Media Server (3.6.4), ESPHome Device Builder (2025.4.0)
Dashboards
dashboards 2
resources 1
views 9
mode storage
Network Configuration
adapters lo (disabled), end0 (enabled, default, auto), hassio (disabled), docker0 (disabled), veth3032986 (disabled), veth8bd0787 (disabled), vetha9f3a37 (disabled), veth2987251 (disabled), veth41479fc (disabled), veth9f274b6 (disabled), veth5fda804 (disabled)
ipv4_addresses lo (127.0.0.1/8), end0 (192.168.178.67/24), hassio (172.30.32.1/23), docker0 (172.30.232.1/23), veth3032986 (), veth8bd0787 (), vetha9f3a37 (), veth2987251 (), veth41479fc (), veth9f274b6 (), veth5fda804 ()
ipv6_addresses lo (::1/128), end0 (2001:8e0:30cd:f01:bb37:2b2e:b0ea:b9ca/64, fdab:706c:6219:0:af4a:e3e:25ef:24f4/64, fe80::2629:66ab:2622:da8d/64), hassio (fe80::6815:deff:fe15:a2f6/64), docker0 (fe80::90b0:9bff:fe51:484a/64), veth3032986 (fe80::dc5f:1aff:fe05:4792/64), veth8bd0787 (fe80::7852:43ff:fe29:d875/64), vetha9f3a37 (fe80::ac66:5eff:fe0e:4ac9/64), veth2987251 (fe80::50b9:54ff:fe8f:ed91/64), veth41479fc (fe80::cc16:5ff:fe8f:e3d7/64), veth9f274b6 (fe80::6821:bbff:fe08:464a/64), veth5fda804 (fe80::98dd:eff:fe9a:6902/64)
announce_addresses 192.168.178.67, 2001:8e0:30cd:f01:bb37:2b2e:b0ea:b9ca, fdab:706c:6219:0:af4a:e3e:25ef:24f4, fe80::2629:66ab:2622:da8d
Recorder
oldest_recorder_run 6 avril 2025 à 13:00
current_recorder_run 17 avril 2025 à 00:06
estimated_db_size 334.28 MiB
database_engine sqlite
database_version 3.48.0
___

Bonjour,
tu peux avoir une clé générée automatiquement sur le lien de la doc esphome:

Tu as juste à la coller à la place des xxxx et de reflasher ton esp.

api:
  encryption:
    key: "xxxxx"

Merci pour ta réponse, mais il me semble qu’ici c’est la clé qui permet à mon appareil de communiquer avec HA.

J’ai reçu une clé de chiffrement de mon fournisseur d’électricité et c’est celle-ci que je souhaite intégrer.

Mais elle sert a quoi c’est clé de chiffrement ?

A déchiffrer les données de mon compteur électrique.

il faut ajouter la ligne decryption_key: avec ta clé.

dsmr:
  max_telegram_length: 3000
  id: dsmr_instance
  receive_timeout: 200ms
  decryption_key: xxxx

Puis reflasher ton appareil.

Il te faut ajouter le module complémentaire ESPHome builder. Puis ajouter un device. tu rentre ce que tu veut , mais faire skip a la fin.

Puis edit le ton device

et coller tout le code, en ajoutant la ligne decryption_key: xxxx ou je te l’ai indiqué et flasher le device.

1 « J'aime »

Je fais faire ça.
Merci pour ton aide

Hello,

J’ai flasher mon appareil avec toutes les infos.

Il est connecté à mon HA, Mais il n’y a aucune donnée dans les capteur. dois-je faire une manipulation supplémentaire pour pouvoir afficher mes données.

Merci d’avance

Normalement non, mais je ne pourrais pas en dire plus, je ne dispose pas de cet appareil. J’ai vu quelques infos sur ce site
https://haprofs.com/austrian-smart-meter-integration-for-home-assistant-with-esphome/
Il faut regarder les logs du ESP ( wirelessly ), voir si tu trouves des informations ou erreurs.
Il faudrait reboot l’appareil pour voir les logs, dès le début, quand l’esp charge tous les modules.

J’ai effectivement bien suivis la mises en route depuis https://haprofs.com/austrian-smart-meter-integration-for-home-assistant-with-esphome/ et il me semble ne pas avoir manqué d’étape.

Je ne vois rien de particulier dans le LOG. Mais je ne suis pas expert.

INFO ESPHome 2025.4.0
INFO Reading configuration /config/esphome/smart-gateways-smart-meter.yaml...
WARNING GPIO2 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Starting log output from 192.xxxxxxxx using esphome API
INFO Successfully connected to smart-gateways-smart-meter @ 192.xxxxxxx in 0.024s
INFO Successful handshake with smart-gateways-smart-meter @ 192.xxxxxx in 0.094s
[18:58:56][I][app:100]: ESPHome version 2025.4.0 compiled on Apr 19 2025, 11:58:43
[18:58:56][I][app:102]: Project smartgateways.smartmeter version 1.0
[18:58:56][C][wifi:600]: WiFi:
[18:58:56][C][wifi:428]:   Local MAC: 94:xxxxxxxxx
[18:58:56][C][wifi:433]:   SSID: 'FRITZ!Box 7530 DW'[redacted]
[18:58:56][C][wifi:436]:   IP Address: 192.xxxxxxx
[18:58:56][C][wifi:440]:   BSSID: D4:xxxxxxxx[redacted]
[18:58:56][C][wifi:441]:   Hostname: 'smart-gateways-smart-meter'
[18:58:56][C][wifi:443]:   Signal strength: -68 dB ▂▄▆█
[18:58:56][C][wifi:447]:   Channel: 6
[18:58:56][C][wifi:448]:   Subnet: 255.255.255.0
[18:58:56][C][wifi:449]:   Gateway: 192.xxxxxxxxx
[18:58:56][C][wifi:450]:   DNS1: 192.xxxxxxxx
[18:58:56][C][wifi:451]:   DNS2: 0.0.0.0
[18:58:56][C][logger:177]: Logger:
[18:58:56][C][logger:178]:   Max Level: DEBUG
[18:58:56][C][logger:179]:   Initial Level: DEBUG
[18:58:56][C][switch.gpio:068]: GPIO Switch 'Built-in LED'
[18:58:56][C][switch.gpio:091]:   Restore Mode: always OFF
[18:58:56][C][switch.gpio:031]:   Pin: GPIO2
[18:58:56][D][switch:016]: 'Built-in LED' Turning OFF.
[18:58:56][D][switch:055]: 'Built-in LED': Sending state OFF
[18:58:56][C][uptime.sensor:033]: Uptime Sensor 'SmartMeter Uptime'
[18:58:56][C][uptime.sensor:033]:   Device Class: 'duration'
[18:58:56][C][uptime.sensor:033]:   State Class: 'total_increasing'
[18:58:56][C][uptime.sensor:033]:   Unit of Measurement: 's'
[18:58:56][C][uptime.sensor:033]:   Accuracy Decimals: 0
[18:58:56][C][uptime.sensor:033]:   Icon: 'mdi:timer-outline'
[18:58:56][C][uptime.sensor:034]:   Type: Seconds
[18:58:56][C][dsmr:281]: DSMR:
[18:58:56][C][dsmr:282]:   Max telegram length: 3000
[18:58:56][C][dsmr:283]:   Receive timeout: 0.2s
[18:58:56][C][dsmr:292]:   energy_delivered_tariff1 'Energy Consumed Tariff 1'
[18:58:56][C][dsmr:292]:     Device Class: 'energy'
[18:58:56][C][dsmr:292]:     State Class: 'total_increasing'
[18:58:56][C][dsmr:292]:     Unit of Measurement: 'kWh'
[18:58:56][C][dsmr:292]:     Accuracy Decimals: 3
[18:58:56][C][dsmr:292]:   energy_delivered_tariff2 'Energy Consumed Tariff 2'
[18:58:56][C][dsmr:292]:     Accuracy Decimals: 3
[18:58:56][C][version.text_sensor:021]: Version Text Sensor 'ESPHome Version'
[18:58:56][C][version.text_sensor:021]:   Icon: 'mdi:new-box'
[18:58:56][C][captive_portal:089]: Captive Portal:
[18:58:56][C][web_server:285]: Web Server:
[18:58:56][C][web_server:286]:   Address: smart-gateways-smart-meter.local:80
[18:58:56][C][mdns:116]: mDNS:
[18:58:56][C][mdns:117]:   Hostname: smart-gateways-smart-meter
[18:58:56][C][esphome.ota:073]: Over-The-Air updates:
[18:58:56][C][esphome.ota:074]:   Address: smart-gateways-smart-meter.local:3232
[18:58:56][C][esphome.ota:075]:   Version: 2
[18:58:56][C][esphome.ota:078]:   Password configured
[18:58:56][C][safe_mode:018]: Safe Mode:
[18:58:56][C][safe_mode:020]:   Boot considered successful after 60 seconds
[18:58:56][C][safe_mode:021]:   Invoke after 10 boot attempts
[18:58:56][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[18:58:56][C][api:140]: API Server:
[18:58:56][C][api:141]:   Address: smart-gateways-smart-meter.local:6053
[18:58:56][C][api:143]:   Using noise encryption: YES
[18:58:56][C][wifi_signal.sensor:010]: WiFi Signal 'SmartMeter Wi-Fi Signal'
[18:58:56][C][wifi_signal.sensor:010]:   Device Class: 'signal_strength'
[18:58:56][C][wifi_signal.sensor:010]:   State Class: 'measurement'
[18:58:56][C][wifi_signal.sensor:010]:   Unit of Measurement: 'dBm'
[18:58:56][C][wifi_signal.sensor:010]:   Accuracy Decimals: 0
[18:58:56][C][wifi_info:012]: WifiInfo SSID 'Smart Gateways SmartMeter Wi-Fi SSID'
[18:58:56][C][wifi_info:013]: WifiInfo BSSID 'Smart Gateways SmartMeter Wi-Fi BSSID'
[18:58:56][C][wifi_info:010]: WifiInfo IPAddress 'Smart Gateways SmartMeter IP Address'
[18:58:56][D][switch:012]: 'Built-in LED' Turning ON.
[18:58:56][D][switch:055]: 'Built-in LED': Sending state ON


Y a-t-il un moyen de savoir si la clé de chiffrement fonctionne?

Pour être sur que je n’ai pas fait d’erreur ou manqué quelques choses.
Avec MQTT Explorer je ne devrais pas voir apparaitre une arborescence DSMR?

Ça ne passe pas par MQTT, c’est par l’api .