Skip to content

Kamstrup Multical 21 water meter in Home Assistant (Wireless MBus) - fork

License

Notifications You must be signed in to change notification settings

drlauridsen/esp32-multical21-pthalins-fork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kamstrup Multical 21 water meter in Home Assistant (Wireless MBus)

Features

  • Configuration ready for Home Assistan with MQTT. This fork has added autodisovery sensors, so no need to edit yaml config files.
  • Support for AES-128 decryption (with vaild key).
  • CRC Check of recived data.
  • Wireless reading of data.
  • Easy to build and configure.

Parts

Use these arfilliate links to support me!
CC1101 Module
ESP32 DevKit
Some cables

Wiring

CC1101 ESP32
VCC 3V3
GND GND
CSN P4
MOSI P23
MISO P19
SCK P18
GD0 P32
GD2 Not Connected

Build and Upload Firmware

  • Make sure you have a decryption key for your meter (you need to ask your water service provider for it).
  • Read the serial number on the meter (typically S/N: XXXXXXXX/A/20, the serial number is the XXXXXXXXX part).
  • Rename credentials_template.h to credentials.h and add your details.
  • Edit the mqttsensorconfig.h file with your device and sensor details.
  • Compile and upload:
    • You need VS Code and the PIO Plugin
    • Open the project folder with the platformio.ini file (File -> Open Folder...), connect the ESP32 via USB then build and upload with Ctrl+Alt+U.

Home Assistant

This fork has autodiscovery sensors enabled by default, so no need to edit the HA yaml file, unless you have disabled autodiscovery either here or in HA.

Setup MQTT if you don't already have it.

Add this to configuration.yaml

mqtt:
  sensor:
    - name: "Water Meter Usage"
      state_topic: "watermeter/0/sensor/mydatajson"
      unit_of_measurement: "m³"
      value_template: "{{ value_json.CurrentValue }}"
      device_class: water
      state_class: total_increasing
      availability:
        - topic: "watermeter/0/online"
          payload_available: "True"
          payload_not_available: "False"
    - name: "Water Meter Month Start Value"
      state_topic: "watermeter/0/sensor/mydatajson"
      unit_of_measurement: "m³"
      value_template: "{{ value_json.MonthStartValue }}"
      device_class: water
      state_class: total_increasing
    - name: "Water Meter Room Temperature"
      state_topic: "watermeter/0/sensor/mydatajson"
      value_template: "{{ value_json.RoomTemp }}"
      unit_of_measurement: "°C"
    - name: "Water Meter Water Temperature"
      state_topic: "watermeter/0/sensor/mydatajson"
      value_template: "{{ value_json.WaterTemp }}"
      unit_of_measurement: "°C"

Donation using Ko-Fi or PayPal are highly appreciated!

This is a based on chester4444/esp-multical21. Thanks to chester4444for his effort.

About

Kamstrup Multical 21 water meter in Home Assistant (Wireless MBus) - fork

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published