This repository contains a collection of my custom components for ESPHome.
Use latest ESPHome
with external components and add this to your .yaml
definition:
external_components:
- source: github://SzczepanLeon/esphome-components@main
wmbus
Component to receive wMBus frame (via CC1101), create HA sensor and send decoded value. You can also use this component with wmbusmeters HA addon: https://github.com/SzczepanLeon/esphome-components/blob/main/docs/wmbus.md
NOTE: Configuration for version 3.x is described here
don't know meter type (driver) and don't know ID
wmbus:
all_drivers: True
log_all: True
Then in logs you will have trace with driver name and ID:
[17:13:07][I][wmbus:085]: apator162 [0x00148686] RSSI: -44dBm T: 4e4401068686140005077a350040852f2f0f005B599600000010aa55000041545a42850Bd800437d037301c5500000564B00009e46 (79) T1 A
meter type (driver) and ID are known, but you don't know how to add sensors (map decoded data to sensor)
wmbus:
all_drivers: False
log_all: False
sensor:
- platform: wmbus
meter_id: 0x00148686
type: apator162
key: "00000000000000000000000000000000"
sensors:
- name: "my hot water RSSi"
field: "rssi"
accuracy_decimals: 0
unit_of_measurement: "dBm"
device_class: "signal_strength"
state_class: "measurement"
entity_category: "diagnostic"
Then in logs you will have trace with telegram:
[17:13:07][I][wmbus:085]: apator162 [0x00148686] RSSI: -44dBm T: 4e4401068686140005077a350040852f2f0f005B599600000010aa55000041545a42850Bd800437d037301c5500000564B00009e46 (79) T1 A
You can decode that telegram on wmbusmeters and create sensors.
find interesting data (in that case total_m3), split it into field (total) and unit (m3) and create sensor in YAML. In YAML config please use units from HA (ie. "m³" not "m3", etc).
wmbus:
all_drivers: False
log_all: False
sensor:
- platform: wmbus
meter_id: 0x00148686
type: apator162
key: "00000000000000000000000000000000"
sensors:
- name: "my hot water RSSi"
field: "rssi"
accuracy_decimals: 0
unit_of_measurement: "dBm"
device_class: "signal_strength"
state_class: "measurement"
entity_category: "diagnostic"
- name: "my hot water"
field: "total"
accuracy_decimals: 3
unit_of_measurement: "m³"
device_class: "water"
state_class: "total_increasing"
icon: "mdi:water"
time:
- platform: sntp
id: time_sntp
external_components:
- source: github://SzczepanLeon/esphome-components@main
refresh: 0d
components: [ wmbus ]
wmbus:
mosi_pin: GPIO13
miso_pin: GPIO5
clk_pin: GPIO2
cs_pin: GPIO14
gdo0_pin: GPIO15
gdo2_pin: GPIO16
led_pin: GPIO0
led_blink_time: "1s"
frequency: 868.950
all_drivers: False
sync_mode: True
log_all: True
mqtt:
broker: 10.0.0.88
username: mqttUser
password: mqttPass
clients:
- name: "wmbusmeters"
ip_address: "10.0.0.22"
port: 7227
sensor:
# add driver to compile list (will be available for autodetect), don't create sensor
- platform: wmbus
type: itron
# add sensor with defined type (driver will be also added to compile list)
- platform: wmbus
meter_id: 0x12345678
type: apator162
key: "00000000000000000000000000000000"
sensors:
- name: "my hot water RSSi"
field: "rssi"
accuracy_decimals: 0
unit_of_measurement: "dBm"
device_class: "signal_strength"
state_class: "measurement"
entity_category: "diagnostic"
- name: "my hot water"
field: "total"
accuracy_decimals: 3
unit_of_measurement: "m³"
device_class: "water"
state_class: "total_increasing"
icon: "mdi:water"
# add more sensors, one without field (name will be used)
- platform: wmbus
meter_id: 0xABCD4321
type: amiplus
sensors:
- name: "my current power consumption in Watts"
field: "current_power_consumption"
accuracy_decimals: 1
unit_of_measurement: "w"
device_class: "power"
state_class: "measurement"
icon: "mdi:transmission-tower-import"
- name: "total energy on T1"
field: "total_energy_consumption_tariff_1"
accuracy_decimals: 3
unit_of_measurement: "kwh"
device_class: "energy"
state_class: "total_increasing"
icon: "mdi:transmission-tower-import"
- name: "voltage_at_phase_1"
accuracy_decimals: 0
unit_of_measurement: "v"
device_class: "voltage"
state_class: "measurement"
icon: "mdi:sine-wave"
# sensor with offset, type should be autodetected
- platform: wmbus
meter_id: 0x11223344
sensors:
- name: "cold water from Apator NA-1"
field: "total"
accuracy_decimals: 3
unit_of_measurement: "m³"
device_class: "water"
state_class: "total_increasing"
icon: "mdi:water"
filters:
- offset: 123.0
# if mqtt defined, JSON with all decoded fields will be published to broker
- platform: wmbus
meter_id: 0x22113366
type: vario411
text_sensor:
- platform: wmbus
meter_id: 0xABCD1122
type: izar
sensors:
- name: "Izar current_alarms"
field: "current_alarms"
In wmbus platform:
GPIO13
.GPIO12
.GPIO14
.GPIO2
.GPIO5
.GPIO4
.300 ms
.868.950 MHz
.False
.False
.False
.RTLWMBUS
.TCP
.1883
.False
.NOTE: MQTT can be defined in wmbus component or in ESPHome level.
sensor:
""
.text_sensor:
""
.Supported drivers: almost all from wmbusmeters version 1.17.1 (without drivers from file)
Szczepan, GPL, 2022-2024