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

To jeszcze przypomnę:

Te wasze ramki jakieś krótkie są. Mój Sharky 745 generuje strasznie długą

7E44A5114954686940047AF4007005EED538812FAE617605999501BC78B7EB798B93109AA6D48B638A243CC235748AD79FEDB6E35598190B835B09E201629D4F8403AAF264B1AF0E8D32608DD6A95E46B170E9F0C5A0F55BFD44B9F051760AAE61353384E8790A8B9D50A3ECBE3A02253D6CC72548F4CEFF89798C63799305

to jest to co dostaję z licznika bez wprowadzonego klucza dla komponentu.
Niestety żadne znalezione w necie klucze nie pomogły tego rozszyfrować.

Dobry wieczór

Od kilkunastu dni próbuję bezskutecznie odczytać w HA (na Proxmox) zużycie wody z następującego zestawu:

  1. Wmbus, CC1101 od Mariusza.
  2. Bmeters GSD8-I z nakładką IWM-TX5.

Niestety HA nie odczytuje zużycia wody z telegramów, a w logach pojawia się komunikat unknown CI field [8C].

Zużycie wody jest widoczne po wklejeniu telegramów na WMBusmeters.org, które jednocześnie podaje, że najlepszym driverem jest c5isf (wpisane do konfiguracji w HA również nic nie pokazuje).

Poczytałem trochę forum i doszedłem do wniosku, że prawdopodobnie dodatek od SzczepanLeon nie dekoduje mojej nakładki, więc próbowałem przesłać ją do pluginu WMBusmeters w HA… Pomimo, że podałem właściwe dane w konfiguracji (dongle jest wpięty do usb terminala) WMBusmeters nie czyta danych. Czy rzucilibyście okiem na moją konfigurację i logi, bo niestety moja znajomość programowania HA sprowadza się do przeklejenia kodu yaml, który znajduję w sieci?

Poniżej konfiguracja dodatku:

esphome:
  name: wodomierz
  friendly_name: wodomierz

esp8266:
  board: nodemcuv2

external_components:
 # - source: github://SzczepanLeon/esphome-components@3.2.0 #wersja 3.2.0
  - source: github://SzczepanLeon/esphome-components@main #zawse na jnowszawersja

    components: [ wmbus ]
    refresh: 0d

# Enable logging
logger:
  level: DEBUG

time:
  - platform: sntp
    id: time_sntp

# Enable Home Assistant API
api:
  encryption:
    key: "eqL27Ob0Ij+0zMqh6xHHNjm6OX+6ESwyS1qnbNJwaE0="

ota:
  password: "88456125abc1520506872727c748f34f"

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

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

# Sekcja dotycząca brokera MQTT
mqtt:
  broker: homeassistant.local
  port: 1883
  username: homeassistant
  password: hie5chiebaoz0oimei8eKieF4tedaima8OxiegheiDa1Yah7zi5ohwieT7rouqui
  discovery_retain: true
web_server:
  port: 80
  version: 2

captive_portal:

wmbus:
  mosi_pin: GPIO13
  miso_pin: GPIO12
  clk_pin:  GPIO14
  cs_pin:   GPIO2
  gdo0_pin: GPIO5
  gdo2_pin: GPIO4

sensor:
  - platform: wmbus #pierwszy licznik
    type: bmeters
    meter_id: 0x23358941
    key: "00000000000000000000000000000000"
    add_prefix: false #nie dodaje ID do e ncji
    lqi:
      name: "LQI wodomierz"
    rssi:
      name: "RSSI wodomierz"
    total_water_m3:
      name: "licznik"
      force_update: true

Log Debug:

INFO ESPHome 2024.5.1
INFO Reading configuration /config/esphome/wodomierz.yaml...
INFO Updating https://github.com/SzczepanLeon/esphome-components.git@main
INFO Detected timezone 'Europe/Warsaw'
INFO Starting log output from 192.168.50.8 using esphome API
INFO Successfully connected to wodomierz @ 192.168.50.8 in 0.005s
INFO Successful handshake with wodomierz @ 192.168.50.8 in 2.611s
[18:23:21][I][app:100]: ESPHome version 2024.5.1 compiled on May 24 2024, 18:18:36
[18:23:22][C][wifi:580]: WiFi:
[18:23:22][C][wifi:408]:   Local MAC: 34:94:54:95:86:D5
[18:23:22][C][wifi:413]:   SSID: '******'[redacted]
[18:23:22][C][wifi:416]:   IP Address: 192.168.50.8
[18:23:22][C][wifi:419]:   BSSID: 44:4E:6D:BC:7E:40[redacted]
[18:23:22][C][wifi:421]:   Hostname: 'wodomierz'
[18:23:22][C][wifi:423]:   Signal strength: -22 dB ▂▄▆█
[18:23:22][C][wifi:427]:   Channel: 11
[18:23:22][C][wifi:428]:   Subnet: 255.255.255.0
[18:23:22][C][wifi:429]:   Gateway: 192.168.50.1
[18:23:22][C][wifi:430]:   DNS1: 192.168.50.1
[18:23:22][C][wifi:431]:   DNS2: 0.0.0.0
[18:23:22][C][logger:185]: Logger:
[18:23:22][C][logger:186]:   Level: DEBUG
[18:23:22][C][logger:188]:   Log Baud Rate: 115200
[18:23:22][C][logger:189]:   Hardware UART: UART0
[18:23:22][C][captive_portal:088]: Captive Portal:
[18:23:22][C][web_server:173]: Web Server:
[18:23:22][C][web_server:174]:   Address: wodomierz.local:80
[18:23:22][C][sntp:055]: SNTP Time:
[18:23:22][C][sntp:056]:   Server 1: '0.pool.ntp.org'
[18:23:22][C][sntp:057]:   Server 2: '1.pool.ntp.org'
[18:23:22][C][sntp:058]:   Server 3: '2.pool.ntp.org'
[18:23:22][C][sntp:059]:   Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[18:23:22][C][mdns:115]: mDNS:
[18:23:22][C][mdns:116]:   Hostname: wodomierz
[18:23:22][C][ota:096]: Over-The-Air Updates:
[18:23:22][C][ota:097]:   Address: wodomierz.local:8266
[18:23:22][C][ota:100]:   Using Password.
[18:23:22][C][ota:103]:   OTA version: 2.
[18:23:22][C][api:139]: API Server:
[18:23:22][C][api:140]:   Address: wodomierz.local:6053
[18:23:22][C][api:142]:   Using noise encryption: YES
[18:23:22][C][mqtt:138]: MQTT:
[18:23:22][C][mqtt:139]:   Server Address: homeassistant.local:1883 (192.168.50.22)
[18:23:22][C][mqtt:141]:   Username: 'homeassistant'[redacted]
[18:23:22][C][mqtt:142]:   Client ID: 'wodomierz-3494549586d5'[redacted]
[18:23:22][C][mqtt:144]:   Discovery prefix: 'homeassistant'
[18:23:22][C][mqtt:145]:   Discovery retain: YES
[18:23:22][C][mqtt:147]:   Topic Prefix: 'wodomierz'
[18:23:22][C][mqtt:149]:   Log Topic: 'wodomierz/debug'
[18:23:22][C][mqtt:152]:   Availability: 'wodomierz/status'
[18:23:22][C][mqtt.sensor:028]: MQTT Sensor 'LQI wodomierz':
[18:23:22][C][mqtt.sensor:032]:   State Topic: 'wodomierz/sensor/lqi_wodomierz/state'
[18:23:22][C][mqtt.sensor:028]: MQTT Sensor 'RSSI wodomierz':
[18:23:22][C][mqtt.sensor:032]:   State Topic: 'wodomierz/sensor/rssi_wodomierz/state'
[18:23:22][C][mqtt.sensor:028]: MQTT Sensor 'licznik':
[18:23:22][C][mqtt.sensor:032]:   State Topic: 'wodomierz/sensor/licznik/state'
[18:23:22][C][wmbus:372]: wM-Bus v3.2.1:
[18:23:22][C][wmbus:389]:   CC1101 frequency: 868.950 MHz
[18:23:22][C][wmbus:390]:   CC1101 SPI bus:
[18:23:22][C][wmbus:391]:     MOSI Pin: GPIO13
[18:23:22][C][wmbus:392]:     MISO Pin: GPIO12
[18:23:22][C][wmbus:393]:     CLK Pin:  GPIO14
[18:23:22][C][wmbus:394]:     CS Pin:   GPIO2
[18:23:22][C][wmbus:395]:     GDO0 Pin: GPIO5
[18:23:22][C][wmbus:396]:     GDO2 Pin: GPIO4
[18:23:22][C][wmbus:403]:   Available drivers:  amiplus, apator08, apator162, apatoreitn, bmeters, c5isf, compact5, dme07, elf, evo868, fhkvdataiii, flowiq2200, hydrocalm3, hydrus, iperl, itron, izar, kamheat, mkradio3, mkradio4, mkradio4a, multical21, qheat, qwater, rfmtx1, sharky774, topaseskr, ultrimis, unismart, vario451
[18:23:22][C][wmbus:421]:   Meter:
[18:23:22][C][wmbus:422]:     ID: 590711105 [0x23358941]
[18:23:22][C][wmbus:423]:     Type: bmeters
[18:23:22][C][wmbus:424]:     Mode: T1
[18:23:22][C][wmbus:425]:     Key: '00000000000000000000000000000000'
[18:23:22][C][wmbus:427]:     Sensor 'LQI wodomierz'
[18:23:22][C][wmbus:427]:       Device Class: 'signal_strength'
[18:23:22][C][wmbus:427]:       State Class: 'measurement'
[18:23:22][C][wmbus:427]:       Unit of Measurement: ''
[18:23:22][C][wmbus:427]:       Accuracy Decimals: 0
[18:23:22][C][wmbus:427]:     Sensor 'RSSI wodomierz'
[18:23:22][C][wmbus:427]:       Device Class: 'signal_strength'
[18:23:22][C][wmbus:427]:       State Class: 'measurement'
[18:23:22][C][wmbus:427]:       Unit of Measurement: 'dBm'
[18:23:22][C][wmbus:427]:       Accuracy Decimals: 0
[18:23:22][C][wmbus:427]:     Sensor 'licznik'
[18:23:22][C][wmbus:427]:       Device Class: 'water'
[18:23:22][C][wmbus:427]:       State Class: 'total_increasing'
[18:23:22][C][wmbus:427]:       Unit of Measurement: 'm³'
[18:23:22][C][wmbus:427]:       Accuracy Decimals: 3
[18:23:22][C][wmbus:427]:       Icon: 'mdi:water'
[18:24:10][D][mbus:034]: Processing T1 A frame
[18:24:10][D][wmbus:090]: Using driver 'bmeters' for ID [0x23358941] RSSI: -48 dBm LQI: 128 Frame: T1 A T: 5144B4094189352318078C00907A490840051F57A21E753BDBA42213125BADBC2D3DF72DB2D74094A73CEC9BDD8A99D474AB31CF4DF95E35940FCCC79C2EC302CC6FD9D7CAA841C9A01EC0535EED7FBFE1DE (82)
[18:24:10][E][utils:214]: (TPL) unknown CI field [8C]
[18:25:10][D][mbus:034]: Processing T1 A frame
[18:25:10][D][wmbus:090]: Using driver 'bmeters' for ID [0x23358941] RSSI: -47 dBm LQI: 128 Frame: T1 A T: 5144B4094189352318078C00917A4A084005966946917CAA113D3401A3AA2E0CDA195DECF73549EEEA04EDB61BDB6CF3A2AE774C1B57B4D446B0137E6F24E04A05CC5296918C553124286D97AB0BDA8B0B5C (82)
[18:25:10][E][utils:214]: (TPL) unknown CI field [8C]

oraz log Verbose:

INFO ESPHome 2024.5.1
INFO Reading configuration /config/esphome/wodomierz.yaml...
INFO Updating https://github.com/SzczepanLeon/esphome-components.git@main
INFO Detected timezone 'Europe/Warsaw'
INFO Starting log output from 192.168.50.8 using esphome API
INFO Successfully connected to wodomierz @ 192.168.50.8 in 0.007s
INFO Successful handshake with wodomierz @ 192.168.50.8 in 2.754s
[18:14:38][I][app:100]: ESPHome version 2024.5.1 compiled on May 22 2024, 17:38:05
[18:14:38][C][wifi:580]: WiFi:
[18:14:38][C][wifi:408]:   Local MAC: 34:94:54:95:86:D5
[18:14:38][C][wifi:413]:   SSID: '******'[redacted]
[18:14:38][C][wifi:416]:   IP Address: 192.168.50.8
[18:14:38][C][wifi:419]:   BSSID: 44:4E:6D:BC:7E:40[redacted]
[18:14:38][C][wifi:421]:   Hostname: 'wodomierz'
[18:14:38][C][wifi:423]:   Signal strength: -21 dB ▂▄▆█
[18:14:38][V][wifi:425]:   Priority: 0.0
[18:14:38][C][wifi:427]:   Channel: 11
[18:14:38][C][wifi:428]:   Subnet: 255.255.255.0
[18:14:38][C][wifi:429]:   Gateway: 192.168.50.1
[18:14:38][C][wifi:430]:   DNS1: 192.168.50.1
[18:14:38][C][wifi:431]:   DNS2: 0.0.0.0
[18:14:38][C][logger:185]: Logger:
[18:14:38][C][logger:186]:   Level: VERBOSE
[18:14:38][C][logger:188]:   Log Baud Rate: 115200
[18:14:38][C][logger:189]:   Hardware UART: UART0
[18:14:38][C][captive_portal:088]: Captive Portal:
[18:14:38][C][web_server:173]: Web Server:
[18:14:38][C][web_server:174]:   Address: wodomierz.local:80
[18:14:38][C][sntp:055]: SNTP Time:
[18:14:38][C][sntp:056]:   Server 1: '0.pool.ntp.org'
[18:14:38][C][sntp:057]:   Server 2: '1.pool.ntp.org'
[18:14:38][C][sntp:058]:   Server 3: '2.pool.ntp.org'
[18:14:38][C][sntp:059]:   Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[18:14:38][C][mdns:115]: mDNS:
[18:14:38][C][mdns:116]:   Hostname: wodomierz
[18:14:38][V][mdns:117]:   Services:
[18:14:38][V][mdns:119]:   - _esphomelib, _tcp, 6053
[18:14:38][V][mdns:121]:     TXT: friendly_name = wodomierz
[18:14:38][V][mdns:121]:     TXT: version = 2024.5.1
[18:14:38][V][mdns:121]:     TXT: mac = 3494549586d5
[18:14:38][V][mdns:121]:     TXT: platform = ESP8266
[18:14:38][V][mdns:121]:     TXT: board = nodemcuv2
[18:14:38][V][mdns:121]:     TXT: network = wifi
[18:14:38][V][mdns:121]:     TXT: api_encryption = Noise_NNpsk0_25519_ChaChaPoly_SHA256
[18:14:38][V][mdns:119]:   - _http, _tcp, 80
[18:14:38][C][ota:096]: Over-The-Air Updates:
[18:14:38][C][ota:097]:   Address: wodomierz.local:8266
[18:14:38][C][ota:100]:   Using Password.
[18:14:38][C][ota:103]:   OTA version: 2.
[18:14:38][C][api:139]: API Server:
[18:14:38][C][api:140]:   Address: wodomierz.local:6053
[18:14:38][C][api:142]:   Using noise encryption: YES
[18:14:39][C][mqtt:138]: MQTT:
[18:14:39][C][mqtt:139]:   Server Address: homeassistant.local:1883 (192.168.50.22)
[18:14:39][C][mqtt:141]:   Username: 'homeassistant'[redacted]
[18:14:39][C][mqtt:142]:   Client ID: 'wodomierz-3494549586d5'[redacted]
[18:14:39][C][mqtt:144]:   Discovery prefix: 'homeassistant'
[18:14:39][C][mqtt:145]:   Discovery retain: YES
[18:14:39][C][mqtt:147]:   Topic Prefix: 'wodomierz'
[18:14:39][C][mqtt:149]:   Log Topic: 'wodomierz/debug'
[18:14:39][C][mqtt:152]:   Availability: 'wodomierz/status'
[18:14:39][C][mqtt.sensor:028]: MQTT Sensor 'LQI wodomierz':
[18:14:39][C][mqtt.sensor:032]:   State Topic: 'wodomierz/sensor/lqi_wodomierz/state'
[18:14:39][C][mqtt.sensor:028]: MQTT Sensor 'RSSI wodomierz':
[18:14:39][C][mqtt.sensor:032]:   State Topic: 'wodomierz/sensor/rssi_wodomierz/state'
[18:14:39][C][mqtt.sensor:028]: MQTT Sensor 'licznik':
[18:14:39][C][mqtt.sensor:032]:   State Topic: 'wodomierz/sensor/licznik/state'
[18:14:39][C][wmbus:372]: wM-Bus v3.2.1:
[18:14:39][C][wmbus:389]:   CC1101 frequency: 868.950 MHz
[18:14:39][C][wmbus:390]:   CC1101 SPI bus:
[18:14:39][C][wmbus:391]:     MOSI Pin: GPIO13
[18:14:39][C][wmbus:392]:     MISO Pin: GPIO12
[18:14:39][C][wmbus:393]:     CLK Pin:  GPIO14
[18:14:39][C][wmbus:394]:     CS Pin:   GPIO2
[18:14:39][C][wmbus:395]:     GDO0 Pin: GPIO5
[18:14:39][C][wmbus:396]:     GDO2 Pin: GPIO4
[18:14:39][C][wmbus:403]:   Available drivers:  amiplus, apator08, apator162, apatoreitn, bmeters, c5isf, compact5, dme07, elf, evo868, fhkvdataiii, flowiq2200, hydrocalm3, hydrus, iperl, itron, izar, kamheat, mkradio3, mkradio4, mkradio4a, multical21, qheat, qwater, rfmtx1, sharky774, topaseskr, ultrimis, unismart, vario451
[18:14:39][C][wmbus:421]:   Meter:
[18:14:39][C][wmbus:422]:     ID: 590711105 [0x23358941]
[18:14:39][C][wmbus:423]:     Type: bmeters
[18:14:39][C][wmbus:424]:     Mode: T1
[18:14:39][C][wmbus:425]:     Key: '00000000000000000000000000000000'
[18:14:39][C][wmbus:427]:     Sensor 'LQI wodomierz'
[18:14:39][C][wmbus:427]:       Device Class: 'signal_strength'
[18:14:39][C][wmbus:427]:       State Class: 'measurement'
[18:14:39][C][wmbus:427]:       Unit of Measurement: ''
[18:14:39][C][wmbus:427]:       Accuracy Decimals: 0
[18:14:39][C][wmbus:427]:     Sensor 'RSSI wodomierz'
[18:14:39][C][wmbus:427]:       Device Class: 'signal_strength'
[18:14:39][C][wmbus:427]:       State Class: 'measurement'
[18:14:39][C][wmbus:427]:       Unit of Measurement: 'dBm'
[18:14:39][C][wmbus:427]:       Accuracy Decimals: 0
[18:14:39][C][wmbus:427]:     Sensor 'licznik'
[18:14:39][C][wmbus:427]:       Device Class: 'water'
[18:14:39][C][wmbus:427]:       State Class: 'total_increasing'
[18:14:39][C][wmbus:427]:       Unit of Measurement: 'm³'
[18:14:39][C][wmbus:427]:       Accuracy Decimals: 3
[18:14:39][C][wmbus:427]:       Icon: 'mdi:water'
[18:14:39][V][wmbus:427]:       Force Update: YES
[18:15:08][V][rxLoop:167]: Have 141 bytes from CC1101 Rx, RSSI: -48 dBm LQI: 128
[18:15:08][D][mbus:034]: Processing T1 A frame
[18:15:08][V][mbus:045]: Frame: 64D71C8DC5A570DB252D938B36C593CA56ACB34596B134E67165AC716599C9994BB0B6968F48F1734A4B68B5ACD0D36C3AC4CB5966A95A5D13C4D993C694DC969D29B1ACB23562F199CA693A5CA559665C5A968E3B13AC8D69B439C6999728F1C59A5A70D8DC59CB194D6B232DC953C8BB3239CA4E3933566A9C5C653A533A34E9374A4E2E3D134DC9743538F4 (141) [RAW]
[18:15:08][V][mbus:052]: Frame: 5144B409418935231807E9688C00877A40084005E5938360BCBD4CF36308C1182873006F09C7D1A7DF749FCF86EE103DA4FF29E900540F622D28B0AC24659EBDD5F641B40485708B3497E38E24F227106FD457F72B7F1CF23BC7749C17BC (94) [with CRC]
[18:15:08][V][mbus:095]: Validating CRC for Block1
[18:15:08][V][mbus:115]: Validating CRC for Block2
[18:15:08][V][crc:031]:     calculated: 0x6308, read: 0x6308
[18:15:08][V][mbus:115]: Validating CRC for Block3
[18:15:08][V][crc:031]:     calculated: 0x103D, read: 0x103D
[18:15:08][V][mbus:115]: Validating CRC for Block4
[18:15:08][V][crc:031]:     calculated: 0xD5F6, read: 0xD5F6
[18:15:08][V][mbus:115]: Validating CRC for Block5
[18:15:08][V][crc:031]:     calculated: 0x57F7, read: 0x57F7
[18:15:08][V][mbus:115]: Validating CRC for Block6
[18:15:09][V][crc:031]:     calculated: 0x17BC, read: 0x17BC
[18:15:09][V][mbus:062]: Frame: 5144B4094189352318078C00877A40084005E5938360BCBD4CF3C1182873006F09C7D1A7DF749FCF86EEA4FF29E900540F622D28B0AC24659EBD41B40485708B3497E38E24F227106FD42B7F1CF23BC7749C (82) [without CRC]
[18:15:09][D][wmbus:090]: Using driver 'bmeters' for ID [0x23358941] RSSI: -48 dBm LQI: 128 Frame: T1 A T: 5144B4094189352318078C00877A40084005E5938360BCBD4CF3C1182873006F09C7D1A7DF749FCF86EEA4FF29E900540F622D28B0AC24659EBD41B40485708B3497E38E24F227106FD42B7F1CF23BC7749C (82)
[18:15:09][E][utils:214]: (TPL) unknown CI field [8C]
[18:15:09][W][component:237]: Component wmbus took a long time for an operation (168 ms).
[18:15:09][W][component:238]: Components should block for at most 30 ms.

Wywal sekcje sensor oraz dodaj sekcje clients

Dziękuję bardzo za szybką odpowiedź:)

Zmieniłem konfigurację i teraz pozostaje mi czekać do poniedziałku na dane z nakładki.

Mam jeszcze pytanie o id nakładki w dodatku wmbusmeters do HA.

Czy id nakładki podaję taki, jak czyta dongle (tj. 0x23358941), czy wystarczy samo 23358941?

Aktualny plik konfiguracyjny wmbusmeters:

device=rtlwmbus:CMD(/usr/bin/nc -lku 9011)
donotprobe=/dev/ttyUSB2
format=json
logfile=/dev/stdout
loglevel=normal
logtelegrams=false
shell=/wmbusmeters/mosquitto_pub.sh "wmbusmeters/$METER_NAME" "$METER_JSON"

konfiguracja meters:

driver=iwmtx5
id=0x23358941
key=00000000000000000000000000000000
name=wodomierz