# Komponent wM-Bus do ESPHome (SzczepanLeon) - liczniki energii elektrycznej

**URL:** <https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562>\
**Category:** ESPHome\
**Tags:** licznik-energii, cc1101, esphome\
**Created:** [31 Styczeń 2023 15:37 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562 "2023-01-31T15:37:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Autor:** ![jgrycz](https://forum.arturhome.pl/letter_avatar_proxy/v4/letter/j/da6949/32.png) [@jgrycz](https://forum.arturhome.pl/u/jgrycz)\
**Data wpisu:** [31 Styczeń 2023 15:37 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/1 "2023-01-31T15:37:53Z")

</div>

# mod-edit: Ten wątek jest dedykowany dla liczników energii elektrycznej.

Tematy ogólne proszę poruszać w [źródłowym wątku](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-wersja-2-x-watek-ogolny/9117)…  
Na pozostałe rodzaje liczników zostały też wydzielone osobne wątki podlinkowane w powyższym.

* * *

Cześć @_Szczepan

Właśnie odpaliłem ESP ze skonfigurowanym klientem. Lecz z poziomu dodatku `wmbusmeters` widzę tylko telegramy z IZARa, dlatego chciałem się zapytać czy jestem w stanie odebrać telegramy z innych typów liczników które nie są wspierane przez przez Twój projekt, ale jest mozliwośc obsługi z poziomu wmbusmeters? Chodzi mi o licznik Ami Plus od Taurona.

---

<div class="post-metadata">

**Autor:** ![\_Szczepan](https://forum.arturhome.pl/user_avatar/forum.arturhome.pl/_szczepan/32/14143_2.png) [@\_Szczepan](https://forum.arturhome.pl/u/_Szczepan)\
**Data wpisu:** [31 Styczeń 2023 15:46 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/2 "2023-01-31T15:46:50Z")

</div>

> [@jgrycz](#):
>
> czy jestem w stanie odebrać telegramy z innych typów liczników które nie są wspierane przez przez Twój projekt

Jesteś wstanie odebrać telegramy z wszystkiego co nadaje na 868,95 MHz z modem T1 (tak CC1101 jest ustawiony w komponencie/bibliotece).

Czy AMIPlus nadaje ramki T1 to nie wiem, z informacji w internecie, wygląda że tak (ale są szyfrowane == musisz znać klucz). Tutaj jest obiecujący dokument [https://amiplus.tauron-dystrybucja.pl/-/media/offer-documents/amiplus/amiplus-modu-wireless-m-bus.ashx](https://amiplus.tauron-dystrybucja.pl/-/media/offer-documents/amiplus/amiplus-modu-wireless-m-bus.ashx)

Jak odbierzesz ramkę daj znać. Przeczytaj punkt 4. Domyślnie wMBus jest wyłączony. Musisz do Taurona napisać.

---

<div class="post-metadata">

**Autor:** ![jgrycz](https://forum.arturhome.pl/letter_avatar_proxy/v4/letter/j/da6949/32.png) [@jgrycz](https://forum.arturhome.pl/u/jgrycz)\
**Data wpisu:** [31 Styczeń 2023 16:48 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/3 "2023-01-31T16:48:20Z")

</div>

Super, dzięki bardzo za info! Tak wiem wiem, HANa aktywowałem jakiś czas temu, więc juz posiadam klucz, może dam trochę bliżej odbiornik i zobaczymy 🙂

---

<div class="post-metadata">

**Autor:** ![\_Szczepan](https://forum.arturhome.pl/user_avatar/forum.arturhome.pl/_szczepan/32/14143_2.png) [@\_Szczepan](https://forum.arturhome.pl/u/_Szczepan)\
**Data wpisu:** [31 Styczeń 2023 18:02 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/4 "2023-01-31T18:02:11Z")

</div>

> [@jgrycz](#):
>
> dam trochę bliżej odbiornik i zobaczymy

Daj znać czy coś odebrało.

---

<div class="post-metadata">

**Autor:** ![jgrycz](https://forum.arturhome.pl/letter_avatar_proxy/v4/letter/j/da6949/32.png) [@jgrycz](https://forum.arturhome.pl/u/jgrycz)\
**Data wpisu:** [31 Styczeń 2023 21:35 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/5 "2023-01-31T21:35:17Z")

</div>

Hmm widzę, że brama garażowa to chyba zbyt duża przeszkoda, udało mi się odebrać jeden telegram, akurat wtedy gdy wyjeżdżałem autem. Oto telegram:  
`4e4401068240088602027a000040052f2f0e035131250200000B2B180200066d004915ff21400c78824008860BaBc8fc100000000e833c3814000000000BaB3c0000000afdc9fc0135022f2f2f2f2f`

**EDIT** :

Co ciekawe to ramka z mqtt wygladąda tak:

```auto
{
    "media": "electricity",
    "meter": "amiplus",
    "name": "energy_from_amiplus",
    "id": "86084082",
    "total_energy_consumption_kwh": 2253.151,
    "current_power_consumption_kw": 0.218,
    "total_energy_production_kwh": 1.438,
    "current_power_production_kw": 0,
    "voltage_at_phase_1_v": 235,
    "device_date_time": "2023-01-31 21:09:00",
    "timestamp": "2023-01-31T20:09:01Z",
    "device": "rtlwmbus[cmd_0]",
    "rssi_dbm": -63
}

```

A więc rssi=-63, to tak średnio, lecz co mnie jeszcze zastanawia to ` "total_energy_production_kwh": 1.438,` gdzie ja nie mam fotowoltaiki…

---

<div class="post-metadata">

**Autor:** ![\_Szczepan](https://forum.arturhome.pl/user_avatar/forum.arturhome.pl/_szczepan/32/14143_2.png) [@\_Szczepan](https://forum.arturhome.pl/u/_Szczepan)\
**Data wpisu:** [31 Styczeń 2023 21:57 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/6 "2023-01-31T21:57:39Z")

</div>

> [@jgrycz](#):
>
> lecz co mnie jeszcze zastanawia to ` "total_energy_production_kwh": 1.438,` gdzie ja nie mam fotowoltaiki

No jest to OBIS 2.8.0 więc coś oddajesz 😉  
Sprawdź czy ta wartość się zmienia. Jak tak to bym wyjaśniał z Tauronem. Jak nie to osobiście bym olał.

---

<div class="post-metadata">

**Autor:** ![Scorcerer](https://forum.arturhome.pl/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Scorcerer](https://forum.arturhome.pl/u/Scorcerer)\
**Data wpisu:** [31 Styczeń 2023 22:41 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/7 "2023-01-31T22:41:02Z")

</div>

Hejka!  
postawiłem dziś D1 mini + CC1101 i działa bez zarzutu (może trochę czułość niska, ale szczególnie to nie przeszkadza w moim przypadku) - zasilanie normalnie z USB, żadnych udziwnień (no może tyle że zlutowałem nie na kabelku a na płytce prototypowej do D1 żeby mieć “moduł” radia 868.

Czy mogę prosić o dodanie sterownika elf do listy? wmbusmeters czyta aż miło:

```auto
[22:31:44][D][wmbus:087]: Meter ID [0x00041459] RSSI: -71 dBm not found in configuration T: 4D4401865914040015377247338101010640040C040020026CFA210E0A6503736009000C13857073030A5A42040A5E5503
440EA659010001FD0C010A6545240AFD4737030A270819047F00000002 (78)
[22:32:12][D][wmbus:087]: Meter ID [0x00041639] RSSI: -76 dBm not found in configuration T: 4D440186391604001537725521810101064004B2040020026CF2210E0A5221833604000C13645241020A5A46040A5E1004
440E65A6000001FD0C010A6502240AFD4736030A270819047F00000002 (78)
[22:33:47][D][wmbus:087]: Meter ID [0x00041459] RSSI: -73 dBm not found in configuration T: 4D4401865914040015377247338101010640040D040020026CFA210E0A6503736009000C13857073030A5A42040A5E5503
440EA659010001FD0C010A6565240AFD4737030A270819047F00000002 (78)

```

Pozdrawiam ( i dziękuję za super projekt!)

---

<div class="post-metadata">

**Autor:** ![Mariusz\_Woszczyński](https://forum.arturhome.pl/user_avatar/forum.arturhome.pl/mariusz_woszczy%C5%84ski/32/13154_2.png) [@Mariusz\_Woszczyński](https://forum.arturhome.pl/u/Mariusz_Woszczy%C5%84ski)\
**Data wpisu:** [31 Styczeń 2023 23:39 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/8 "2023-01-31T23:39:07Z")

</div>

> [@jgrycz](#):
>
> lecz co mnie jeszcze zastanawia to ` "total_energy_production_kwh": 1.438,` gdzie ja nie mam fotowoltaiki

Moze czytasz licznik sąsiada 😁

---

<div class="post-metadata">

**Autor:** ![\_Szczepan](https://forum.arturhome.pl/user_avatar/forum.arturhome.pl/_szczepan/32/14143_2.png) [@\_Szczepan](https://forum.arturhome.pl/u/_Szczepan)\
**Data wpisu:** [1 Luty 2023 08:57 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/9 "2023-02-01T08:57:43Z")

</div>

@Scorcerer @jgrycz Spróbujcie z wersją 1.3.8, czy poprawnie dekoduje telegramy itp. Coś na szybko w nocy dodałem.

---

<div class="post-metadata">

**Autor:** ![jgrycz](https://forum.arturhome.pl/letter_avatar_proxy/v4/letter/j/da6949/32.png) [@jgrycz](https://forum.arturhome.pl/u/jgrycz)\
**Data wpisu:** [1 Luty 2023 22:03 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/10 "2023-02-01T22:03:03Z")

</div>

> [@\_Szczepan](#):
>
> @jgrycz Spróbujcie z wersją 1.3.8, czy poprawnie dekoduje telegramy itp. Coś na szybko w nocy dodałem.

dzięki @_Szczepan, wiesz co ok 16 wrzucałem soft, dodałem też licznik energii bo widziałem, że dodałeś amiplus! Wielkie dzięki!

Jak nie miałem auta w garażu(???), to byłem w stanie odebrać jakieś ramki co jakiś czas ale nadal jakość sygnału była bardzo słaba.  
Po tym jak zobaczyłem, że coś odbieram to dodałem licznik bezpośrednio z poziomu ESP, lecz niestety nie byłem w stanie zdekodować telegramu i waliło errorem, a w ciągu dnia dostawałem dość sporo takich komunikatów lecz teraz jest cisza i nie mam jak skopiować logów.

Dlatego jutro będę monitorował sytuację i wrzucę jak się coś pojawi.

Edit:

Ooo udało mi się coś odebrać:) dzięki @_Szczepan ! Lecę postawić Ci kawę!

 ![Obraz](https://forum.arturhome.pl/uploads/default/original/2X/6/664e16dbd32afaeee08de64c4ac6a3b4ddaefaec.jpeg)

Edit 2:  
Po całym dniu pracy sytuacja wygląda jak na poniższym obrazku:

 ![Screenshot 2023-02-02 at 22.47.42](https://forum.arturhome.pl/uploads/default/original/2X/9/9e56624aba34dd3fa0aa63a11ddb51fca92f4c7d.png)

Bez problemu byłem w stanie odebrać telegram co 3-4 minuty (przy słabej jakości sygnału), dopóki nie wjechałem autem do garażu, widocznie 1,5 Tony zelaza I blachy wpływa na odbiornik, zadałem kumplowi po telekomunikacji to pytanie, zobaczymy co odpowie, lecz tymczasem jedzie do mine dedykowana antenna.

@_Szczepan wstyd mi prosić, ale byłaby opcja dodania tych 2 pol: `current_power_consumption_kw` I `voltage_at_phase_1_v` ?

---

<div class="post-metadata">

**Autor:** ![Scorcerer](https://forum.arturhome.pl/letter_avatar_proxy/v4/letter/s/839c29/32.png) [@Scorcerer](https://forum.arturhome.pl/u/Scorcerer)\
**Data wpisu:** [3 Luty 2023 08:55 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/11 "2023-02-03T08:55:48Z")

</div>

Bajlando! Działa znów od strzała, co prawda jednostka jest niezbyt i wypluwa tylko jedną wartość a nie cały datagram, ale historia już się tworzy i spróbuję na weekendzie dodać więcej (jak mi się uda to stworzę ci MR).  
Bardzo, BARDZO dziękuję 🙂

---

<div class="post-metadata">

**Autor:** ![\_Szczepan](https://forum.arturhome.pl/user_avatar/forum.arturhome.pl/_szczepan/32/14143_2.png) [@\_Szczepan](https://forum.arturhome.pl/u/_Szczepan)\
**Data wpisu:** [3 Luty 2023 09:06 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/12 "2023-02-03T09:06:00Z")

</div>

> [@jgrycz](#):
>
> @_Szczepan wstyd mi prosić, ale byłaby opcja dodania tych 2 pol: `current_power_consumption_kw` I `voltage_at_phase_1_v` ?

Multi-sensory z jednego telegramu czekają na refaktoryzację kodu.  
**edit - 2023.04.29**  
**Dodałem wersję 2.0.0 z obsługą tych pól i multi-sensorów.**

> [@Wątek archiwalny - Komponent wM-Bus do ESPHome (SzczepanLeon) starsze wersje do 1.5.1 włącznie](https://forum.arturhome.pl/t/watek-archiwalny-komponent-wm-bus-do-esphome-szczepanleon-starsze-wersje-do-1-5-1-wlacznie/7548/366):
>
> co prawda jednostka jest niezbyt i wypluwa tylko jedną wartość

Powinno wypluwać w kWh (wartość, a jednostkę musisz nadpisać w yamlu - było już w wątku).  
Co do jednej wartości to niestety tak z obecnym kodem jest - chcesz więcej to wysyłaj telegram do wmbusmeters’a i potem po np. mqtt do HA.

---

<div class="post-metadata">

**Autor:** ![Dariusz\_Barczyński](https://forum.arturhome.pl/letter_avatar_proxy/v4/letter/d/9fc29f/32.png) [@Dariusz\_Barczyński](https://forum.arturhome.pl/u/Dariusz_Barczy%C5%84ski)\
**Data wpisu:** [29 Kwiecień 2023 08:58 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/14 "2023-04-29T08:58:00Z")

</div>

Możesz mi podpowiedzieć jak w wersji 2.xxx  
dodać offset  
filters:  
offset: -247.466

---

<div class="post-metadata">

**Autor:** ![\_Szczepan](https://forum.arturhome.pl/user_avatar/forum.arturhome.pl/_szczepan/32/14143_2.png) [@\_Szczepan](https://forum.arturhome.pl/u/_Szczepan)\
**Data wpisu:** [29 Kwiecień 2023 08:59 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/15 "2023-04-29T08:59:47Z")

</div>

Powinno tak samo sie dodawac.  
To jest atrybut sensora. Wiec w 2.x musi byc o poziom nizej (pod total\_water\_m3).

---

<div class="post-metadata">

**Autor:** ![Dariusz\_Barczyński](https://forum.arturhome.pl/letter_avatar_proxy/v4/letter/d/9fc29f/32.png) [@Dariusz\_Barczyński](https://forum.arturhome.pl/u/Dariusz_Barczy%C5%84ski)\
**Data wpisu:** [29 Kwiecień 2023 09:09 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/16 "2023-04-29T09:09:24Z")

</div>

Offset jest ok,  
A co z nazwami sensorów dodaje mi przed nazwą nr wodomierza  
0x61085 ESP\_wodomierz\_  
Musi tak być?

---

<div class="post-metadata">

**Autor:** ![\_Szczepan](https://forum.arturhome.pl/user_avatar/forum.arturhome.pl/_szczepan/32/14143_2.png) [@\_Szczepan](https://forum.arturhome.pl/u/_Szczepan)\
**Data wpisu:** [29 Kwiecień 2023 09:24 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/17 "2023-04-29T09:24:51Z")

</div>

Nie musi tak byc:

> <https://github.com/SzczepanLeon/esphome-components/issues/20>
>
> Hi ,
> 
> Thanks, great job for the new version 2.0 - like this 💯 .
> 
> But the com…ponent add the watermeterid tot \`total\_water\_m3\` and i can not overwrite this.
> 
> !\[Bildschirmfoto 2023-04-29 um 09 05 15\](https://user-images.githubusercontent.com/30198737/235289173-bb7eb3fd-53b6-4729-9936-a86519c468af.png)
> 
> Also on \`lqi\`and \`rss\`. I can use a workound (using template \`copy\` but this needs memory on the device.
> 
> \`\`\`
> \## ---------------------------------------------------------------------------
> \## WMBUS METER az-delivery-devkit-v4 + CC1101 for Diehl IZAR RC 868 I R4 PL
> \##
> \## usage: 1. Using Homassistant API (discovery + devices)
> \## 2. Using HTTP Post to service server (optional)
> \## 3. Using wmbusmeters i a pipe (optional)
> \## 4. Reports free heap map on logging (optional)
> \##
> \## Project: https://github.com/zibous/ha-watermeter
> \## ---------------------------------------------------------------------------
> substitutions:
> ## device settings
> device\_name\_short: "water-meter-esp"
> device\_description: "Wasserzähler ESP32, CUL - CC1101, IZAR module (Diehl IZAR RC 868 I R4 PL (SzczepanLeon)"
> projectname: "OE9psj.wmbus-esp"
> domain: !secret domain
> 
> update\_interval: 60s # Set to never to disable updates. Defaults to 60s.
> log\_level: "INFO" # use VERBOSE mode to find the meterId 0x43430778
> appversion: "1.1.7"
> 
> ## data service
> service\_url: !secret service\_host
> service\_enabled: "false"
> service: "izar.watermeter"
> 
> esphome:
> name: ${device\_name\_short}
> comment: ${device\_description}
> project:
> name: ${projectname}
> version: ${appversion}
> build\_path: ./build/${device\_name\_short}
> 
> # ----------------------------------------------------------------
> # External components for wmbusmeter
> # ----------------------------------------------------------------
> on\_boot:
> # At this priority, pretty much everything should already be initialized.
> priority: -100.0
> then:
> - globals.set:
> id: boot\_counter
> value: !lambda "return id(boot\_counter)+=1;"
> - logger.log:
> level: INFO
> tag: "BOOT"
> format: "BOOTMESSAGE:${device\_name\_short} API is connected, Device ready!"
> on\_shutdown:
> priority: 700
> then:
> - logger.log:
> level: INFO
> tag: "BOOT"
> format: "BOOTMESSAGE:${device\_name\_short} is down!"
> 
> \# ----------------------------------------------------------------
> \# az-delivery-devkit-v4
> \# ----------------------------------------------------------------
> esp32:
> board: az-delivery-devkit-v4
> framework:
> type: arduino
> 
> \## ----------------------------------------------------------------
> \## External components
> \## ----------------------------------------------------------------
> external\_components:
> # use local component from
> # https://github.com/SzczepanLeon/esphome-components
> #- source:
> # type: local
> # path: custom\_components
> # components: \[wmbus\]
> 
> - source: github://SzczepanLeon/esphome-components@main
> refresh: 0d
> components: \[wmbus \]   
> 
> # use local component from
> # https://github.com/zdzichu6969/esphome-components
> - source:
> type: local
> path: custom\_components
> components: \[backup\]
> 
> # use local component from
> # https://github.com/TheStaticTurtle/esphome\_syslog
> - source:
> type: local
> path: custom\_components
> components: \[syslog\]
> 
> # use local component from
> # https://github.com/ssieb/custom\_components/tree/master/components/heapmon
> # - source:
> # type: local
> # path: custom\_components
> # components: \[heapmon\]
> 
> \## ---------------------------------------------------
> \## syslog service
> \## ---------------------------------------------------
> syslog:
> ip\_address: !secret syslog\_server
> port: !secret syslog\_port
> min\_level: DEBUG
> enable\_logger: true
> 
> \## ----------------------------------------------------------------
> \## Global variables
> \## ----------------------------------------------------------------
> globals:
> 
> - id: boot\_counter
> type: int
> restore\_value: yes
> initial\_value: "0"
> 
> - id: int\_default
> type: int
> restore\_value: no
> initial\_value: "0"
> 
> - id: float\_default
> type: float
> restore\_value: no
> initial\_value: "0.00"
> 
> - id: m3toliter
> type: float
> initial\_value: "1000.00"
> restore\_value: yes
> 
> - id: last\_value
> type: float
> restore\_value: yes
> initial\_value: "0.00"
> 
> - id: current\_value
> type: float
> restore\_value: yes
> initial\_value: "0.00"
> 
> - id: hour\_value
> type: float
> restore\_value: yes
> initial\_value: "0.00"
> 
> - id: daily\_value
> type: float
> restore\_value: yes
> initial\_value: "0.00"
> 
> - id: yesterday\_value
> type: float
> restore\_value: yes
> initial\_value: "0.00"
> 
> - id: week\_value
> type: float
> restore\_value: yes
> initial\_value: "0.00"
> 
> - id: month\_value
> type: float
> restore\_value: yes
> initial\_value: "0.00"
> 
> - id: lastmonth\_value
> type: float
> restore\_value: yes
> initial\_value: "0.00"
> 
> - id: year\_value
> type: float
> restore\_value: yes
> initial\_value: "0.00"
> 
> \## ---------------------------------------------------
> \## WIFI Settings 3 wifis
> \## ---------------------------------------------------
> wifi:
> networks:
> - ssid: !secret ssid3\_name
> password: !secret ssid3\_pswd
> priority: 0
> - ssid: !secret ssid1\_name
> password: !secret ssid1\_pswd
> priority: 1
> - ssid: !secret ssid2\_name
> password: !secret ssid2\_pswd
> priority: 2
> domain: !secret domain
> 
> \# The captive portal component in ESPHome is a fallback mechanism for
> \# when connecting to the configured WiFi fails.
> captive\_portal:
> 
> logger:
> id: appslogger
> level: ${log\_level}
> baud\_rate: 0 #disable logging over uart
> 
> \## ---------------------------------------------------
> \## OTA Updates
> \## ---------------------------------------------------
> ota:
> password: !secret ota\_pswd
> on\_error:
> then:
> - logger.log:
> level: INFO
> format: "OTA update error %d"
> args: \["x"\]
> 
> \## ----------------------------------------------------------------------
> \## LOCAL WEBSERVER Settings, local settings - no internet
> \## Include supporting javascript locally allowing it to work
> \## without internet access.
> \## local: true ## without internet access.
> \## local: false ## with internet access.
> \## ----------------------------------------------------------------------
> web\_server:
> port: 80
> version: 2
> local: true
> 
> \## ---------------------------------------------------
> \# Enable Home Assistant API
> \## ---------------------------------------------------
> \# Homeassistant service call:
> \# service: esphome.set\_watermeter\_esp\_data
> \# data:
> \# water\_val\_hour: 0.03
> \# water\_val\_day: 0.248
> \# water\_val\_yesterday: 0.178
> \# water\_val\_week: 0.248
> \# water\_val\_month: 1.94
> \# water\_val\_year: 14.256
> \# water\_val\_lastmonth: 9.59
> \## ---------------------------------------------------
> api:
> id: espapi\_wmbus\_esp32
> port: 6053
> reboot\_timeout: 0s
> services:
> - service: set\_watermeter\_esp\_data
> variables:
> water\_val\_hour: float
> water\_val\_day: float
> water\_val\_yesterday: float
> water\_val\_week: float
> water\_val\_month: float
> water\_val\_year: float
> water\_val\_lastmonth: float
> then:
> - globals.set:
> id: hour\_value
> value: !lambda |-
> if((water\_val\_hour) and (water\_val\_hour)\>0.001){
> ESP\_LOGI("main", "Set hourly value to: %f", water\_val\_hour);
> return (water\_val\_hour);
> }else{
> ESP\_LOGI("main", "Skip setting hourly value");
> return id(hour\_value);
> };
> id(waterhour).publish\_state(id(hour\_value));
> 
> - globals.set:
> id: daily\_value
> value: !lambda |-
> if((water\_val\_day) and (water\_val\_day)\>0.001){
> ESP\_LOGI("main", "Set daily value to: %f", water\_val\_day);
> return (water\_val\_day);
> }else{
> ESP\_LOGI("main", "Skip setting hourly value");
> return id(hour\_value);
> };
> id(waterday).publish\_state(id(daily\_value));
> 
> - globals.set:
> id: yesterday\_value
> value: !lambda |-
> if((water\_val\_yesterday) and (water\_val\_yesterday)\>0.001){
> ESP\_LOGI("main", "Set yesterday value to: %f", water\_val\_yesterday);
> return (water\_val\_yesterday);
> }else{
> ESP\_LOGI("main", "Skip setting yesterday value");
> return id(yesterday\_value);
> };
> id(wateryesterday).publish\_state(id(hour\_value));
> 
> - globals.set:
> id: week\_value
> value: !lambda |-
> if((water\_val\_week) and (water\_val\_week)\>0.001){
> ESP\_LOGI("main", "Set weekly value to: %f", water\_val\_week);
> return (water\_val\_week);
> }else{
> ESP\_LOGI("main", "Skip setting weekly value");
> return id(week\_value);
> };
> id(waterweek).publish\_state(id(week\_value));
> 
> - globals.set:
> id: month\_value
> value: !lambda |-
> if((water\_val\_month) and (water\_val\_month)\>0.001){
> ESP\_LOGI("main", "Set last montj value to: %f", water\_val\_month);
> return (water\_val\_month);
> }else{
> ESP\_LOGI("main", "Skip setting monthly value");
> return id(week\_value);
> };
> id(watermonth).publish\_state(id(month\_value));
> 
> - globals.set:
> id: lastmonth\_value
> value: !lambda |-
> if((water\_val\_lastmonth) and (water\_val\_lastmonth)\>0.001){
> ESP\_LOGI("main", "Set last month value to: %f", water\_val\_lastmonth);
> return (water\_val\_lastmonth);
> }else{
> ESP\_LOGI("main", "Skip setting last month value");
> return id(lastmonth\_value);
> };
> id(waterlastmonth).publish\_state(id(lastmonth\_value));
> 
> - globals.set:
> id: year\_value
> value: !lambda |-
> if((water\_val\_year) and (water\_val\_year)\>0.001){
> ESP\_LOGI("main", "Set last yearly value to: %f", water\_val\_year);
> return (water\_val\_year);
> }else{
> ESP\_LOGI("main", "Skip setting last yearly value");
> return id(week\_value);
> };
> id(wateryear).publish\_state(id(year\_value));
> 
> - logger.log:
> format: "All new Values set: hour: %.3f, day: %.3f, week: %.3f, month: %.3f, lastmonth: %.3f, year: %.3f"
> args:
> \[
> "id(hour\_value)",
> "id(daily\_value)",
> "id(week\_value)",
> "id(month\_value)",
> "id(lastmonth\_value)",
> "id(year\_value)",
> \]
> 
> \## ---------------------------------------------------
> \## SNTP Time server
> \## ---------------------------------------------------
> time:
> - platform: sntp
> id: sntp\_time
> timezone: Europe/Berlin
> servers:
> - 0.at.pool.ntp.org
> - 0.pool.ntp.org
> - 1.pool.ntp.org
> 
> on\_time\_sync:
> then:
> - logger.log: "Synchronized sntp clock"
> 
> # reset hourly value
> on\_time:
> - seconds: 0
> minutes: 0
> then:
> - globals.set:
> id: hour\_value
> value: "0.00"
> - lambda: id(waterhour).publish\_state(id(hour\_value));
> - logger.log: Reset value hour, starting next hour
> 
> # reset daily value and set yesterday value
> - seconds: 0
> minutes: 0
> hours: 0
> then:
> - lambda: id(yesterday\_value)=id(daily\_value);
> - lambda: id(wateryesterday).publish\_state(id(yesterday\_value));
> - lambda: id(daily\_value)=0.00;
> - lambda: id(waterday).publish\_state(id(daily\_value));
> - logger.log: Set yesterday value and reset value daily, starting new day
> 
> # reset weekly value, start new week
> - seconds: 0
> minutes: 0
> hours: 0
> days\_of\_week: MON
> then:
> - globals.set:
> id: week\_value
> value: "0.00"
> - lambda: id(waterweek).publish\_state(id(week\_value));
> - logger.log: Reset value weekly, starting new week
> 
> # reset monthly value and set last month value
> - seconds: 0
> minutes: 0
> hours: 0
> days\_of\_month: 1
> then:
> - globals.set:
> id: month\_value
> value: "0.00"
> - lambda: id(watermonth).publish\_state(id(month\_value));
> - lambda: |-
> if(id(waterdisplay).state){
> id(lastmonth\_value)=id(waterdisplay).state;
> }
> - logger.log: Reset value monthly, starting new month
> 
> # new year, reset yearly value
> - seconds: 0
> minutes: 0
> hours: 0
> days\_of\_month: 1
> months: JAN
> then:
> - globals.set:
> id: year\_value
> value: "0.00"
> - lambda: id(wateryear).publish\_state(id(year\_value));
> - logger.log: Reset value yearly, starting new year
> 
> \## ---------------------------------------------------
> \## Prepare for sending HTTP requests
> \## ---------------------------------------------------
> http\_request:
> id: http\_request\_data
> useragent: ${service}
> timeout: 10s
> 
> \## ---------------------------------------------------
> \## Post resultdata to the service url
> \## ---------------------------------------------------
> script:
> - id: post\_device\_state
> then:
> - if:
> condition:
> lambda: return "${service\_enabled} =='true'";
> then:
> - logger.log: "Post new data to the ${service\_url}${device\_name\_short}, service enabled: ${service\_enabled}"
> - http\_request.post:
> url: "${service\_url}/${device\_name\_short}"
> verify\_ssl: false
> headers:
> Content-Type: application/json
> json: |-
> root\["device"\] = "${device\_name\_short}";
> root\["waterdisplay"\] = id(waterdisplay).state;
> root\["current"\] = id(id(watercurrent)).state;
> root\["hour"\] = id(waterhour).state;
> root\["day"\] = id(waterday).state;
> root\["yesterday"\] = id(wateryesterday).state;
> root\["week"\] = id(waterweek).state;
> root\["month"\] = id(watermonth).state;
> root\["lastmonth"\] = id(waterhour).state;
> root\["year"\] = id(wateryear).state;
> root\["bootcounter"\] = id(bootcounter).state;
> root\["version"\] = "${device\_name\_short} ${appversion}";
> root\["time"\] = id(sntp\_time).now().strftime("%Y-%m-%d %H:%M:%S");
> on\_response:
> then:
> - lambda: |-
> if (status\_code == 200) {
> } else {
> ESP\_LOGI ("http\_post", "HTTP POST failed");
> }
> 
> \## ---------------------------------------------------
> \## WMBUS CC1101 --\> ESP32
> \## https://github.com/LSatan/SmartRC-CC1101-Driver-Lib/blob/master/img/Esp32\_CC1101.png
> \## ---------------------------------------------------
> \##
> \## | 3.3V
> \## - - - - - - - - - - - - - - - - - - x
> \## | 5v ESP32 | ANT
> \## - - - - x - x x x x x x - - - - - x x
> \## | | | | | | |
> \## | | | | | | | GND
> \## GD00 | | | | | |
> \## GD02 M0SI
> \## CSN
> \## SCK
> \## MISO
> \## -------------------------------------------------
> wmbus:
> mosi\_pin: GPIO23 ## SI: braun
> miso\_pin: GPIO19 ## SO: grün
> clk\_pin: GPIO18 ## SCLK: violett
> cs\_pin: GPIO05 ## CSN: orange
> gdo0\_pin: GPIO16 ## GD00: gelb (rx)
> gdo2\_pin: GPIO17 ## GD02: weiss (tx)
> 
> ## -------------------------------------------------
> ## Using wmbusmeters i a pipe (optional)
> ## uncomment for using
> ## -------------------------------------------------
> # clients:
> # - name: "wmbusmeters"
> # ip\_address: !secret wmbusmeter\_host
> # port: 7227
> # format: rtlwMBus
> # transport: UDP
> 
> ## -------------------------------------------------
> ## setting: wmbusmeters.conf wbusmeters server
> ## -------------------------------------------------
> ## loglevel: normal
> ## device: rtlwmbus:CMD(nc -lku 7227)
> ## donotprobe: /dev/ttyAMA0
> ## logtelegrams: false
> ## format: json
> ## logfile: /dev/stdout
> ## shell: /wmbusmeters/mosquitto\_pub.sh "wmbusmeters/$METER\_NAME" "$METER\_JSON"
> 
> ## -------------------------------------------------
> ## led blink mode (optional)
> ## -------------------------------------------------
> # led\_pin: GPIO02 ## D4 Build\_in LED
> # led\_blink\_time: "100ms"
> 
> \# ----------------------------------------------------------------
> \# Save your ESPHome device configuration in firmware and and
> \# recover it if you lost source files.
> \# ----------------------------------------------------------------
> \# Just download it from http://water-meter-esp.local/config.yaml
> backup:
> auth:
> username: !secret web\_username
> password: !secret web\_password
> force\_update: false
> 
> \## ---------------------------------------------------
> \## SWITCHES
> \## ---------------------------------------------------
> switch:
> # reset boot counter value
> - platform: template
> name: Reset Boot Counter
> turn\_on\_action:
> then:
> - lambda: |-
> id(boot\_counter) = id(int\_default);
> id(bootcounter).publish\_state(id(boot\_counter));
> - logger.log:
> level: INFO
> tag: "BOOT"
> format: "${device\_name\_short} reset boot counter o.k!"
> 
> # reset all global vars
> - platform: template
> name: Reset values
> turn\_on\_action:
> then:
> - lambda: |-
> id(last\_value) = id(float\_default);
> id(boot\_counter) = id(int\_default);
> id(bootcounter).publish\_state(id(boot\_counter));
> id(current\_value) = id(float\_default);
> id(watercurrent).publish\_state(id(current\_value));
> id(hour\_value) = id(float\_default);
> id(waterhour).publish\_state(id(hour\_value));
> id(daily\_value) = id(float\_default);
> id(waterday).publish\_state(id(daily\_value));
> id(yesterday\_value) = id(float\_default);
> id(wateryesterday).publish\_state(id(yesterday\_value));
> id(week\_value) = id(float\_default);
> id(waterweek).publish\_state(id(week\_value));
> id(month\_value) = id(float\_default);
> id(watermonth).publish\_state(id(month\_value));
> id(lastmonth\_value) = id(float\_default);
> id(waterlastmonth).publish\_state(id(lastmonth\_value));
> id(year\_value) = id(float\_default);
> id(wateryear).publish\_state(id(year\_value));
> - logger.log: all values reset!
> 
> - platform: restart
> name: "Restart"
> id: restart\_switch
> 
> \## ---------------------------------------------------
> \## SENSORS
> \## ---------------------------------------------------
> sensor:
> # water display
> - platform: wmbus
> # Meter ID (usually from sticker). Can be specified as decimal or hex.
> # only hex is working for my watermeter !
> # see: https://github.com/SzczepanLeon/esphome-components/issues/6
> meter\_id: !secret watermeterId
> type: izar
> lqi:
> id: wmbus\_cc1101\_lqi
> rssi:      
> id: wmbus\_cc1101\_rssi
> total\_water\_m3:
> name: "Wasseruhr Anzeige"
> id: "waterdisplay"
> unit\_of\_measurement: "m³"
> state\_class: total\_increasing
> device\_class: "water"
> accuracy\_decimals: 3
> on\_value:
> then:
> - lambda: |-
> ESP\_LOGI("SENSOR", "Water Display value: %.3f, last value: %.3f", id(waterdisplay).state, id(last\_value));
> if ((id(last\_value) \> 0.00) and (id(waterdisplay).state)\>(id(last\_value)) ) {
> id(current\_value) = (id(waterdisplay).state-id(last\_value)) \* id(m3toliter);
> id(watercurrent).publish\_state(id(current\_value));
> id(hour\_value)+=id(current\_value);
> id(waterhour).publish\_state(id(hour\_value));
> id(daily\_value)+=id(current\_value);
> id(waterday).publish\_state(id(daily\_value));
> id(week\_value)+=id(current\_value);
> id(waterweek).publish\_state(id(week\_value));
> id(month\_value)+=id(current\_value);
> id(watermonth).publish\_state(id(month\_value));
> id(year\_value)+=id(current\_value);
> id(wateryear).publish\_state(id(year\_value));
> ESP\_LOGI("SENSOR", "Set current value to %.3f litre and publish the data", id(current\_value));
> if ( ${service\_enabled} == true){
> id(post\_device\_state).execute();
> }else{
> ESP\_LOGI("SENSOR", "Data Service to host disabled");
> }
> }else{
> id(current\_value) = 0.00;
> id(watercurrent).publish\_state(id(current\_value));
> ESP\_LOGI("SENSOR", "Reset current value to: %.3f", id(current\_value));
> }
> id(last\_value)=id(waterdisplay).state;
> 
> - text\_sensor.template.publish:
> id: watermeter\_lastupdate
> state: !lambda |-
> char str\[20\];
> time\_t currTime = id(sntp\_time).now().timestamp;
> strftime(str, sizeof(str), "%Y-%m-%dT%H:%M:%S", localtime(&currTime));
> return (std::string) str;
> 
> # water current
> - platform: template
> name: Wasser Aktuell
> id: "watercurrent"
> accuracy\_decimals: 2
> unit\_of\_measurement: "L"
> state\_class: "measurement"
> device\_class: "water"
> lambda: |-
> return (id(current\_value));
> 
> # water current hour
> - platform: template
> name: Wasser Stunde
> id: "waterhour"
> accuracy\_decimals: 2
> unit\_of\_measurement: "L"
> state\_class: total\_increasing
> device\_class: "water"
> lambda: |-
> return (id(hour\_value));
> 
> # water today
> - platform: template
> name: Wasser Tag
> id: "waterday"
> accuracy\_decimals: 2
> unit\_of\_measurement: "L"
> device\_class: "water"
> state\_class: total\_increasing
> lambda: |-
> return (id(daily\_value));
> 
> # water yesterday
> - platform: template
> name: Wasser Gestern
> id: "wateryesterday"
> accuracy\_decimals: 2
> unit\_of\_measurement: "L"
> device\_class: "water"
> state\_class: total\_increasing
> lambda: |-
> return (id(yesterday\_value));
> 
> # water current week
> - platform: template
> name: Wasser Woche
> id: "waterweek"
> accuracy\_decimals: 2
> unit\_of\_measurement: "L"
> device\_class: "water"
> state\_class: total\_increasing
> lambda: |-
> return (id(week\_value));
> 
> # water current month
> - platform: template
> name: Wasser Monat
> id: "watermonth"
> accuracy\_decimals: 2
> unit\_of\_measurement: "L"
> state\_class: total\_increasing
> device\_class: "water"
> lambda: |-
> return (id(month\_value));
> 
> # water current year
> - platform: template
> name: Wasser Jahr
> id: "wateryear"
> accuracy\_decimals: 2
> unit\_of\_measurement: "L"
> state\_class: total\_increasing
> device\_class: "water"
> lambda: |-
> return (id(year\_value));
> 
> # water last month
> - platform: template
> name: Wasser letzer Monat
> id: "waterlastmonth"
> accuracy\_decimals: 2
> unit\_of\_measurement: "L"
> state\_class: "measurement"
> device\_class: "water"
> lambda: |-
> return (id(lastmonth\_value));
> 
> # device boot counter
> - platform: template
> name: Boot counter
> id: bootcounter
> accuracy\_decimals: 0
> state\_class: "measurement"
> entity\_category: "diagnostic"
> lambda: |-
> return (id(boot\_counter));
> 
> # device uptime human reading format
> # only internal used (memory bug D1MINI ??)
> - platform: uptime
> name: Uptime
> id: uptime\_sensor
> internal: true
> update\_interval: ${update\_interval}
> unit\_of\_measurement: seconds
> on\_raw\_value:
> then:
> - text\_sensor.template.publish:
> id: uptime\_human
> state: !lambda |-
> int seconds = round(id(uptime\_sensor).raw\_state);
> int days = seconds / (24 \* 3600);
> seconds = seconds % (24 \* 3600);
> int hours = seconds / 3600;
> seconds = seconds % 3600;
> int minutes = seconds / 60;
> seconds = seconds % 60;
> return (
> (days ? String(days) + "d " : "") +
> (hours ? String(hours) + "h " : "") +
> (minutes ? String(minutes) + "m " : "") +
> (String(seconds) + "s")
> ).c\_str();
> 
> # Wifi quality RSSI
> # only internal used (memory bug D1MINI ??)
> - platform: wifi\_signal
> name: Wlan Signal
> id: wifi\_signal\_db
> update\_interval: 60s
> internal: true
> entity\_category: "diagnostic"
> 
> # Wifi quality RSSI in percentage
> # # Received Signal Strength (RSSI) is a measure of incoherent (raw) RF power in a channel.
> - platform: copy # Reports the WiFi signal strength in %
> source\_id: wifi\_signal\_db
> name: "Wlan ESP32 Qualität"
> filters:
> - lambda: return min(max(2 \* (x + 100.0), 0.0), 100.0);
> unit\_of\_measurement: "Signal %"
> entity\_category: "diagnostic"
> 
> # CC1101 quality LQI
> # Link Quality Indication (LQI) is a cumulative value used in multi-hop networks to assess the cost of a link. 
> - platform: copy 
> source\_id: wmbus\_cc1101\_lqi
> name: "Wlan CC1101 LQI"    
> entity\_category: "diagnostic"
> 
> # CC1101 quality RSSI in percentage
> # Received Signal Strength (RSSI) is a measure of incoherent (raw) RF power in a channel.
> - platform: copy 
> source\_id: wmbus\_cc1101\_rssi
> name: "Wlan CC1101 RSSI"
> filters:
> - lambda: return min(max(2 \* (x + 100.0), 0.0), 100.0);
> unit\_of\_measurement: "Signal %"
> entity\_category: "diagnostic"
> 
> # Shows free space ESP.getFreeHeap
> # only for logging
> # - platform: heapmon
> # id: heapspace
> # internal: true
> # name: "Free Space"
> # state\_class: "measurement"
> # entity\_category: "diagnostic"
> 
> \## ---------------------------------------------------
> \## BINARY SENSOR
> \## ---------------------------------------------------
> binary\_sensor:
> # simulate led state
> - platform: template
> name: Status Led
> id: statusled
> entity\_category: "diagnostic"
> lambda: "return id(current\_value) \> 0;"
> 
> \## ---------------------------------------------------
> \## TEXT SENSOR
> \## ---------------------------------------------------
> text\_sensor:
> # device version
> # disabled for api (memory ??)
> - platform: version
> name: Version
> id: appver
> internal: true
> entity\_category: "diagnostic"
> 
> # device online time
> # disabled for api (memory ??)
> - platform: template
> name: Online seit
> id: uptime\_human
> internal: true
> icon: mdi:clock-start
> entity\_category: "diagnostic"
> 
> # waterdisplay last update
> - platform: template
> name: Zählerstand aktualisiert
> id: watermeter\_lastupdate
> icon: mdi:clock-start
> entity\_category: "diagnostic"
> 
> # device timestamp
> # disabled for api (memory ??)
> - platform: template
> name: Timestamp
> id: systime
> entity\_category: "diagnostic"
> internal: true
> lambda: char str\[20\];
> time\_t currTime = id(sntp\_time).now().timestamp;
> strftime(str, sizeof(str), "%Y-%m-%dT%H:%M:%S", localtime(&currTime));
> return (std::string) str;
> 
> # simple rest get message for all watermeter data
> # curl -i http://water-meter-esp.local/text\_sensor/watermeterdata
> - platform: template
> id: watermeterdata
> update\_interval: ${update\_interval}
> internal: true
> lambda: |-
> char buf\[512\];
> sprintf(buf, "%.3f|%.3f|%.3f|%.3f|%.3f|%.3f|%.3f|%.3f|%.3f|%s",
> id(waterdisplay).state,
> id(current\_value),
> id(hour\_value),
> id(daily\_value),
> id(yesterday\_value),
> id(week\_value),
> id(month\_value),
> id(lastmonth\_value),
> id(year\_value),
> id(systime).state.c\_str()
> );
> std::string s = buf;
> return s;
> 
> \# eof water-meter-izar.yaml
> 
> \`\`\`

---

<div class="post-metadata">

**Autor:** ![Dariusz\_Barczyński](https://forum.arturhome.pl/letter_avatar_proxy/v4/letter/d/9fc29f/32.png) [@Dariusz\_Barczyński](https://forum.arturhome.pl/u/Dariusz_Barczy%C5%84ski)\
**Data wpisu:** [29 Kwiecień 2023 09:43 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/18 "2023-04-29T09:43:11Z")

</div>

Dziękuję  
Działa jak natura chciała 🙂  
Super praca

---

<div class="post-metadata">

**Autor:** ![yack1](https://forum.arturhome.pl/letter_avatar_proxy/v4/letter/y/8491ac/32.png) [@yack1](https://forum.arturhome.pl/u/yack1)\
**Data wpisu:** [29 Kwiecień 2023 10:21 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/19 "2023-04-29T10:21:07Z")

</div>

A mi nie odczytuje licznika wody i nie działa mimo zmian w yaml do wersji 2.0, kompilacji i wgraniu  
Konfigurcja jak poniżej

```auto
esphome:
  name: wodomierz
  friendly_name: Wodomierz

esp8266:
  board: nodemcuv2

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

# Enable logging
logger:
 level: DEBUG

time:
 - platform: sntp
   id: time_sntp

# Enable Home Assistant API
api:
  encryption:
    key: "g6rdTxkkmj7ggMsBrqzWLShM0VK7r0aY6MlXYFUEUfU="

ota:
  password: "e04233b0acb1fe1564125236727eba12"

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

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

captive_portal:

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

  led_pin: GPIO0
  led_blink_time: "1s"

  clients:
    - name: "wmbusmeters"
      ip_address: "10.0.0.1"
      port: 7227

sensor:
 - platform: wmbus # pierwszy licznik
   meter_id: 0x21319041
   type: izar
   lqi:
     name: "Moj licznik wody 45"
   rssi:
     name: "My ww45"
   total_water_m3:
     name: "Stan licznika wody 45"
     accuracy_decimals: 3
# unit_of_measurement: "m3" #opcjonalnie, np. w przypadku liczników prądu
# filters: 
 - platform: wmbus # drugi licznik
   total_water_m3:
      name: "Stan licznika wody 43"
   meter_id: 0x213151E4
   type: izar
 - platform: wmbus # trzeci licznik
   total_water_m3:
     name: "Stan licznika wody 47"
   meter_id: 0x4140F00D
   type: izar

```

log otrzymuje taki:

```auto
INFO Reading configuration /config/esphome/wodomierz.yaml...
INFO Updating https://github.com/SzczepanLeon/esphome-components.git@main
INFO Detected timezone 'Europe/Warsaw'
INFO Generating C++ source...
INFO Compiling app...
Processing wodomierz (board: nodemcuv2; framework: arduino; platform: platformio/espressif8266 @ 3.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
Dependency Graph
|-- ESPAsyncTCP-esphome @ 1.2.3
|-- ESPAsyncWebServer-esphome @ 2.1.0
| |-- ESPAsyncTCP-esphome @ 1.2.3
| |-- Hash @ 1.0
| |-- ESP8266WiFi @ 1.0
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.4
| |-- libsodium @ 1.10018.1
|-- wMbus-lib @ 1.1.1+sha.da2558f
| |-- SPI @ 1.0
| |-- SmartRC-CC1101-Driver-Lib @ 2.5.7
Compiling /data/wodomierz/.pioenvs/wodomierz/src/main.cpp.o
Linking /data/wodomierz/.pioenvs/wodomierz/firmware.elf
RAM: [=====] 45.9% (used 37640 bytes from 81920 bytes)
Flash: [=====] 51.3% (used 536121 bytes from 1044464 bytes)
Building /data/wodomierz/.pioenvs/wodomierz/firmware.bin
esp8266_copy_factory_bin(["/data/wodomierz/.pioenvs/wodomierz/firmware.bin"], ["/data/wodomierz/.pioenvs/wodomierz/firmware.elf"])
========================= [SUCCESS] Took 24.59 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of wodomierz.local
INFO -> 192.168.10.250
INFO Uploading /data/wodomierz/.pioenvs/wodomierz/firmware.bin (540272 bytes)
INFO Compressed to 377414 bytes
Uploading: [============================================================] 100% Done...

INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from wodomierz.local using esphome API
WARNING Can't connect to ESPHome API for wodomierz.local: Error resolving IP address: [Errno -5] No address associated with hostname
INFO Trying to reconnect to wodomierz.local in the background
INFO Successfully connected to wodomierz.local
[11:34:22][I][app:102]: ESPHome version 2023.4.2 compiled on Apr 29 2023, 11:33:37
[11:34:22][C][wifi:505]: WiFi:
[11:34:22][C][wifi:363]: Local MAC: 48:3F:DA:A9:96:BA
[11:34:22][C][wifi:364]: SSID: 'ASUS'[redacted]
[11:34:22][C][wifi:365]: IP Address: 192.168.10.250
[11:34:22][C][wifi:366]: BSSID: E0:3F:49:E0:ED:E0[redacted]
[11:34:22][C][wifi:368]: Hostname: 'wodomierz'
[11:34:22][C][wifi:370]: Signal strength: -53 dB ▂▄▆█
[11:34:22][C][wifi:374]: Channel: 12
[11:34:22][C][wifi:375]: Subnet: 255.255.255.0
[11:34:22][C][wifi:376]: Gateway: 192.168.10.1
[11:34:22][C][wifi:377]: DNS1: 192.168.10.1
[11:34:22][C][wifi:378]: DNS2: 0.0.0.0
[11:34:22][C][logger:294]: Logger:
[11:34:22][C][logger:295]: Level: DEBUG
[11:34:22][C][logger:296]: Log Baud Rate: 115200
[11:34:22][C][logger:297]: Hardware UART: UART0
[11:34:22][C][captive_portal:088]: Captive Portal:
[11:34:22][C][mdns:108]: mDNS:
[11:34:22][C][mdns:109]: Hostname: wodomierz
[11:34:22][C][ota:093]: Over-The-Air Updates:
[11:34:22][C][ota:094]: Address: wodomierz.local:8266
[11:34:22][C][ota:097]: Using Password.
[11:34:22][C][api:138]: API Server:
[11:34:22][C][api:139]: Address: wodomierz.local:6053
[11:34:22][C][api:141]: Using noise encryption: YES
[11:34:22][C][sntp:053]: SNTP Time:
[11:34:22][C][sntp:054]: Server 1: '0.pool.ntp.org'
[11:34:22][C][sntp:055]: Server 2: '1.pool.ntp.org'
[11:34:22][C][sntp:056]: Server 3: '2.pool.ntp.org'
[11:34:22][C][sntp:057]: Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[11:34:22][C][wmbus:284]: wM-Bus v2.0.5:
[11:34:22][C][wmbus:286]: Clients:
[11:34:22][C][wmbus:288]: wmbusmeters: 10.0.0.1:7227 TCP [rtl-wmbus]
[11:34:22][C][wmbus:297]: LED:
[11:34:22][C][wmbus:298]: Pin: GPIO0
[11:34:22][C][wmbus:299]: Duration: 1000 ms
[11:34:22][C][wmbus:301]: CC1101 SPI bus:
[11:34:22][C][wmbus:302]: MOSI Pin: GPIO13
[11:34:22][C][wmbus:303]: MISO Pin: GPIO12
[11:34:22][C][wmbus:304]: CLK Pin: GPIO14
[11:34:22][C][wmbus:305]: CS Pin: GPIO2
[11:34:22][C][wmbus:306]: GDO0 Pin: GPIO5
[11:34:22][C][wmbus:307]: GDO2 Pin: GPIO4
[11:34:22][E][wmbus:320]: Check connection to CC1101!
[11:39:10][I][ota:113]: Boot seems successful, resetting boot loop counter.

```

---

<div class="post-metadata">

**Autor:** ![\_Szczepan](https://forum.arturhome.pl/user_avatar/forum.arturhome.pl/_szczepan/32/14143_2.png) [@\_Szczepan](https://forum.arturhome.pl/u/_Szczepan)\
**Data wpisu:** [29 Kwiecień 2023 10:58 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/20 "2023-04-29T10:58:12Z")

</div>

> [@yack1](#):
>
> [11:34:22][E][wmbus:320]: Check connection to CC1101!

Sprawdź pinologie. Coś z połączeniem do CC1101 masz nie tak.

---

<div class="post-metadata">

**Autor:** ![Mariusz\_Woszczyński](https://forum.arturhome.pl/user_avatar/forum.arturhome.pl/mariusz_woszczy%C5%84ski/32/13154_2.png) [@Mariusz\_Woszczyński](https://forum.arturhome.pl/u/Mariusz_Woszczy%C5%84ski)\
**Data wpisu:** [29 Kwiecień 2023 11:20 UTC](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562/21 "2023-04-29T11:20:32Z")

</div>

Niewykluczone, ze radio jest uszkodzone.  
Ja zauważyłem, że chińczycy trochę w ciula tną.  
W ostatnim czasie miałem z 5 nowych, uwalonych CC1101

[Następna strona](https://forum.arturhome.pl/t/komponent-wm-bus-do-esphome-szczepanleon-liczniki-energii-elektrycznej/8562.md?page=2)
