Komponent wM-Bus do ESPHome (SzczepanLeon) wersja 4.x - wątek ogólny

Ja obstawiam, że problem może być z tym zapisem type: auto

Proponuję zmienić na qualcosonic

oraz idąc za opisem zmienić all_drivers: true na false jeśli już wiesz jaki driver jest potrzebny.

Błędy leżą wyłącznie po stronie konfiguracji YAML i wyboru drivera – nie dotyczą sprzętu ani ramki (która jest nieszyfrowana i poprawnie dekoduje się w wmbusmeters).

To co udało mi się znaleźć:

  • Nieprawidłowa struktura YAML sekcji sensor:

    musi być listą (każdy sensor zaczyna się od myślnika -). Brak myślników powoduje że ESPHome nie tworzy obiektów sensorów, mimo że komponent wmbus ładuje się poprawnie.

  • Nieprawidłowa wartość type: auto parametr type przyjmuje nazwę konkretnego drivera lub jest pomijany (wtedy auto-detect). Wartość auto nie jest rozpoznawana – komponent nie przypisuje żadnego drivera do ramki.

  • Driver dla licznika Qualcosonic. Licznik ciepła Qualcosonic (Axioma Qualcosonic E3) jest obsługiwany przez dedykowany driver qualcosonic (z wmbusmeters 1.17.1). Auto-detect działa ale jawne wskazanie drivera jest pewniejsze i zalecane przy heat/cooling meters

Niestety ESPHome mogę mieć w wersji: 2024.12.4 albo 2026.2.6. (takie ma z backupow). Próbowałem wgrać 2025.9.3 wg jakiś poradników ale niestety nie działa

Builder ESPHome możesz mieć w niemal dowolnej wersji (mniej więcej od czasów, gdy zmiany w architekturze zrobiły się na tyle znaczące, że nie każdy projekt jest w stanie podążać za bieżącymi wydaniami)

tylko nie uruchamiaj więcej niż jednej wersji na raz (zatrzymaj aktualny, gdy uruchamiasz jakiś archiwalny)

Dzięki, zainstalowałem ESPHome 2025.6 wgrałem kod:

esphome:
  name: dommm
  friendly_name: Dommm

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  level: DEBUG
# Enable Home Assistant API
api:
  encryption:
    key: "bU88vYkEc361gDZHZ3FhWSWEUYjgDSS2fRMNijGDSS8="

ota:
  - platform: esphome
    password: "ba5b52cc421e9a38d6b069874d9be896"

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

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

captive_portal:
    
time:
  - platform: sntp
    id: time_sntp


external_components:
  - source: github://SzczepanLeon/esphome-components@version_4
    refresh: 0d
    components: [ wmbus ]


wmbus:
  frequency: 868.950  #default
  sync_mode: true    #default
  log_all: false
  #log_unknown: true   #default
  all_drivers: false 

  mosi_pin: GPIO32
  clk_pin:  GPIO33 
  miso_pin: GPIO19
  gdo2_pin: GPIO21
  gdo0_pin: GPIO22
  cs_pin:   GPIO23

  #mqtt:
 #   broker: 10.0.0.88
#    username: mqttUser
#    password: mqttPass

 # clients:
  #  - name: "wmbusmeters"
  #    ip_address: "10.0.0.22"
  #    port: 7227

sensor:
 #add driver to compile list (will be available for autodetect), don't create sensor
  - platform: wmbus
    type: itron



###########   LOKAL ##############################

 # lokal zimna
  - platform: wmbus
    meter_id: 0x00606059
    type: apator162
    key: "00000000000000000000000000000000"
    sensors:
      - name: "Lokal zimna woda"
        field: "total"
        accuracy_decimals: 3
        unit_of_measurement: "m³"
        device_class: "water"
        state_class: "total_increasing"
        icon: "mdi:water"

 # lokal ciepla
  - platform: wmbus
    meter_id: 0x00746039
    type: apator162
    key: "00000000000000000000000000000000"
    sensors:
      - name: "Lokal ciepla woda"
        field: "total"
        accuracy_decimals: 3
        unit_of_measurement: "m³"
        device_class: "water"
        state_class: "total_increasing"
        icon: "mdi:water"
###########   PARTER  ##############################

 # parter zimna
  - platform: wmbus
    meter_id: 0x00791869
    type: apator162
    key: "00000000000000000000000000000000"
    sensors:
      - name: "Parter zimna woda"
        field: "total"
        accuracy_decimals: 3
        unit_of_measurement: "m³"
        device_class: "water"
        state_class: "total_increasing"
        icon: "mdi:water"

 # parter ciepla
  - platform: wmbus
    meter_id: 0x00638821
    type: apator162
    key: "00000000000000000000000000000000"
    sensors:
      - name: "Parter ciepla woda"
        field: "total"
        accuracy_decimals: 3
        unit_of_measurement: "m³"
        device_class: "water"
        state_class: "total_increasing"
        icon: "mdi:water"

###########   PODDASZE  ##############################

 # PODDASZE zimna
  - platform: wmbus
    meter_id: 0x00638780
    type: apator162
    key: "00000000000000000000000000000000"
    sensors:
      - name: "Poddasze zimna woda"
        field: "total"
        accuracy_decimals: 3
        unit_of_measurement: "m³"
        device_class: "water"
        state_class: "total_increasing"
        icon: "mdi:water"

 # PODDASZE ciepla
  - platform: wmbus
    meter_id: 0x00611344
    type: apator162
    key: "00000000000000000000000000000000"
    sensors:
      - name: "Poddasze ciepla woda"
        field: "total"
        accuracy_decimals: 3
        unit_of_measurement: "m³"
        device_class: "water"
        state_class: "total_increasing"
        icon: "mdi:water"

i log:

INFO ESPHome 2025.6.3
INFO Reading configuration /config/esphome/dommm.yaml...
INFO Updating https://github.com/SzczepanLeon/esphome-components.git@version_4
INFO Detected timezone 'Europe/Warsaw'
INFO Generating C++ source...
INFO Compiling app...
Processing dommm (board: esp32dev; framework: arduino; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 2.1.4
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.3.0
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.6
|-- SPI @ 2.0.0
|-- SmartRC-CC1101-Driver-Lib @ 2.5.7
Compiling .pioenvs/dommm/src/esphome/components/wmbus/wmbus.cpp.o
Compiling .pioenvs/dommm/src/esphome/core/entity_base.cpp.o
Compiling .pioenvs/dommm/src/esphome/core/helpers.cpp.o
In file included from src/esphome/components/web_server_base/web_server_base.h:11,
                 from src/esphome/components/captive_portal/captive_portal.h:11,
                 from src/esphome/components/wmbus/wmbus.cpp:13:
.piolibdeps/dommm/ESPAsyncWebServer-esphome/src/ESPAsyncWebServer.h:280:68: warning: 'warning_x' attribute directive ignored [-Wattributes]
     const String& ASYNCWEBSERVER_REGEX_ATTRIBUTE pathArg(size_t i) const;
                                                                    ^~~~~
Compiling .pioenvs/dommm/src/esphome/core/log.cpp.o
src/esphome/components/wmbus/wmbus.cpp:18:48: note: #pragma message: Loop task stack increased.
 #pragma message ( "Loop task stack increased." )
                                                ^
src/esphome/components/wmbus/wmbus.cpp: In member function 'virtual void esphome::wmbus::WMBusComponent::loop()':
src/esphome/components/wmbus/wmbus.cpp:145:42: error: 'class esphome::sensor::Sensor' has no member named 'get_unit_of_measurement_ref'; did you mean 'get_unit_of_measurement'?
                   else if (field.second->get_unit_of_measurement_ref().empty()) {
                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                          get_unit_of_measurement
src/esphome/components/wmbus/wmbus.cpp:149:60: error: 'class esphome::sensor::Sensor' has no member named 'get_unit_of_measurement_ref'; did you mean 'get_unit_of_measurement'?
                     Unit field_unit = toUnit(field.second->get_unit_of_measurement_ref());
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                            get_unit_of_measurement
Compiling .pioenvs/dommm/src/esphome/core/ring_buffer.cpp.o
src/esphome/components/wmbus/wmbus.cpp: In member function 'void esphome::wmbus::WMBusComponent::send_to_clients(esphome::wmbus::WMbusFrame&)':
src/esphome/components/wmbus/wmbus.cpp:314:40: error: 'IP_ADDRESS_BUFFER_SIZE' is not a member of 'esphome::network'
                   char ip_buf[network::IP_ADDRESS_BUFFER_SIZE];
                                        ^~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:316:59: error: 'struct esphome::network::IPAddress' has no member named 'str_to'; did you mean 'str'?
                   if (this->tcp_client_.connect(client.ip.str_to(ip_buf), client.port)) {
                                                           ^~~~~~
                                                           str
src/esphome/components/wmbus/wmbus.cpp:316:66: error: 'ip_buf' was not declared in this scope
                   if (this->tcp_client_.connect(client.ip.str_to(ip_buf), client.port)) {
                                                                  ^~~~~~
src/esphome/components/wmbus/wmbus.cpp:316:66: note: suggested alternative: 'pbuf'
                   if (this->tcp_client_.connect(client.ip.str_to(ip_buf), client.port)) {
                                                                  ^~~~~~
                                                                  pbuf
In file included from src/esphome/components/wmbus/wmbus.h:3,
                 from src/esphome/components/wmbus/wmbus.cpp:1:
src/esphome/components/wmbus/wmbus.cpp:321:79: error: 'struct esphome::network::IPAddress' has no member named 'str_to'; did you mean 'str'?
                     ESP_LOGE(TAG, "Can't connect via TCP to %s:%d", client.ip.str_to(ip_buf), client.port);
                                                                               ^~~~~~
src/esphome/core/log.h:130:100: note: in definition of macro 'esph_log_e'
   ::esphome::esp_log_printf_(ESPHOME_LOG_LEVEL_ERROR, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                                    ^~~~~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:321:21: note: in expansion of macro 'ESP_LOGE'
                     ESP_LOGE(TAG, "Can't connect via TCP to %s:%d", client.ip.str_to(ip_buf), client.port);
                     ^~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:327:40: error: 'IP_ADDRESS_BUFFER_SIZE' is not a member of 'esphome::network'
                   char ip_buf[network::IP_ADDRESS_BUFFER_SIZE];
                                        ^~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:329:59: error: 'struct esphome::network::IPAddress' has no member named 'str_to'; did you mean 'str'?
                   this->udp_client_.beginPacket(client.ip.str_to(ip_buf), client.port);
                                                           ^~~~~~
                                                           str
src/esphome/components/wmbus/wmbus.cpp:329:66: error: 'ip_buf' was not declared in this scope
                   this->udp_client_.beginPacket(client.ip.str_to(ip_buf), client.port);
                                                                  ^~~~~~
src/esphome/components/wmbus/wmbus.cpp:329:66: note: suggested alternative: 'pbuf'
                   this->udp_client_.beginPacket(client.ip.str_to(ip_buf), client.port);
                                                                  ^~~~~~
                                                                  pbuf
src/esphome/components/wmbus/wmbus.cpp:347:40: error: 'IP_ADDRESS_BUFFER_SIZE' is not a member of 'esphome::network'
                   char ip_buf[network::IP_ADDRESS_BUFFER_SIZE];
                                        ^~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:349:59: error: 'struct esphome::network::IPAddress' has no member named 'str_to'; did you mean 'str'?
                   if (this->tcp_client_.connect(client.ip.str_to(ip_buf), client.port)) {
                                                           ^~~~~~
                                                           str
src/esphome/components/wmbus/wmbus.cpp:349:66: error: 'ip_buf' was not declared in this scope
                   if (this->tcp_client_.connect(client.ip.str_to(ip_buf), client.port)) {
                                                                  ^~~~~~
src/esphome/components/wmbus/wmbus.cpp:349:66: note: suggested alternative: 'pbuf'
                   if (this->tcp_client_.connect(client.ip.str_to(ip_buf), client.port)) {
                                                                  ^~~~~~
                                                                  pbuf
In file included from src/esphome/components/wmbus/wmbus.h:3,
                 from src/esphome/components/wmbus/wmbus.cpp:1:
src/esphome/components/wmbus/wmbus.cpp:361:79: error: 'struct esphome::network::IPAddress' has no member named 'str_to'; did you mean 'str'?
                     ESP_LOGE(TAG, "Can't connect via TCP to %s:%d", client.ip.str_to(ip_buf), client.port);
                                                                               ^~~~~~
src/esphome/core/log.h:130:100: note: in definition of macro 'esph_log_e'
   ::esphome::esp_log_printf_(ESPHOME_LOG_LEVEL_ERROR, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                                    ^~~~~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:361:21: note: in expansion of macro 'ESP_LOGE'
                     ESP_LOGE(TAG, "Can't connect via TCP to %s:%d", client.ip.str_to(ip_buf), client.port);
                     ^~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:367:40: error: 'IP_ADDRESS_BUFFER_SIZE' is not a member of 'esphome::network'
                   char ip_buf[network::IP_ADDRESS_BUFFER_SIZE];
                                        ^~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:369:59: error: 'struct esphome::network::IPAddress' has no member named 'str_to'; did you mean 'str'?
                   this->udp_client_.beginPacket(client.ip.str_to(ip_buf), client.port);
                                                           ^~~~~~
                                                           str
src/esphome/components/wmbus/wmbus.cpp:369:66: error: 'ip_buf' was not declared in this scope
                   this->udp_client_.beginPacket(client.ip.str_to(ip_buf), client.port);
                                                                  ^~~~~~
src/esphome/components/wmbus/wmbus.cpp:369:66: note: suggested alternative: 'pbuf'
                   this->udp_client_.beginPacket(client.ip.str_to(ip_buf), client.port);
                                                                  ^~~~~~
                                                                  pbuf
src/esphome/components/wmbus/wmbus.cpp: In member function 'virtual void esphome::wmbus::WMBusComponent::dump_config()':
src/esphome/components/wmbus/wmbus.cpp:421:30: error: 'IP_ADDRESS_BUFFER_SIZE' is not a member of 'esphome::network'
         char ip_buf[network::IP_ADDRESS_BUFFER_SIZE];
                              ^~~~~~~~~~~~~~~~~~~~~~
In file included from src/esphome/components/wmbus/wmbus.h:3,
                 from src/esphome/components/wmbus/wmbus.cpp:1:
src/esphome/components/wmbus/wmbus.cpp:424:33: error: 'struct esphome::network::IPAddress' has no member named 'str_to'; did you mean 'str'?
                       client.ip.str_to(ip_buf),
                                 ^~~~~~
src/esphome/core/log.h:101:101: note: in definition of macro 'esph_log_config'
   ::esphome::esp_log_printf_(ESPHOME_LOG_LEVEL_CONFIG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                                     ^~~~~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:422:9: note: in expansion of macro 'ESP_LOGCONFIG'
         ESP_LOGCONFIG(TAG, "    %s: %s:%d %s [%s]",
         ^~~~~~~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:424:40: error: 'ip_buf' was not declared in this scope
                       client.ip.str_to(ip_buf),
                                        ^~~~~~
src/esphome/core/log.h:101:101: note: in definition of macro 'esph_log_config'
   ::esphome::esp_log_printf_(ESPHOME_LOG_LEVEL_CONFIG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                                     ^~~~~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:422:9: note: in expansion of macro 'ESP_LOGCONFIG'
         ESP_LOGCONFIG(TAG, "    %s: %s:%d %s [%s]",
         ^~~~~~~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:424:40: note: suggested alternative: 'pbuf'
                       client.ip.str_to(ip_buf),
                                        ^~~~~~
src/esphome/core/log.h:101:101: note: in definition of macro 'esph_log_config'
   ::esphome::esp_log_printf_(ESPHOME_LOG_LEVEL_CONFIG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                                     ^~~~~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:422:9: note: in expansion of macro 'ESP_LOGCONFIG'
         ESP_LOGCONFIG(TAG, "    %s: %s:%d %s [%s]",
         ^~~~~~~~~~~~~
*** [.pioenvs/dommm/src/esphome/components/wmbus/wmbus.cpp.o] Error 1
========================== [FAILED] Took 4.00 seconds ==========================

TO co wkleiłeś wyżej nie jest w formacie YAML.

Jak prawidłowo zamieszczać YAML, inny kod lub logi w postach na forum

juz poprawione, zły znacznik dodałem

Dzięki @angler i @Allon za sugestię.
Nie zwróciłem uwagi, że źle się sformatowało przy wklejaniu (najpierw wkleiłem,a potem wybrałem kodowanie).
Zmieniłem all_drivers: false oraz type: qualcosoni. Na efekty poczekam do jutra bo po południ te liczniki nadaja bardzo rzadko.

esphome:
  name: esp32-wroom
  friendly_name: ESP32_WROOM

esp32:
  board: esp32dev
  framework:
    type: arduino
  #flash_size: 4MB
  partitions: custom_partitions.csv

external_components:
  - source: github://SzczepanLeon/esphome-components@version_4
    refresh: 0d
    components: [ wmbus ] 
    
# Enable logging
logger:
  id: component_logger
  level: DEBUG
# Enable Home Assistant API
api:
  encryption:
    key: "X1q5zqdlERc301sdsda2edz891mMl62NxCZ48s="

ota:
  - platform: esphome
    password: "5f66571df7bdsd656808cd7e9b15fb88"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32-Wroom Fallback Hotspot"
    password: "GdjhgrCCAS9N"

captive_portal:

mqtt:
  broker: 192.168.0.111
  port: 1883
  username: esp
  password: !secret mqtt_password   
  

time:
  - platform: sntp
    id: time_sntp  

wmbus:
  mosi_pin: GPIO23
  miso_pin: GPIO19
  clk_pin:  GPIO18
  cs_pin:   GPIO15
  gdo0_pin: GPIO21
  gdo2_pin: GPIO22
  log_all: true
  sync_mode: False
  all_drivers: false
  

sensor:

 - platform: wmbus
   meter_id: 0x04018481
   type: qualcosonic
   key: ""
   sensors:
    - name: "total_heat_energy_kwh"
      field: "total_heat_energy_kwh"
      unit_of_measurement: "MJ"
		
    - name: "total_cooling_energy_kwh"
      field: "total_cooling_energy_kwh"
      unit_of_measurement: "kwh"
		
    - name: "total_m3"
      field: "total_m3"
      unit_of_measurement: "m3"

Niestety po dodaniu powyższego kodu jest cisza w eterze.

Jak zrobiłem testowo coś takiego jak poniżej to widać tylko Received T1 A frame


sensor:

  - platform: wmbus

    type: qualcosonic

Próbowałem zrobić też logger na poziomie verbose, ale wtedy moje urządzenie umiera. Ciągle się restartuje.

W chwili obecnej wygląda to tak, że jeśli zrobię sensor bez ID, czyli w ten sposób:

sensor:
  - platform: wmbus
    #type: qualcosonic
    #meter_id: 0x04018481
    sensors:
      - name: "total_heat_energy_kwh"
        field: "total_heat_energy"
        unit_of_measurement: "kwh"
      - name: "total_m3"
        field: "total_m3"
        unit_of_measurement: "m3"     

To widzę ramki latające dla mojego licznika rozpoznane jako qualcosonic z prawidłowym meter_id:

[12:41:07.379][I][wmbus:100]: qualcosonic [0x04018481] RSSI: -61dBm T: 59440907818401040C0D7A62000000046D1E0D4433048E3B1A700000048E3C000000000413F04F06000C788184010484086D3B175C3284088E3BC86F000084088E3C00000000446D3B173F3C448E3B7A5B0000448E3C00000000 (90) T1 A`
`[12:47:16.379][I][wmbus:100]: qualcosonic [0x04018481] RSSI: -61dBm T: 59440907818401040C0D7A68000000046D240D4433048E3B1A700000048E3C000000000413F14F06000C788184010484086D3B175C3284088E3BC86F000084088E3C00000000446D3B173F3C448E3B7A5B0000448E3C00000000 (90) T1 A`
`[12:50:25.773][I][wmbus:100]: qualcosonic [0x04018481] RSSI: -60dBm T: 7D440907818401040C0D7A6B000000046D280D4433048E3B1A700000048E3C000000000413F24F06000C788184010484086D3B175C32820859E11682085D830E84082450EBEB0484088E3BC86F000084088E3C00000000840813B94706008408BE5800000000027FE355446D3B173F3C448E3B7A5B0000448E3C00000000 (126) T1 A`
`[14:05:25.954][I][wmbus:100]: qualcosonic [0x04018481] RSSI: -61dBm T: 69440907818401040C0D7AB4000000046D370E4433048E3B1D700000048E3C000000000413215006000C788184010484086D3B175C3284088E3BC86F000084088E3C00000000446D3B173F3C4424CC229E04448E3B7A5B0000448E3C000000004413915E0500027F3876 (106) T1 A

Wygląda to na problem w dekodowaniu. Niestety nie mam pojecia co można z tym zrobić. Czy czasami nie jest tak, że biblioteka qualcosonic nie obsługuje licznika E4 tylko E3 ?

Chyba wiem w czym jest problem. Driver qualcosonic nie obsługuje ramek T1:

[08:06:58.621][I][wmbus:094]: Using selected driver qualcosonic (detected driver was qualcosonic)
[08:06:58.632][I][wmbus:100]: qualcosonic [0x04018481] RSSI: -53dBm T: 59440907818401040C0D7A65000000046D38084533048E3B43700000048E3C000000000413215406000C788184010484086D3B175C3284088E3BC86F000084088E3C00000000446D3B173F3C448E3B7A5B0000448E3C00000000 (90) T1 A
[08:06:58.636][W][wmbus:124]: Link mode T1 not supported in driver qualcosonic

Czy jest na to jakiś sposób ?

Masz dwa sposoby :

  1. Poczekać aż się samo zrobi ( tu polecam cierpliwość ).
  2. Zgłosić issue na Wmbusmeters aby dodali driver i wtedy patrz pkt.1

Tylko jak widzę to nowsza wersja webmastera wspiera to. Jest jakaś możliwość wymuszenia dekodowania za pomocą nowszej wersji ?

Dopóki autor komponentu tego nie zrobi to nie masz opcji lub kupujesz jako opcja inną płytkę opartą na SX1276

Cześć,

Mam u siebie straszny problem z wersją4 bo przy dekodowaniu ramki restartuje mi ESP. Próbowałem zwiększyć poziom bufora i wyciszac watchdoga i niestety nie bangla.

Licznik APATOR OTUS 3, radio CC1101

esphome:
name: energy-meter
friendly_name: Energy Meter
on_boot:
priority: 800
then:

lambda: |-
disableCore0WDT(); // Wyłącza strażnika na rdzeniu obsługującym WiFi/system
disableCore1WDT(); // Wyłącza strażnika na rdzeniu obsługującym kod (wmbus)
esp32:
board: esp32dev
framework:
type: arduino

logger:
level: DEBUG
logs:
api: ERROR
wifi: ERROR
sensor: ERROR
esp32_ble: ERROR
api:
reboot_timeout: 0s

web_server:
port: 80
version: 3

ota:

platform: esphome
password: !secret ota_password

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
use_address: !secret ip_esp
ap: {}

captive_portal:

time:

platform: sntp
id: time_sntp

external_components:

source:
type: git
url: 

ref: version_4
components: [ wmbus ]

wmbus:
mosi_pin: GPIO23
miso_pin: GPIO19
clk_pin: GPIO18
cs_pin: GPIO5
gdo0_pin: GPIO4
gdo2_pin: GPIO21

sync_mode: True
log_all: False
all_drivers: False
frequency: 868.950

sensor:

platform: uptime
name: “ESP Uptime”
update_interval: 60s

platform: wmbus
meter_id: !secret wmbus_meter_id
type: amiplus
key: !secret wmbus_key
sensors:

name: “OTUS Moc Chwilowa Pobrana”
field: “current_power_consumption”
accuracy_decimals: 1
unit_of_measurement: “W”
device_class: “power”
state_class: “measurement”
icon: “mdi:transmission-tower-import”
on_value:
then:

text_sensor.template.publish:
id: otus_timestamp
state: !lambda ‘return id(time_sntp).now().strftime(“%H:%M:%S (%d.%m.%Y)”);’

name: “OTUS Energia Pobrana Całkowita”
field: “total_energy_consumption”
accuracy_decimals: 3
unit_of_measurement: “kWh”
device_class: “energy”
state_class: “total_increasing”
icon: “mdi:transmission-tower-import”

name: “OTUS Energia Pobrana Taryfa 1”
field: “total_energy_consumption_tariff_1”
accuracy_decimals: 3
unit_of_measurement: “kWh”
device_class: “energy”
state_class: “total_increasing”

name: “OTUS Energia Pobrana Taryfa 2”
field: “total_energy_consumption_tariff_2”
accuracy_decimals: 3
unit_of_measurement: “kWh”
device_class: “energy”
state_class: “total_increasing”

name: “OTUS Energia Oddana Całkowita”
field: “total_energy_production”
accuracy_decimals: 3
unit_of_measurement: “kWh”
device_class: “energy”
state_class: “total_increasing”
icon: “mdi:transmission-tower-export”

name: “OTUS Moc Chwilowa Oddana”
field: “current_power_production”
accuracy_decimals: 1
unit_of_measurement: “W”
device_class: “power”
state_class: “measurement”

name: “OTUS RSSI”
field: “rssi”
unit_of_measurement: “dBm”
state_class: “measurement”
icon: “mdi:signal-variant”

text_sensor:

platform: template
id: otus_timestamp
name: “OTUS Ostatni Odczyt”
icon: “mdi:clock-check-outline”


To czemu piszesz w temacie dotyczącym wersji 3.x komponentu?

To czemu używasz zasobożernego poziomu logera debug?

@barycz
To tu jeszcze dorzucę pytanie czemu wkleiłeś to, co kiedyś było YAMLem jako cytowanie, a nie jako kod? - dzięki czemu to już nie jest żaden YAML…

W związku z tym, że to v4 przenoszę do właściwego wątku (i prosimy wszystkich użytkowników - przestrzegajcie podstawowych reguł porządku na forum….)

@Piotr_zet1 Jesteś mistrz :slight_smile:

Dzięki twojemu postowi udało mi się wreszcie uruchomić odczyt z liczników, męczyłem się z tym już kilka dni. Ale w końcu działa na tyle ile mi potrzeba.

Dla innych potrzebujących podaję dane:

ESP32 to moduł DI/DO firmy Waveshare ESP32-S3-POE-ETH-8DI-8DO

radio CC1101 podłączone pod “wolne” GPIO.

Kod YAML:

esphome:
  name: testboard
  friendly_name: testboard
  on_boot:
    then:
      - pcf85063.read_time:
          id: pcf85063_time

esp32:
  board: esp32-s3-devkitc-1
  variant: esp32s3
  flash_size: 16MB
  framework:
    type: esp-idf


# Enable logging
logger:
  level: INFO



# Enable Home Assistant API
api:
  encryption:
    key: "IKF9+rDP0hithsbwqnO2ncZ2ZHo1FMGUnPD0l3wOABU="

ota:
  - platform: esphome
    password: "41fde50f3d877f29bacc64206b9b7c05"
    

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

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


# Enable Web server.
web_server:
  port: 80

#captive_portal:

# I2C
i2c:
  sda: GPIO42
  scl: GPIO41
  frequency: 100kHz
  id: i2cbus
  scan: false

# ETHERNET
ethernet:
  type: W5500
  clk_pin: GPIO15
  mosi_pin: GPIO13
  miso_pin: GPIO14
  cs_pin: GPIO16
  interrupt_pin: GPIO12
  reset_pin: GPIO39

# RS485
uart:
 - id: UART_RS485
   tx_pin: GPIO17
   rx_pin: GPIO18
   baud_rate: 9600
   stop_bits: 1
   data_bits: 8
   parity: NONE

# ModBus RTU
modbus:
  id: modbus_hub
  uart_id: UART_RS485

modbus_controller:
  - id: VCX1
    modbus_id: modbus_hub
    address: 1
    update_interval: 15s

  - id: VCX2
    modbus_id: modbus_hub
    address: 2
    update_interval: 15s

  - id: VCX3
    modbus_id: modbus_hub
    address: 3
    update_interval: 15s

  - id: VCX4
    modbus_id: modbus_hub
    address: 4
    update_interval: 15s

# TIME
time:
  - platform: homeassistant
    id: ha_time
    on_time_sync:
      then:
        # Update the RTC when the synchronization was successful
        - pcf85063.write_time:
  - platform: pcf85063
    id: pcf85063_time

# WMBUS - COMPONENT
external_components:
  - source: github://SzczepanLeon/esphome-components@main
    refresh: 1d
    components:
      - wmbus_meter
      - wmbus_common
  - source: github://enr0c/esphome-components@main
    components: [ wmbus_radio ]
    refresh: 1d

# SPI
spi:
  - id: radio
    clk_pin: GPIO1 #GPIO5
    mosi_pin:
        number: GPIO45 #GPIO4
        ignore_strapping_warning: true
    miso_pin: GPIO47 #GPIO7
    interface: spi3

# WMBUS RADIO
wmbus_radio:
  spi_id: radio
  radio_type: CC1101
  frequency: 868.950

  gdo2_pin: GPIO48 #GPIO6
  gdo0_pin: GPIO38 #GPIO8
  cs_pin:
    number: GPIO0 #GPIO3
    ignore_strapping_warning: true
  
# WMBUS METERS
wmbus_meter:
  - id: water_meter_1
    meter_id: 0x01964733  ######## enter your APATOR meter ID here ###########
    type: apator162
    key: "00000000000000000000000000000000"

  - id: water_meter_2
    meter_id: 0x01933725  ######## enter your APATOR meter ID here ###########
    type: apator162
    key: "00000000000000000000000000000000"

  - id: water_meter_3
    meter_id: 0x01960220  ######## enter your APATOR meter ID here ###########
    type: apator162
    key: "00000000000000000000000000000000"

  - id: water_meter_4
    meter_id: 0x01939505  ######## enter your APATOR meter ID here ###########
    type: apator162
    key: "00000000000000000000000000000000"

  - id: water_meter_5
    meter_id: 0x01933190  ######## enter your APATOR meter ID here ###########
    type: apator162
    key: "00000000000000000000000000000000"

  - id: water_meter_6
    meter_id: 0x01935014  ######## enter your APATOR meter ID here ###########
    type: apator162
    key: "00000000000000000000000000000000"

# SENSORS
sensor:

## Wodomierze
  - platform: wmbus_meter
    parent_id: water_meter_1 #Water meter Apator
    field: total_m3
    device_class: water
    name: Wodomierz zimna 1 zużycie 
    accuracy_decimals: 3
    state_class: total_increasing
    unit_of_measurement: "m³"
  - platform: wmbus_meter
    parent_id: water_meter_1
    field: rssi_dbm
    name: Wodomierz zimna 1 - RSSI
    unit_of_measurement: "dBm"

  - platform: wmbus_meter
    parent_id: water_meter_2 #Water meter Apator
    field: total_m3
    device_class: water
    name: Wodomierz zimna 2 zużycie
    accuracy_decimals: 3
    state_class: total_increasing
    unit_of_measurement: "m³"
  - platform: wmbus_meter
    parent_id: water_meter_2
    field: rssi_dbm
    name: Wodomierz zimna 2 - RSSI
    unit_of_measurement: "dBm"

  - platform: wmbus_meter
    parent_id: water_meter_3 #Water meter Apator
    field: total_m3
    device_class: water
    name: Wodomierz zimna 3 zużycie
    accuracy_decimals: 3
    state_class: total_increasing
    unit_of_measurement: "m³"
  - platform: wmbus_meter
    parent_id: water_meter_3
    field: rssi_dbm
    name: Wodomierz zimna 3 - RSSI
    unit_of_measurement: "dBm"

  - platform: wmbus_meter
    parent_id: water_meter_4 #Water meter Apator
    field: total_m3
    device_class: water
    name: Wodomierz ciepła 1 zużycie 
    accuracy_decimals: 3
    state_class: total_increasing
    unit_of_measurement: "m³"
  - platform: wmbus_meter
    parent_id: water_meter_4
    field: rssi_dbm
    name: Wodomierz ciepła 1 - RSSI
    unit_of_measurement: "dBm"

  - platform: wmbus_meter
    parent_id: water_meter_5 #Water meter Apator
    field: total_m3
    device_class: water
    name: Wodomierz ciepła 2 zużycie
    accuracy_decimals: 3
    state_class: total_increasing
    unit_of_measurement: "m³"
  - platform: wmbus_meter
    parent_id: water_meter_5
    field: rssi_dbm
    name: Wodomierz ciepła 2 - RSSI
    unit_of_measurement: "dBm"

  - platform: wmbus_meter
    parent_id: water_meter_6 #Water meter Apator
    field: total_m3
    device_class: water
    name: Wodomierz ciepła 3 zużycie
    accuracy_decimals: 3
    state_class: total_increasing
    unit_of_measurement: "m³"
  - platform: wmbus_meter
    parent_id: water_meter_6
    field: rssi_dbm
    name: Wodomierz ciepła 3 - RSSI
    unit_of_measurement: "dBm"

## Liczniki energii

  # ============================================================
  # LICZNIK 1 - MIESZKANIE 1 (id: VCX1)
  # ============================================================
  - platform: modbus_controller
    modbus_controller_id: VCX1
    name: "Mieszkanie 1 Napięcie L1"
    address: 0x0000
    register_type: holding
    value_type: FP32
    unit_of_measurement: "V"
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: VCX1
    name: "Mieszkanie 1 Napięcie L2"
    address: 0x0002
    register_type: holding
    value_type: FP32
    unit_of_measurement: "V"
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: VCX1
    name: "Mieszkanie 1 Napięcie L3"
    address: 0x0004
    register_type: holding
    value_type: FP32
    unit_of_measurement: "V"
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: VCX1
    name: "Mieszkanie 1 Prąd L1"
    address: 0x0008
    register_type: holding
    value_type: FP32
    unit_of_measurement: "A"
    accuracy_decimals: 2

  - platform: modbus_controller
    modbus_controller_id: VCX1
    name: "Mieszkanie 1 Prąd L2"
    address: 0x000A
    register_type: holding
    value_type: FP32
    unit_of_measurement: "A"
    accuracy_decimals: 2

  - platform: modbus_controller
    modbus_controller_id: VCX1
    name: "Mieszkanie 1 Prąd L3"
    address: 0x000C
    register_type: holding
    value_type: FP32
    unit_of_measurement: "A"
    accuracy_decimals: 2

  - platform: modbus_controller
    modbus_controller_id: VCX1
    name: "Mieszkanie 1 Moc L1"
    address: 0x0012
    register_type: holding
    value_type: FP32
    unit_of_measurement: "W"
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: VCX1
    name: "Mieszkanie 1 Moc L2"
    address: 0x0014
    register_type: holding
    value_type: FP32
    unit_of_measurement: "W"
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: VCX1
    name: "Mieszkanie 1 Moc L3"
    address: 0x0016
    register_type: holding
    value_type: FP32
    unit_of_measurement: "W"
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: VCX1
    name: "Mieszkanie 1 Zużycie Całkowite"
    address: 0x0100
    register_type: holding
    value_type: FP32
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: total_increasing
    accuracy_decimals: 2

  # ============================================================
  # LICZNIK 2 (id: VCX2)
  # ============================================================
  - platform: modbus_controller
    modbus_controller_id: VCX2
    name: "Licznik 2 Napięcie L1"
    address: 0x0000
    register_type: holding
    value_type: FP32
    unit_of_measurement: "V"
  - platform: modbus_controller
    modbus_controller_id: VCX2
    name: "Licznik 2 Napięcie L2"
    address: 0x0002
    register_type: holding
    value_type: FP32
    unit_of_measurement: "V"
  - platform: modbus_controller
    modbus_controller_id: VCX2
    name: "Licznik 2 Napięcie L3"
    address: 0x0004
    register_type: holding
    value_type: FP32
    unit_of_measurement: "V"
  - platform: modbus_controller
    modbus_controller_id: VCX2
    name: "Licznik 2 Prąd L1"
    address: 0x0008
    register_type: holding
    value_type: FP32
    unit_of_measurement: "A"
  - platform: modbus_controller
    modbus_controller_id: VCX2
    name: "Licznik 2 Prąd L2"
    address: 0x000A
    register_type: holding
    value_type: FP32
    unit_of_measurement: "A"
  - platform: modbus_controller
    modbus_controller_id: VCX2
    name: "Licznik 2 Prąd L3"
    address: 0x000C
    register_type: holding
    value_type: FP32
    unit_of_measurement: "A"
  - platform: modbus_controller
    modbus_controller_id: VCX2
    name: "Licznik 2 Zużycie Całkowite"
    address: 0x0100
    register_type: holding
    value_type: FP32
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: total_increasing

  # ============================================================
  # LICZNIK 3 (id: VCX3)
  # ============================================================
  - platform: modbus_controller
    modbus_controller_id: VCX3
    name: "Licznik 3 Napięcie L1"
    address: 0x0000
    register_type: holding
    value_type: FP32
    unit_of_measurement: "V"
  - platform: modbus_controller
    modbus_controller_id: VCX3
    name: "Licznik 3 Napięcie L2"
    address: 0x0002
    register_type: holding
    value_type: FP32
    unit_of_measurement: "V"
  - platform: modbus_controller
    modbus_controller_id: VCX3
    name: "Licznik 3 Napięcie L3"
    address: 0x0004
    register_type: holding
    value_type: FP32
    unit_of_measurement: "V"
  - platform: modbus_controller
    modbus_controller_id: VCX3
    name: "Licznik 3 Prąd L1"
    address: 0x0008
    register_type: holding
    value_type: FP32
    unit_of_measurement: "A"
  - platform: modbus_controller
    modbus_controller_id: VCX3
    name: "Licznik 3 Prąd L2"
    address: 0x000A
    register_type: holding
    value_type: FP32
    unit_of_measurement: "A"
  - platform: modbus_controller
    modbus_controller_id: VCX3
    name: "Licznik 3 Prąd L3"
    address: 0x000C
    register_type: holding
    value_type: FP32
    unit_of_measurement: "A"
  - platform: modbus_controller
    modbus_controller_id: VCX3
    name: "Licznik 3 Zużycie Całkowite"
    address: 0x0100
    register_type: holding
    value_type: FP32
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: total_increasing

  # ============================================================
  # LICZNIK 4 - POMPA CIEPŁA (id: VCX4)
  # ============================================================
  - platform: modbus_controller
    modbus_controller_id: VCX4
    name: "Pompa Ciepła Napięcie L1"
    address: 0x0000
    register_type: holding
    value_type: FP32
    unit_of_measurement: "V"
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: VCX4
    name: "Pompa Ciepła Napięcie L2"
    address: 0x0002
    register_type: holding
    value_type: FP32
    unit_of_measurement: "V"
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: VCX4
    name: "Pompa Ciepła Napięcie L3"
    address: 0x0004
    register_type: holding
    value_type: FP32
    unit_of_measurement: "V"
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: VCX4
    name: "Pompa Ciepła Prąd L1"
    address: 0x0008
    register_type: holding
    value_type: FP32
    unit_of_measurement: "A"
    accuracy_decimals: 2

  - platform: modbus_controller
    modbus_controller_id: VCX4
    name: "Pompa Ciepła Prąd L2"
    address: 0x000A
    register_type: holding
    value_type: FP32
    unit_of_measurement: "A"
    accuracy_decimals: 2

  - platform: modbus_controller
    modbus_controller_id: VCX4
    name: "Pompa Ciepła Prąd L3"
    address: 0x000C
    register_type: holding
    value_type: FP32
    unit_of_measurement: "A"
    accuracy_decimals: 2

  - platform: modbus_controller
    modbus_controller_id: VCX4
    name: "Pompa Ciepła Moc L1"
    address: 0x0012
    register_type: holding
    value_type: FP32
    unit_of_measurement: "W"
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: VCX4
    name: "Pompa Ciepła Moc L2"
    address: 0x0014
    register_type: holding
    value_type: FP32
    unit_of_measurement: "W"
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: VCX4
    name: "Pompa Ciepła Moc L3"
    address: 0x0016
    register_type: holding
    value_type: FP32
    unit_of_measurement: "W"
    accuracy_decimals: 1

  - platform: modbus_controller
    modbus_controller_id: VCX4
    name: "Pompa Ciepła Zużycie Całkowite"
    address: 0x0100
    register_type: holding
    value_type: FP32
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: total_increasing
    accuracy_decimals: 2

Jeśli się komuś to przyda to super, powodzenia z tą nierówną walką :sweat_smile:
Ten ESP32-S3 mnie wykończył, już miałem w koszyku zakupowym 3 szt zwykłego ESP32.

Dodam że na na zwykłym ESP32 i CC1101 mam odczyt dla licznika izar, i z wersją wmbus 4 działa bez problemu. Co prawda miałem mały problem przez to że podawałem klucz “KEY: “00000……”, a okazało się że jak zakomentowałem tą linijkę z kluczem, to odczyty ruszyły :grin: .

1 polubienie

wybacz to mój pierwszy komentarz na tym forum i średnio jeszcze ogarniam :smiley:

btw. @szopen Czy jest już wątek na V5 bo własnie mi przyszedł zwykły moduł SX1276 i mam kilka pytań, a widze że Szczepan robił repo pod helteca lub LilyGO :smiley:
To wrzucam teraz yamla:

esphome:
  name: energy-meter
  friendly_name: Energy Meter
  on_boot:
    priority: 800
    then:
      - lambda: |-
          disableCore0WDT(); // Wyłącza strażnika na rdzeniu obsługującym WiFi/system
          disableCore1WDT(); // Wyłącza strażnika na rdzeniu obsługującym kod (wmbus)
esp32:
  board: esp32dev
  framework:
    type: arduino

logger:
  level: DEBUG
  logs:
    api: ERROR
    wifi: ERROR
    sensor: ERROR
    esp32_ble: ERROR
api:
 reboot_timeout: 0s
  
web_server:
  port: 80
  version: 3

ota:
  - platform: esphome
    password: !secret ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_address: 10.20.0.218
  ap: {}

captive_portal:

time:
  - platform: sntp
    id: time_sntp

external_components:
  - source:
      type: git
      url: https://github.com/SzczepanLeon/esphome-components
      ref: version_4
    components: [ wmbus ]

wmbus:
  mosi_pin: GPIO23
  miso_pin: GPIO19
  clk_pin: GPIO18
  cs_pin: GPIO5
  gdo0_pin: GPIO4
  gdo2_pin: GPIO21
  
  sync_mode: True
  log_all: False
  all_drivers: False
  frequency: 868.950

sensor:
  - platform: uptime
    name: "ESP Uptime"
    update_interval: 60s

  - platform: wmbus
    meter_id: !secret wmbus_meter_id
    type: amiplus
    key: !secret wmbus_key    
    sensors:
      - name: "OTUS Moc Chwilowa Pobrana"
        field: "current_power_consumption"
        accuracy_decimals: 1
        unit_of_measurement: "W"
        device_class: "power"
        state_class: "measurement"
        icon: "mdi:transmission-tower-import"
        on_value:
          then:
            - text_sensor.template.publish:
                id: otus_timestamp
                state: !lambda 'return id(time_sntp).now().strftime("%H:%M:%S (%d.%m.%Y)");'

      - name: "OTUS Energia Pobrana Całkowita"
        field: "total_energy_consumption"
        accuracy_decimals: 3
        unit_of_measurement: "kWh"
        device_class: "energy"
        state_class: "total_increasing"
        icon: "mdi:transmission-tower-import"

      - name: "OTUS Energia Pobrana Taryfa 1"
        field: "total_energy_consumption_tariff_1"
        accuracy_decimals: 3
        unit_of_measurement: "kWh"
        device_class: "energy"
        state_class: "total_increasing"

      - name: "OTUS Energia Pobrana Taryfa 2"
        field: "total_energy_consumption_tariff_2"
        accuracy_decimals: 3
        unit_of_measurement: "kWh"
        device_class: "energy"
        state_class: "total_increasing"

      - name: "OTUS Energia Oddana Całkowita"
        field: "total_energy_production"
        accuracy_decimals: 3
        unit_of_measurement: "kWh"
        device_class: "energy"
        state_class: "total_increasing"
        icon: "mdi:transmission-tower-export"

      - name: "OTUS Moc Chwilowa Oddana"
        field: "current_power_production"
        accuracy_decimals: 1
        unit_of_measurement: "W"
        device_class: "power"
        state_class: "measurement"

      - name: "OTUS RSSI"
        field: "rssi" 
        unit_of_measurement: "dBm"
        state_class: "measurement"
        icon: "mdi:signal-variant"

text_sensor:
  - platform: template
    id: otus_timestamp
    name: "OTUS Ostatni Odczyt"
    icon: "mdi:clock-check-outline"


Komponent wM-Bus do ESPHome wersja 5.x - wątek ogólny

2 posty zostały scalone z istniejącym tematem: Komponent wM-Bus do ESPHome (SzczepanLeon) wersja 2.x - wątek ogólny