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

@Mariusz_Woszczyński Wszystko jest możliwe. Ale tak samo jak w v3 wymaga przepisania/dopisania kodu. Niestety obecnie mam zerową motywację do tego. Tak jak pisałem kiedyś - to co mnie interesowało juz dawno działa, na resztę za friko nie mam czasu.

Priorytetem z mojej strony by mogło być dodanie najnowszego mechanizmu driverow z wmbusmetersa.

1 Like

Dzień dobry

walczę ostatnio z odczytem z licznika i jakoś cos mi nie wychodzi proszę zobaczcie bo ja już nie wiem co robię źle… z góry dzięki za pomoc

INFO ESPHome 2024.9.2
INFO Reading configuration /config/esphome/esphome-web-191d42.yaml...
INFO Detected timezone 'Europe/Warsaw'
WARNING GPIO5 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 Generating C++ source...
INFO Compiling app...
Processing nodemcu-wmbus (board: nodemcu-32s; 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.2.2
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- ArduinoJson @ 6.18.5
|-- PubSubClient @ 2.8.0
|-- SPI @ 2.0.0
|-- SmartRC-CC1101-Driver-Lib @ 2.5.7
Compiling .pioenvs/nodemcu-wmbus/src/main.cpp.o
Linking .pioenvs/nodemcu-wmbus/firmware.elf
RAM:   [=         ]  13.9% (used 45596 bytes from 327680 bytes)
Flash: [=======   ]  66.8% (used 1224953 bytes from 1835008 bytes)
Building .pioenvs/nodemcu-wmbus/firmware.bin
Creating esp32 image...
Successfully created esp32 image.
esp32_create_combined_bin([".pioenvs/nodemcu-wmbus/firmware.bin"], [".pioenvs/nodemcu-wmbus/firmware.elf"])
Wrote 0x13c780 bytes to file /data/build/nodemcu-wmbus/.pioenvs/nodemcu-wmbus/firmware.factory.bin, ready to flash to offset 0x0
esp32_copy_ota_bin([".pioenvs/nodemcu-wmbus/firmware.bin"], [".pioenvs/nodemcu-wmbus/firmware.elf"])
========================= [SUCCESS] Took 21.33 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.0.117
INFO Uploading /data/build/nodemcu-wmbus/.pioenvs/nodemcu-wmbus/firmware.bin (1230720 bytes)
Uploading: [============================================================] 100% Done...

INFO Upload took 13.83 seconds, waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.0.117 using esphome API
INFO Successfully connected to nodemcu-wmbus @ 192.168.0.117 in 11.329s
INFO Successful handshake with nodemcu-wmbus @ 192.168.0.117 in 0.168s
[09:27:00][I][app:100]: ESPHome version 2024.9.2 compiled on Nov 14 2024, 09:26:16

[09:27:01][C][logger:185]: Logger:
[09:27:01][C][logger:186]:   Level: VERBOSE
[09:27:01][C][logger:188]:   Log Baud Rate: 115200
[09:27:01][C][logger:189]:   Hardware UART: UART0
[09:27:01][C][restart.button:017]: Restart Button 'Restart ESP'
[09:27:01][C][restart.button:017]:   Icon: 'mdi:restart'
[09:27:01][C][captive_portal:089]: Captive Portal:
[09:27:01][C][web_server:145]: Web Server:
[09:27:01][C][web_server:146]:   Address: nodemcu-wmbus.local:80
[09:27:01][C][sntp:048]: SNTP Time:
[09:27:01][C][sntp:049]:   Server 1: '0.pool.ntp.org'
[09:27:01][C][sntp:050]:   Server 2: '1.pool.ntp.org'
[09:27:01][C][sntp:051]:   Server 3: '2.pool.ntp.org'
[09:27:01][C][sntp:052]:   Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[09:27:01][C][mdns:116]: mDNS:
[09:27:01][C][mdns:117]:   Hostname: nodemcu-wmbus
[09:27:01][V][mdns:118]:   Services:
[09:27:01][V][mdns:120]:   - _esphomelib, _tcp, 6053
[09:27:01][V][mdns:122]:     TXT: version = 2024.9.2
[09:27:01][V][mdns:122]:     TXT: mac = d48afc9dec70
[09:27:01][V][mdns:122]:     TXT: platform = ESP32
[09:27:01][V][mdns:122]:     TXT: board = nodemcu-32s
[09:27:01][V][mdns:122]:     TXT: network = wifi
[09:27:01][V][mdns:120]:   - _http, _tcp, 80
[09:27:01][C][esphome.ota:073]: Over-The-Air updates:
[09:27:01][C][esphome.ota:074]:   Address: nodemcu-wmbus.local:3232
[09:27:01][C][esphome.ota:075]:   Version: 2
[09:27:01][C][safe_mode:018]: Safe Mode:
[09:27:01][C][safe_mode:020]:   Boot considered successful after 60 seconds
[09:27:01][C][safe_mode:021]:   Invoke after 10 boot attempts
[09:27:01][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[09:27:01][C][api:139]: API Server:
[09:27:01][C][api:140]:   Address: nodemcu-wmbus.local:6053
[09:27:01][C][api:144]:   Using noise encryption: NO
[09:27:01][C][wifi_info:012]: WifiInfo SSID 'ESP w sieci'
[09:27:01][C][wifi_info:012]:   Icon: 'mdi:wifi-strength-2'
[09:27:01][V][wifi_info:012]:   Unique ID: 'd48afc9dec70-wifiinfo-ssid'
[09:27:01][C][wifi_info:010]: WifiInfo IPAddress 'Adress IP ESP'
[09:27:01][C][wifi_info:010]:   Icon: 'mdi:wifi'
[09:27:01][V][wifi_info:010]:   Unique ID: 'd48afc9dec70-wifiinfo-ip'
[09:27:01][C][wmbus:338]: wM-Bus v4.1.0-1.17.1-b8f4a945:
[09:27:01][C][wmbus:356]:   MAC: 9DFC8AD4
[09:27:01][C][wmbus:358]:   CC1101 frequency: 868.950 MHz
[09:27:01][C][wmbus:359]:   CC1101 SPI bus:
[09:27:01][C][wmbus:363]:     MOSI Pin: GPIO23
[09:27:01][C][wmbus:364]:     MISO Pin: GPIO19
[09:27:01][C][wmbus:365]:     CLK Pin:  GPIO18
[09:27:01][C][wmbus:366]:     CS Pin:   GPIO5
[09:27:01][C][wmbus:367]:     GDO0 Pin: GPIO21
[09:27:01][C][wmbus:368]:     GDO2 Pin: GPIO22
[09:27:01][C][wmbus:374]:   Available drivers: unknown, apator162
[09:27:01][C][wmbus:388]:   Meter:
[09:27:01][C][wmbus:389]:     ID: 120881779 [0x07348273]
[09:27:01][C][wmbus:390]:     Type: apator162
[09:27:01][C][wmbus:391]:     Key: ''
[09:27:01][C][wmbus:393]:     Field: 'rssi'
[09:27:01][C][wmbus:394]:      Name: 'RSSI glowny'
[09:27:01][C][wmbus:394]:        Device Class: 'signal_strength'
[09:27:01][C][wmbus:394]:        State Class: 'measurement'
[09:27:01][C][wmbus:394]:        Unit of Measurement: 'dBm'
[09:27:01][C][wmbus:394]:        Accuracy Decimals: 0
[09:27:01][C][wmbus:393]:     Field: 'total'
[09:27:01][C][wmbus:394]:      Name: 'ESP_wodomierz_glowny'
[09:27:01][C][wmbus:394]:        Device Class: 'water'
[09:27:01][C][wmbus:394]:        State Class: 'total_increasing'
[09:27:01][C][wmbus:394]:        Unit of Measurement: 'm3'
[09:27:01][C][wmbus:394]:        Accuracy Decimals: 3
[09:27:01][C][wmbus:394]:        Icon: 'mdi:water'
[09:27:02][V][json:038][async_tcp]: Attempting to allocate 512 bytes for JSON serialization
[09:27:02][V][json:058][async_tcp]: Size after shrink 96 bytes
[09:27:02][V][json:038]: Attempting to allocate 512 bytes for JSON serialization
[09:27:02][V][json:058]: Size after shrink 156 bytes
[09:27:02][V][json:038]: Attempting to allocate 512 bytes for JSON serialization
[09:27:02][V][json:058]: Size after shrink 172 bytes
[09:27:02][V][json:038]: Attempting to allocate 512 bytes for JSON serialization
[09:27:02][V][json:058]: Size after shrink 112 bytes
[09:27:02][V][json:038]: Attempting to allocate 512 bytes for JSON serialization
[09:27:02][V][json:058]: Size after shrink 164 bytes
[09:27:02][V][json:038]: Attempting to allocate 512 bytes for JSON serialization
[09:27:02][V][json:058]: Size after shrink 164 bytes
[09:27:24][V][json:038][async_tcp]: Attempting to allocate 512 bytes for JSON serialization
[09:27:24][V][json:058][async_tcp]: Size after shrink 96 bytes
[09:27:24][V][json:038]: Attempting to allocate 512 bytes for JSON serialization
[09:27:24][V][json:058]: Size after shrink 156 bytes
[09:27:24][V][json:038]: Attempting to allocate 512 bytes for JSON serialization
[09:27:24][V][json:058]: Size after shrink 172 bytes
[09:27:24][V][json:038]: Attempting to allocate 512 bytes for JSON serialization
[09:27:24][V][json:058]: Size after shrink 112 bytes
[09:27:24][V][json:038]: Attempting to allocate 512 bytes for JSON serialization
[09:27:24][V][json:058]: Size after shrink 164 bytes
[09:27:24][V][json:038]: Attempting to allocate 512 bytes for JSON serialization
[09:27:24][V][json:058]: Size after shrink 164 bytes
[09:27:43][D][esp32.preferences:114]: Saving 1 preferences to flash...
[09:27:43][V][esp32.preferences:163]: nvs_get_blob('1355795339'): ESP_ERR_NVS_NOT_FOUND - the key might not be set yet
[09:27:43][V][esp32.preferences:126]: sync: key: 1355795339, len: 7
[09:27:43][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[09:27:48][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[09:27:48][D][esp32.preferences:114]: Saving 1 preferences to flash...
[09:27:48][V][esp32.preferences:126]: sync: key: 233825507, len: 4
[09:27:48][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[09:28:23][V][rxLoop:167]: Have 110 bytes from CC1101 Rx, RSSI: -48 dBm LQI: 128
[09:28:23][D][mbus:035]: Received T1 A frame
[09:28:23][V][mbus:046]: Frame: 2F271C58D59A4CB95A59C58B59959368BCA64E63A55962D6B196662DC58BD1A663C5364E696C9667238D716B3434EB293A69538D98F25AC674C9ACB4B26C4B4D99656938CB2DA6A6653C592D97258DCA56A5A68ED296A659A674B299B236C5A535C96934B3B42DAD0BC8B5A67345 (110) [RAW]
[09:28:23][V][mbus:053]: Frame: 3E44010673960403050763EA7A290030855A3403C65BD75260E05E21408C128F2A97B5BE085CE6EC8AD3759967B3366A57D53549B4F0F662CF6A065C8FAE1809149F132C36C3E30A4C (73) [with CRC]
[09:28:23][V][mbus:096]: Validating CRC for Block1
[09:28:23][V][crc:031]:     calculated: 0x63EA, read: 0x63EA
[09:28:23][V][mbus:116]: Validating CRC for Block2
[09:28:23][V][crc:031]:     calculated: 0x408C, read: 0x408C
[09:28:23][V][mbus:116]: Validating CRC for Block3
[09:28:23][V][crc:031]:     calculated: 0x366A, read: 0x366A
[09:28:23][V][mbus:116]: Validating CRC for Block4
[09:28:23][V][crc:031]:     calculated: 0x149F, read: 0x149F
[09:28:23][V][mbus:116]: Validating CRC for Block5
[09:28:23][V][crc:031]:     calculated: 0x0A4C, read: 0x0A4C
[09:28:23][V][mbus:063]: Frame: 3E4401067396040305077A290030855A3403C65BD75260E05E21128F2A97B5BE085CE6EC8AD3759967B357D53549B4F0F662CF6A065C8FAE1809132C36C3E3 (63) [without CRC]
[09:28:23][V][Telegram.cpp:1131]: (wmbus) parseDLL @0 63
[09:28:23][V][Telegram.cpp:1178]: (wmbus) parseELL @10 53
[09:28:23][V][Telegram.cpp:1333]: (wmbus) parseNWL @10 53
[09:28:23][V][Telegram.cpp:1391]: (wmbus) parseAFL @10 53
[09:28:23][V][Telegram.cpp:2078]: (wmbus) parseTPL @10 53
[09:28:23][W][component:237]: Component wmbus took a long time for an operation (162 ms).
[09:28:23][W][component:238]: Components should block for at most 30 ms.
[09:30:28][V][rxLoop:167]: Have 110 bytes from CC1101 Rx, RSSI: -48 dBm LQI: 128
[09:30:28][D][mbus:035]: Received T1 A frame
[09:30:28][V][mbus:046]: Frame: 2F271C58D59A4CB95A59C58B59959368BCA64E63A35962D6B19C63C7495365996CC9370EB16D1964DC72359C4E3A36B1A56A698CECA9B1959C963A7264DD236963935B4D2C95695CA592DC8D32E639659C959D0D5A3956D31C53993A6C68D70E34E94D34D8CBD32956A71369A745 (110) [RAW]
[09:30:28][V][mbus:053]: Frame: 3E44010673960403050763EA7A2B003085DBDC975598E74280C551DE15D22B6DF0FFB2EF85049BFE51CB60270CC89094F534B73A200495C10B90CDD7A7F86142129111B3CE90FD1FFC (73) [with CRC]
[09:30:28][V][mbus:096]: Validating CRC for Block1
[09:30:28][V][crc:031]:     calculated: 0x63EA, read: 0x63EA
[09:30:28][V][mbus:116]: Validating CRC for Block2
[09:30:28][V][crc:031]:     calculated: 0x15D2, read: 0x15D2
[09:30:28][V][mbus:116]: Validating CRC for Block3
[09:30:28][V][crc:031]:     calculated: 0x9094, read: 0x9094
[09:30:28][V][mbus:116]: Validating CRC for Block4
[09:30:28][V][crc:031]:     calculated: 0x1291, read: 0x1291
[09:30:28][V][mbus:116]: Validating CRC for Block5
[09:30:28][V][crc:031]:     calculated: 0x1FFC, read: 0x1FFC
[09:30:28][V][mbus:063]: Frame: 3E4401067396040305077A2B003085DBDC975598E74280C551DE2B6DF0FFB2EF85049BFE51CB60270CC8F534B73A200495C10B90CDD7A7F8614211B3CE90FD (63) [without CRC]
[09:30:28][V][Telegram.cpp:1131]: (wmbus) parseDLL @0 63
[09:30:28][V][Telegram.cpp:1178]: (wmbus) parseELL @10 53
[09:30:28][V][Telegram.cpp:1333]: (wmbus) parseNWL @10 53
[09:30:28][V][Telegram.cpp:1391]: (wmbus) parseAFL @10 53
[09:30:28][V][Telegram.cpp:2078]: (wmbus) parseTPL @10 53
[09:30:28][W][component:237]: Component wmbus took a long time for an operation (150 ms).
[09:30:28][W][component:238]: Components should block for at most 30 ms.
[09:31:34][V][rxLoop:167]: Have 110 bytes from CC1101 Rx, RSSI: -48 dBm LQI: 128
[09:31:34][D][mbus:035]: Received T1 A frame
[09:31:34][V][mbus:046]: Frame: 2F271C58D59A4CB95A59C58B59959368BCA64E63B45962D6B196718F19B47134DAA5A2CB8CBC56CAC9A6C4B2D68EC6A694B72598B9657263934D65993A55B234DB1C2F19A998E38B9A55B2A5CA5A365A56393C66C998E52E939358B5A68DA6692F2D196532CB39A5A92EC39638D5 (110) [RAW]
[09:31:34][V][mbus:053]: Frame: 3E44010673960403050763EA7A2C0030855DBDAC4776F633B3D0E8AAD330B86A9349A3994A277005290E11843DAFA223A90EF4F619F027DAE5B93F27030AB65F3EC55733260F382021 (73) [with CRC]
[09:31:34][V][mbus:096]: Validating CRC for Block1
[09:31:34][V][crc:031]:     calculated: 0x63EA, read: 0x63EA
[09:31:34][V][mbus:116]: Validating CRC for Block2
[09:31:34][V][crc:031]:     calculated: 0xD330, read: 0xD330
[09:31:34][V][mbus:116]: Validating CRC for Block3
[09:31:34][V][crc:031]:     calculated: 0xA223, read: 0xA223
[09:31:34][V][mbus:116]: Validating CRC for Block4
[09:31:34][V][crc:031]:     calculated: 0x3EC5, read: 0x3EC5
[09:31:34][V][mbus:116]: Validating CRC for Block5
[09:31:34][V][crc:031]:     calculated: 0x2021, read: 0x2021
[09:31:34][V][mbus:063]: Frame: 3E4401067396040305077A2C0030855DBDAC4776F633B3D0E8AAB86A9349A3994A277005290E11843DAFA90EF4F619F027DAE5B93F27030AB65F5733260F38 (63) [without CRC]
[09:31:34][V][Telegram.cpp:1131]: (wmbus) parseDLL @0 63
[09:31:34][V][Telegram.cpp:1178]: (wmbus) parseELL @10 53
[09:31:34][V][Telegram.cpp:1333]: (wmbus) parseNWL @10 53
[09:31:34][V][Telegram.cpp:1391]: (wmbus) parseAFL @10 53
[09:31:34][V][Telegram.cpp:2078]: (wmbus) parseTPL @10 53
[09:31:34][W][component:237]: Component wmbus took a long time for an operation (156 ms).
[09:31:34][W][component:238]: Components should block for at most 30 ms.

a oto config

esphome:
  name: nodemcu-wmbus
  
esp32:
  board: nodemcu-32s
  framework:
    type: arduino

time:
  - platform: sntp
    id: time_sntp
external_components:
  - source: github://SzczepanLeon/esphome-components@main
    components: [ wmbus ]


# Logi systemowe dostępne opcje  'NONE', 'ERROR', 'WARN', 'INFO', 'DEBUG', 'VERBOSE', 'VERY_VERBOSE'.
logger:
  level: VERBOSE

 
web_server:
  port: 80



api:
 reboot_timeout: 36000s  

ota:
  platform: esphome


# Konfiguracja sieci LAN
wifi:
  ssid: "wifi"
  password: "password"
  fast_connect: true
  reboot_timeout: 15min
    






captive_portal:


wmbus:
  mosi_pin: GPIO23 #d7   #GPIO23
  miso_pin: GPIO19 #d6   #GPIO19
  clk_pin:  GPIO18 #d5   #GPIO18
  cs_pin:   GPIO05  #d4   #GPIO5
  gdo0_pin: GPIO21  #d1   #GPIO21
  gdo2_pin: GPIO22  #D2   #GPIO22
  led_blink_time: "1s"
  #frequency: 868.950
 # all_drivers: true
 # sync_mode: True
 # log_all: True

#########################################################################################################



  mqtt:
    broker: 192.168.100.194
    port: 1883
    username: otgw
    password: password
 


sensor:





  - platform: wmbus
    meter_id: 0x7348273
    #add_prefix: false
    type: apator162
    key: "00000000000000000000000000000000"
    sensors:
      - name: "RSSI glowny"
        field: "rssi"
        accuracy_decimals: 0
        unit_of_measurement: "dBm"
        device_class: "signal_strength"
        state_class: "measurement"
        entity_category: "diagnostic"

      - name: "ESP_wodomierz_glowny"
        field: "total"
        accuracy_decimals: 3
        unit_of_measurement: "m3"
        device_class: "water"
        state_class: "total_increasing"
        icon: "mdi:water"







text_sensor:
  - platform: wifi_info
    ip_address:
      name: 'Adress IP ESP'
      icon: mdi:wifi
    ssid:
      name: 'ESP w sieci'
      icon: mdi:wifi-strength-2

button:
  - platform: restart
    name: "Restart ESP"

Ramka ma inne ID niż podane w YAMLu

dziekuje juz cos zaczyna sie dziac

10:25:47	[I]	[wmbus:092]	
Using selected driver apator162 (detected driver was apator162)
10:25:47	[I]	[wmbus:104]	
apator162 [0x03049673] RSSI: -48dBm T: 3E4401067396040305077A6200308593068B59784EC66AAFDC41C13632DD5A9C3B3E402CC805FC89369CA0697322C29CBC767DE4BFDD78EE94EC26B415B64D (63) T1 A
10:25:47	[D]	[meters.cpp:1985]	
(meter) created ESPHome apator162 03049673 not-encrypted
10:25:47	[V]	[Telegram.cpp:1131]	
(wmbus) parseDLL @0 63
10:25:47	[V]	[Telegram.cpp:1178]	
(wmbus) parseELL @10 53
10:25:47	[V]	[Telegram.cpp:1333]	
(wmbus) parseNWL @10 53
10:25:47	[V]	[Telegram.cpp:1391]	
(wmbus) parseAFL @10 53
10:25:47	[V]	[Telegram.cpp:2078]	
(wmbus) parseTPL @10 53
10:25:47	[V]	[meters.cpp:635]	
(meter) ESPHome: for me? 03049673.M=APA.V=05.T=07,03049673.M=APA.V=05.T=07 in 03049673
10:25:47	[V]	[meters.cpp:686]	
(meter) ESPHome: yes for me
10:25:47	[D]	[meters.cpp:909]	
(meter) ESPHome(0) apator162  handling telegram from 03049673.M=APA.V=05.T=07
10:25:47	[V]	[Telegram.cpp:1131]	
(wmbus) parseDLL @0 63
10:25:47	[V]	[Telegram.cpp:545]	
(telegram) DLL L=3e C=44 (from meter SND_NR) M=0601 (APA) A=03049673 VER=05 TYPE=07 (Water meter) (driver apator162) DEV=ESPHome wM-Bus RSSI=-48
10:25:47	[V]	[Telegram.cpp:1178]	
(wmbus) parseELL @10 53
10:25:47	[V]	[Telegram.cpp:1333]	
(wmbus) parseNWL @10 53
10:25:47	[V]	[Telegram.cpp:1391]	
(wmbus) parseAFL @10 53
10:25:47	[V]	[Telegram.cpp:2078]	
(wmbus) parseTPL @10 53
10:25:47	[V]	[Telegram.cpp:299]	
(TPL) num encrypted blocks 3 (48 bytes and remaining unencrypted 0 bytes)
10:25:47	[W]	[Telegram.cpp:1799]	
(wmbus) WARNING! no key to decrypt payload! Permanently ignoring telegrams from id: 03049673 mfct: (APA) Apator, Poland (0x601) type: Water meter (0x07) ver: 0x05
10:25:47	[V]	[Telegram.cpp:634]	
(telegram) TPL CI=7a
10:25:47	[V]	[Telegram.cpp:640]	
 ACC=62 STS=00 CFG=8530 (bidirectional AES_CBC_IV nb=3 cntn=0 ra=0 hc=0)
10:25:47	[V]	[sensor:043]	
'RSSI glowny': Received new state -48.000000
10:25:47	[D]	[sensor:094]	
'RSSI glowny': Sending state -48.00000 dBm with 0 decimals of accuracy
10:25:47	[V]	[json:038]	
Attempting to allocate 512 bytes for JSON serialization
10:25:47	[V]	[json:058]	
Size after shrink 76 bytes
10:25:47	[W]	[wmbus:154]	
Can't get requested field 'total' with unit 'm3'
10:25:47	[V]	[wmbus:177]	
Publish(topic='nodemcu-wmbus/wmbus/03049673' payload='{"meter":"apator162","media":"water","id":"03049673","rssi_dbm":-48,"timestamp":"1970-01-01T00:00:00Z","device":"ESPHome wM-Bus"}' retain=0)
10:25:47	[W]	[component:237]	
Component wmbus took a long time for an operation (437 ms).
10:25:47	[W]	[component:238]	
Components should block for at most 30 ms.

O kluczu zapomniałeś.

oki super dziękuje śmiga jak trzeba pozdrawiam

A tego w samym ESPHome nie ogarniesz? Np. Text Component — ESPHome , do tego lambda i powinno działać?

Czy można dodać każdy driver z Wmbusmeters? Np. te obsługujące stacje pogodowe na 868MHz?

Tak, ale …
Kod komponentu nie jest na to przygotowany. Metery są tworzone na poziomie generowania kodu a nie dynamicznie.

Kazdy stary driver z wmbusmeters jest dostepny.

Cześć,
Zgodnie z rekomendacją @_Szczepan przesiadłem się na ESP32 wersja 4.X ponieważ na wersji 3.X nie mogłęm nic odczytać z mojego licznika

obecnie mój kod na ESPHOME wygląda tak:

esphome:
  name: esp32-wodomierze
  friendly_name: esp32-wodomierze

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  level: VERY_VERBOSE
# Enable Home Assistant API
api:
  encryption:
    key: "UjC6mB31kmKb0cBHw9R5ruRQIhvk+GdFleSBEWI2gmA="

ota:
  - platform: esphome
    password: "f97bd55a7f879411f931a90515df333d"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32-Wodomierze"
    password: "2qxsPGJZlcVG"

captive_portal:

time:
  - platform: sntp
    id: time_sntp

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

wmbus:
  mosi_pin: GPIO23
  miso_pin: GPIO19
  clk_pin:  GPIO18
  cs_pin:   GPIO05
  gdo0_pin: GPIO02
  gdo2_pin: GPIO04

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


sensor:
  - platform: wmbus
    meter_id: 0x80427254
    type: ultrimis
    key: "00000000000000000000000000000000"
    sensors:
      - name: "my water RSSi"
        field: "rssi"
        accuracy_decimals: 0
        unit_of_measurement: "dBm"
        device_class: "signal_strength"
        state_class: "measurement"
        entity_category: "diagnostic"
      - name: "my water"
        field: "total"
        accuracy_decimals: 3
        unit_of_measurement: "m³"
        device_class: "water"
        state_class: "total_increasing"
        icon: "mdi:water"

logi po uruchomieniu wyglądają tak:

INFO ESPHome 2024.11.0
INFO Reading configuration /config/esphome/esp32-wodomierze.yaml...
INFO Updating https://github.com/SzczepanLeon/esphome-components.git@main
INFO Detected timezone 'Europe/Warsaw'
WARNING GPIO5 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
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.168.2.98 using esphome API
INFO Successfully connected to esp32-wodomierze @ 192.168.2.98 in 0.046s
INFO Successful handshake with esp32-wodomierze @ 192.168.2.98 in 0.134s
[13:27:23][I][app:100]: ESPHome version 2024.11.0 compiled on Nov 23 2024, 13:22:58
[13:27:23][C][wifi:600]: WiFi:
[13:27:23][C][wifi:428]:   Local MAC: 08:B6:1F:3B:6F:88
[13:27:23][C][wifi:433]:   SSID: 'SZAKAL_ADAMSY'[redacted]
[13:27:23][C][wifi:436]:   IP Address: 192.168.2.98
[13:27:23][C][wifi:440]:   BSSID: 68:D7:9A:1A:B7:AE[redacted]
[13:27:23][C][wifi:441]:   Hostname: 'esp32-wodomierze'
[13:27:23][C][wifi:443]:   Signal strength: -69 dB ▂▄▆█
[13:27:23][V][wifi:445]:   Priority: 0.0
[13:27:23][C][wifi:447]:   Channel: 11
[13:27:23][C][wifi:448]:   Subnet: 255.255.255.0
[13:27:23][C][wifi:449]:   Gateway: 192.168.2.1
[13:27:23][C][wifi:450]:   DNS1: 8.8.8.8
[13:27:23][C][wifi:451]:   DNS2: 8.8.4.4
[13:27:23][C][logger:185]: Logger:
[13:27:23][C][logger:186]:   Level: VERY_VERBOSE
[13:27:23][C][logger:188]:   Log Baud Rate: 115200
[13:27:23][C][logger:189]:   Hardware UART: UART0
[13:27:23][C][captive_portal:089]: Captive Portal:
[13:27:23][C][sntp:048]: SNTP Time:
[13:27:23][C][sntp:049]:   Server 1: '0.pool.ntp.org'
[13:27:23][C][sntp:050]:   Server 2: '1.pool.ntp.org'
[13:27:23][C][sntp:051]:   Server 3: '2.pool.ntp.org'
[13:27:23][C][sntp:052]:   Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[13:27:23][C][mdns:116]: mDNS:
[13:27:23][C][mdns:117]:   Hostname: esp32-wodomierze
[13:27:23][V][mdns:118]:   Services:
[13:27:23][V][mdns:120]:   - _esphomelib, _tcp, 6053
[13:27:23][V][mdns:122]:     TXT: friendly_name = esp32-wodomierze
[13:27:23][V][mdns:122]:     TXT: version = 2024.11.0
[13:27:23][V][mdns:122]:     TXT: mac = 08b61f3b6f88
[13:27:23][V][mdns:122]:     TXT: platform = ESP32
[13:27:23][V][mdns:122]:     TXT: board = esp32dev
[13:27:23][V][mdns:122]:     TXT: network = wifi
[13:27:23][V][mdns:122]:     TXT: api_encryption = Noise_NNpsk0_25519_ChaChaPoly_SHA256
[13:27:23][C][esphome.ota:073]: Over-The-Air updates:
[13:27:23][C][esphome.ota:074]:   Address: esp32-wodomierze.local:3232
[13:27:23][C][esphome.ota:075]:   Version: 2
[13:27:23][C][esphome.ota:078]:   Password configured
[13:27:23][C][safe_mode:018]: Safe Mode:
[13:27:23][C][safe_mode:020]:   Boot considered successful after 60 seconds
[13:27:23][C][safe_mode:021]:   Invoke after 10 boot attempts
[13:27:23][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[13:27:23][C][api:140]: API Server:
[13:27:23][C][api:141]:   Address: esp32-wodomierze.local:6053
[13:27:23][C][api:143]:   Using noise encryption: YES
[13:27:23][C][wmbus:338]: wM-Bus v4.1.0-1.17.1-b8f4a945:
[13:27:23][C][wmbus:356]:   MAC: 3B1FB608
[13:27:23][C][wmbus:358]:   CC1101 frequency: 868.950 MHz
[13:27:23][C][wmbus:359]:   CC1101 SPI bus:
[13:27:23][C][wmbus:363]:     MOSI Pin: GPIO23
[13:27:23][C][wmbus:364]:     MISO Pin: GPIO19
[13:27:23][C][wmbus:365]:     CLK Pin:  GPIO18
[13:27:23][C][wmbus:366]:     CS Pin:   GPIO5
[13:27:23][C][wmbus:367]:     GDO0 Pin: GPIO2
[13:27:23][C][wmbus:368]:     GDO2 Pin: GPIO4
[13:27:23][C][wmbus:374]:   Available drivers: unknown, ultrimis
[13:27:23][C][wmbus:388]:   Meter:
[13:27:23][C][wmbus:389]:     ID: 2151838292 [0x80427254]
[13:27:23][C][wmbus:390]:     Type: ultrimis
[13:27:23][C][wmbus:391]:     Key: '00000000000000000000000000000000'
[13:27:23][C][wmbus:393]:     Field: 'rssi'
[13:27:23][C][wmbus:394]:      Name: 'my water RSSi'
[13:27:23][C][wmbus:394]:        Device Class: 'signal_strength'
[13:27:23][C][wmbus:394]:        State Class: 'measurement'
[13:27:23][C][wmbus:394]:        Unit of Measurement: 'dBm'
[13:27:23][C][wmbus:394]:        Accuracy Decimals: 0
[13:27:23][C][wmbus:393]:     Field: 'total'
[13:27:23][C][wmbus:394]:      Name: 'my water'
[13:27:23][C][wmbus:394]:        Device Class: 'water'
[13:27:23][C][wmbus:394]:        State Class: 'total_increasing'
[13:27:23][C][wmbus:394]:        Unit of Measurement: 'm³'
[13:27:23][C][wmbus:394]:        Accuracy Decimals: 3
[13:27:23][C][wmbus:394]:        Icon: 'mdi:water'
[13:27:31][VV][scheduler:226]: Running interval '' with interval=60000 last_execution=58111 (now=118111)
[13:27:34][V][rxLoop:167]: Have 83 bytes from CC1101 Rx, RSSI: -41 dBm LQI: 131
[13:27:34][V][rxLoop:172]: Synchronus mode enabled.
[13:27:34][D][mbus:035]: Received T1 A frame
[13:27:34][V][mbus:046]: Frame: 3B271C58D59A65C4CE70EB1658D35A372C694E64E95963965999B158E396B0DA6CB19A5699CD0EB0D58BD13D238DA39696998D58ED295938D62E9C6539CD318E559CC962D36996A6D19B13B1C58E5A9A4D3ACA (83) [RAW]
[13:27:34][VV][3of6:095]: Decode 3 out of 6 OK.
[13:27:34][V][mbus:053]: Frame: 2E4401065472428001161EDF7A7F002005AD022081F885F0A4C28103C7CBB6209FA102CF07B03FD924CDB904E037656AC58784020FF128 (55) [with CRC]
[13:27:34][V][mbus:096]: Validating CRC for Block1
[13:27:34][V][crc:031]:     calculated: 0x1EDF, read: 0x1EDF
[13:27:34][V][mbus:116]: Validating CRC for Block2
[13:27:34][V][crc:031]:     calculated: 0xC7CB, read: 0xC7CB
[13:27:34][V][mbus:116]: Validating CRC for Block3
[13:27:34][V][crc:031]:     calculated: 0x656A, read: 0x656A
[13:27:34][V][mbus:116]: Validating CRC for Block4
[13:27:34][V][crc:031]:     calculated: 0xF128, read: 0xF128
[13:27:34][V][mbus:063]: Frame: 2E4401065472428001167A7F002005AD022081F885F0A4C28103B6209FA102CF07B03FD924CDB904E037C58784020F (47) [without CRC]
[13:27:34][VV][wmbus:056]: Have data from RF ...
[13:27:34][V][Telegram.cpp:1131]: (wmbus) parseDLL @0 47
[13:27:34][V][Telegram.cpp:1178]: (wmbus) parseELL @10 37
[13:27:34][V][Telegram.cpp:1333]: (wmbus) parseNWL @10 37
[13:27:34][V][Telegram.cpp:1391]: (wmbus) parseAFL @10 37
[13:27:34][V][Telegram.cpp:2078]: (wmbus) parseTPL @10 37
[13:27:34][I][wmbus:092]: Using selected driver ultrimis (detected driver was ultrimis)
[13:27:34][I][wmbus:104]: ultrimis [0x80427254] RSSI: -41dBm T: 2E4401065472428001167A7F002005AD022081F885F0A4C28103B6209FA102CF07B03FD924CDB904E037C58784020F (47) T1 A
[13:27:34][D][meters.cpp:1985]: (meter) created ESPHome ultrimis 80427254 encrypted
[13:27:34][V][Telegram.cpp:1131]: (wmbus) parseDLL @0 47
[13:27:34][V][Telegram.cpp:1178]: (wmbus) parseELL @10 37
[13:27:34][V][Telegram.cpp:1333]: (wmbus) parseNWL @10 37
[13:27:34][V][Telegram.cpp:1391]: (wmbus) parseAFL @10 37
[13:27:34][V][Telegram.cpp:2078]: (wmbus) parseTPL @10 37
[13:27:34][V][meters.cpp:635]: (meter) ESPHome: for me? 80427254.M=APA.V=01.T=16,80427254.M=APA.V=01.T=16 in 80427254
[13:27:34][V][meters.cpp:686]: (meter) ESPHome: yes for me
[13:27:34][D][meters.cpp:909]: (meter) ESPHome(0) ultrimis  handling telegram from 80427254.M=APA.V=01.T=16
[13:27:34][V][Telegram.cpp:1131]: (wmbus) parseDLL @0 47
[13:27:34][V][Telegram.cpp:545]: (telegram) DLL L=2e C=44 (from meter SND_NR) M=0601 (APA) A=80427254 VER=01 TYPE=16 (Cold water meter) (driver ultrimis) DEV=ESPHome wM-Bus RSSI=-41
[13:27:34][V][Telegram.cpp:1178]: (wmbus) parseELL @10 37
[13:27:34][V][Telegram.cpp:1333]: (wmbus) parseNWL @10 37
[13:27:34][V][Telegram.cpp:1391]: (wmbus) parseAFL @10 37
[13:27:34][V][Telegram.cpp:2078]: (wmbus) parseTPL @10 37
[13:27:34][V][Telegram.cpp:299]: (TPL) num encrypted blocks 2 (32 bytes and remaining unencrypted 0 bytes)
[13:27:34][V][Telegram.cpp:303]: (TPL) AES CBC IV decrypting
[13:27:34][V][Telegram.cpp:343]: (TPL) IV 01065472428001167F7F7F7F7F7F7F7F
[13:27:34][V][utils.cpp:823]: (TPL) decrypted  "AAE9B3DDFA8A5E828D3082C443AEFB9E1BFD5B211B4997BF3B16DC0F6B0AE871"
[13:27:35][W][Telegram.cpp:1832]: (wmbus) WARNING!! decrypted content failed check, did you use the correct decryption key? Permanently ignoring telegrams from id: 80427254 mfct: (APA) Apator, Poland (0x601) type: Cold water meter (0x16) ver: 0x01
[13:27:35][V][Telegram.cpp:634]: (telegram) TPL CI=7a
[13:27:35][V][Telegram.cpp:640]:  ACC=7f STS=00 CFG=0520 (AES_CBC_IV nb=2 cntn=0 ra=0 hc=0)
[13:27:35][V][sensor:043]: 'my water RSSi': Received new state -41.000000
[13:27:35][D][sensor:094]: 'my water RSSi': Sending state -41.00000 dBm with 0 decimals of accuracy
[13:27:35][VV][api.service:140]: send_sensor_state_response: SensorStateResponse {
  key: 1296058191
  state: -41
  missing_state: NO
}
[13:27:35][W][wmbus:154]: Can't get requested field 'total' with unit 'm³'
[13:27:35][W][component:237]: Component wmbus took a long time for an operation (379 ms).
[13:27:35][W][component:238]: Components should block for at most 30 ms.
[13:27:37][V][rxLoop:167]: Have 83 bytes from CC1101 Rx, RSSI: -90 dBm LQI: 171
[13:27:37][V][rxLoop:172]: Synchronus mode enabled.
[13:27:37][D][mbus:035]: Received T1 A frame
[13:27:37][V][mbus:046]: Frame: 3B271C58D59A68D4EE70EB1658D35ACCB2CB4E67265D6396599196C94B2C70B88E9B2CE53662F270D71AC59D8DC6CC36C53B6669A95D5D96ABF328DB5395BC9A6CB6B1A95C36994DD0ED262CDD1AF2C593F695 (83) [RAW]
[13:27:37][V][3of6:083]: Decode 3 out of 6 failed..

na nowej platformie otrzymuje dane rssi ale nadal nie odbieram danych o stanie licznika.
nie rozumiem dlaczego raz dane są odkodowane

[13:27:34][D][meters.cpp:1985]: (meter) created ESPHome ultrimis 80427254 encrypted

a raz nie

[13:27:37][V][mbus:046]: Frame: 3B271C58D59A68D4EE70EB1658D35ACCB2CB4E67265D6396599196C94B2C70B88E9B2CE53662F270D71AC59D8DC6CC36C53B6669A95D5D96ABF328DB5395BC9A6CB6B1A95C36994DD0ED262CDD1AF2C593F695 (83) [RAW]
[13:27:37][V][3of6:083]: Decode 3 out of 6 failed..

zanim zacznę ciężką przeprawę z gminą lub producentem w celu uzyskania klucza chciałem się upewnić czy na pewno problem leży w nieprawidłowym kluczu.
Z góry dzięki za pomoc.

Cześć @_Szczepan, próbowałeś może innych modułów radiowych? Np.: SX1262

Albo może np. taki gotowiec?

Co myślisz?
Pozdrawiam

Chcecie inne układy radiowe to troszkę zasponsorujcie autora :wink:

Na chwilę obecną mam parę sztuk, ładnych zielonych. Jak trochę czasu będę miał (i motywacji) to domerguję kod do głównej gałęzi projektu.

UPDATE:
Otrzymałem klucz z gminy. :nerd_face:
Po aktualizacji kodu dane zostały odczytane :partying_face:
@_Szczepan dzieki za dobrą robote -kawka leci do Ciebie :coffee: :heavy_dollar_sign:

1 Like

Hej, chciałem się podzielić opinią o urządzeniu od Szczepana tym ultimate reader. Tam gdzie na cc1101 nie łapało mi nic z licznika prądu to na tym śmiga aż miło i łapie odczyty bez problemu . Ogólnie szybsze odczyty i odbiór z urządzeń nawet oddalonych sporo od czytnika.

3 Likes

Też jestem jednym z pierwszych użytkowników sprzętu ostatniej generacji na bazie ESP32-S3 + SX1xxx od @_Szczepan no i odnośnie zasięgu to szczęka opada (w porównaniu do klasycznego rozwiązania z chińską tanią płytką CC1101).

1 Like