Watermeter - DIEHL IZAR RC I R4 - How to do?

Ok, could it be that it is also due to the Rasberry PI4, I am using a Raspberry P3B with firmware 4.14.93-Re4son-v7 +.

Maybe you can sell NANO-CUL to-masz
see: Question on NANO-CUL (mbus) 868 Mhz · Issue #3 · zibous/ha-watermeter · GitHub

Hi, I’ve just had a meter installed by Severn Trent in the UK:

I’m getting the following from the test:

15:10:45	[D]	[wmbus:184]	
Meter ID [0x32502971] RSSI: -63 dBm LQI: 128 Mode: T1 not found in configuration T: 5E44A511712950327C077A18005005957E2B712BFB380A541D21A79AD7D3A68964CC4BE9A11C894BF7350D19FD8CFA9CFDFCFDFEB821FF4AB827ACBCFAD4ED0F53E60F742C34129B9309914F693680667F1B9D61DF866FF1CF0995C1F78290 (95)

The messages I get don’t seem to analyse properly. https://wmbusmeters.org/analyze/5E44A511712950327C077A18005005957E2B712BFB380A541D21A79AD7D3A68964CC4BE9A11C894BF7350D19FD8CFA9CFDFCFDFEB821FF4AB827ACBCFAD4ED0F53E60F742C34129B9309914F693680667F1B9D61DF866FF1CF0995C1F78290

Any guidance at all on what i’m doing wrong?

I also get one random message of length 47:

15:47:24 [I] [wmbus:084]
Using driver ‘izar’ for ID [0x32502971] RSSI: -60 dBm LQI: 128 Mode: T1 T: 2E44A511712950327C077A1B0020255880EB29D37780CA3BB0E8FE42B85E3AB5F30BDFDEBCF2866DF956FB3C27E84A (47)

https://wmbusmeters.org/analyze/2E44A511712950327C077A1B0020255880EB29D37780CA3BB0E8FE42B85E3AB5F30BDFDEBCF2866DF956FB3C27E84A

It seems to indicate an encryption key is required. Is that right? If so, where would I get this from and how do I add it to the configuration?

Hi @jamesdean, ST Water have just upgraded water meter to the same as yours - IZAR RC 868 i W G4.

Did you manage to make get yours working? I’ve tried using a ESP32/CC1101 approach (GitHub - zibous/ha-watermeter: Data provider for smartmeter watermeter.) but it doesn’t seem to pick anything up in the test.

It may be due to the following reasons:

  • ESP32 + CC1101 is not working properly (but should be visible in the logging).
  • Watermeter is too far away or provides a weak signal.
  • You need a key to decode the telegram

For testing you can find ready-made firmware here:

1 Like

Hi Amardeep, ST Water recently installed an IZAR RC 868 i W G4 meter outside my property and I am interested in creating a device to obtain the water useage reading without having to go outside the property.

Prior to purchasing any items I would appreciate if you could let me know if you manage to get your ESP32/CC1101 device to obtain the readings.

Any guidance you could provide would be appreciated.

Hi jamesdean, ST Water recently installed an IZAR RC 868 i W G4 meter outside my property and I am interested in creating a device to obtain the water useage reading without having to go outside the property.

Did you manage to resolve the issues that you had?

I would appreciate any guidance that you could provide regarding hardware used and if an encryption key is required.

Sadly not. I managed to get a connection, however ST refused to hand over the encryption key. It sounds like they use one key for all meters!

Thanks for your reply, it’s doubtful then that it will be possible to obtain the encryption key but if I see anything I will let you know.

1 Like

Hi Petsi. I run this test file and I could read my meter when analyzing the frame. Nevertheless it wont show values in my application from → ha-watermeter/esphome/wm-esp32-test.yaml at 3001bd06ae586ba7607d0a7c78296d947b85514b · zibous/ha-watermeter · GitHub
Does it mean I need an encryption key?
thanks for your reply
oferl

Some watermeter needs a encryption key.

Check with verbose logging:

log_level: "VERBOSE"  # not that logging need memory, so in production mode use "WARN"
log_wmbus: "VERBOSE" # Loglevel for wmbus meters component

Which version esphome ?
Problem see : fault since last esphome update · Issue #46 · zibous/ha-watermeter · GitHub

Is there any chance that mine will work?


Model is HRL-c-G3

Hi,

I don’t think so, more see: Compatibility · Issue #40 · zibous/ha-watermeter · GitHub
Sorry.

I see that but mine is LoRaWAN + 868MHz (the 868MHz is an option but is available according to the picture and confirmed by my water company).

UPDATE: I ordered a CC1101 and hope for the best, it was cheap so even if it is useless, I’ll try :slight_smile:

1 Like

Hi Petsie.
Sorry my late response. I am on 2024.7.2 (core).


I get some readings as you can see but none of them seems to be encoded. What am I doing wrong? Any help would be much appreciated.
tx oferl

Hi again.
some additional remarks. If I leave “wmid” at 0 - CC1101 LQI and CC1101 RSSI display some values. Does that help?
tx
oferl

This is correct, but if you use wmid=0 only the watermeter ID’s will be displayed on the logs.
Only if the watermeter id <> 0 then you will see the decoded data on the dashboard.

Yes - thats what I thought but if I enter my meter id I still see all others as well - funny. I tried with !secret meterid or directly inserted in my file. No change at all. I dont think it has to do with a missing key otherwise not even LQI and RSSI values will be displayed, am I right?
Any other suggestions.
tx for your patience oferl

No LQI and RSSI values are from the CC1101 and if this is working you can see the values otherwise the CC1101 is not working.

I tried with !secret meterid or directly inserted in my file.
Yes this is possible for testing, for production set the Watermeter ID by secrets.

You can try this:

## ---------------------------------------------------------------------------
## WMBUS METER az-delivery-devkit-v4 + CC1101 for Diehl IZAR RC 868 I R4 PL
## Hardware: ESP32 240MHz, 520KB RAM, 4MB Flash
##
## this version shows all watermeters. Use this for the first test
##
##  1. uses the latest wmbusmeter component from github
##
## ---------------------------------------------------------------------------
substitutions:

  ## device settings
  device_name_short: "watermeter-test"
  friendly_name: "Watermeter"
  device_description: "Testcase Wasserzähler ESP32, CUL - CC1101, IZAR module (Diehl IZAR RC 868 I R4 PL (SzczepanLeon) - all watermeters"

  # The format of the name should be author_name.project_name.
  projectname: "Diehl IZAR RC 868.Watermeter"
  appversion: "2.0.7"
  hardware: "ESP32_Devkit_V4"
  location: "Labor"

  # 1. Search Meter ID (wmid="0")
  #   wmid="0"  # all watermeters
  #   log_level: "VERBOSE"
  #   log_wmbus: "VERBOSE"
  #   save and compile and install to device

  #   see log to find the  Meter ID (wmid)
  #   [17:53:37][D][wmbus:182]: Meter ID [0x90620778] RSSI: -87 dBm LQI: 129 Frame: T1 A not found in configuration T:...

  # 2. Edit wmid
  #  +  wmid="0x90620778"
  #  + Compile and install
  #    For produktion set:
  #    log_level: "WARN"
  #    log_wmbus: "WARN"

  wmid: "0"
  ## your watermeter: wmid: !secret watermeterId
  ## wmid: "0x90620778"  # Test other watermeter

  ## logger settings
  log_level: "VERBOSE"  # not that logging need memory, so in production mode use "WARN"
  log_wmbus: "VERBOSE"  # Loglevel for wmbus meters component
  log_baudrate: "0" # 0 disable uart logger messages

## ------------------------------------------------------------------
## HARDWARE az-delivery-devkit-v4
## https://esphome.io/components/esp32
## ------------------------------------------------------------------
esp32:
  board: esp32dev
  framework:
    type: arduino

## ----------------------------------------------------------------
## APPLICATION ESPHOME
## ----------------------------------------------------------------
esphome:
  name: ${device_name_short}
  build_path: ./build/${device_name_short}
  comment: ${device_description}
  on_boot:
    priority: 600
    then:
      - logger.log:
          level: info
          format: "BOOTMESSAGE: device ${device_name_short} API is connected, Device ready!"
      - globals.set:
          id: boot_counter
          value: !lambda "return id(boot_counter)+=1;"
      - component.update: bootcounter

  on_shutdown:
    then:
      - logger.log:
          level: ERROR
          tag: "system"
          format: "BOOTMESSAGE: device ${device_name_short} is down!"

  project:
    # This allows creators to add the project name and version to the compiled code.
    # It is currently only exposed via the logger, mDNS and the device_info response
    # via the native API. The format of the name should be author_name.project_name.
    name: ${projectname}
    version: ${appversion}

  area: ${location}
  platformio_options: {}
  includes: []
  libraries: []
  name_add_mac_suffix: false
  # minimum version of ESPHome required to compile.
  min_version: 2024.6.6

## ----------------------------------------------------------------
## EXTERNAL COMPONENTS
## ----------------------------------------------------------------
external_components:

  # uses the latest version from SzczepanLeon
  # https://github.com/SzczepanLeon/esphome-components
  # You can make ESPHome check the repository every time by setting this option to 0s
  - source: github://SzczepanLeon/esphome-components@main
    refresh: 0s
    components: [wmbus]

## ----------------------------------------------------------------
## GLOBALS VARIABLES
## ----------------------------------------------------------------
globals:

  - id: boot_counter
    type: int
    restore_value: yes
    initial_value: "0"

  - id: last_value
    type: float
    restore_value: yes
    initial_value: "0.00"

  - id: alarm_error_text
    type: std::vector<std::string>
    restore_value: no
    initial_value: '{"no error", "general_alarm","leakage","meter_blocked","back_flow","underflow","overflow","submarine","sensor_fraud","mechanical_fraud"}'

## ------------------------------------------------------------------
## COMPONENT LOGGER
## https://esphome.io/components/logger.html
## ------------------------------------------------------------------
logger:
  id: appslogger
  level: ${log_level}
  baud_rate: ${log_baudrate}
  logs:
    wmbus: ${log_wmbus}
    wMBus-lib: ${log_wmbus}
    sensor: WARN
    sensor.filter: WARN
    text_sensor: WARN
    api.service: ERROR
    json: ERROR
    mqtt: WARN
    scheduler: ERROR
    internal_temperature: ERROR
    wifi: WARN
    component: ERROR
    api: WARN

## ------------------------------------------------------------------
## COMPONENT WIFI
## https://esphome.io/components/wifi.html
## ------------------------------------------------------------------
wifi:
  networks:
  
    - ssid: <edit your wlan ssid>
      password: <edit your wlan ssid password>
      priority: 0.0

  reboot_timeout: 15min
  power_save_mode: LIGHT

  fast_connect: false
  passive_scan: false
  enable_on_boot: true

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${friendly_name} Fallback Hotspot"
    password: <edit your Fallback hotspot password>

## ------------------------------------------------------------------
## COMPONENT Captive Portal
## ------------------------------------------------------------------
## The captive portal component in ESPHome is a fallback mechanism
## for when connecting to the configured WiFi fails.
## https://esphome.io/components/captive_portal.html
## ------------------------------------------------------------------
captive_portal:

## ---------------------------------------------------
## mDNS Component
## https://esphome.io/components/mdns.html
## ---------------------------------------------------
mdns:
  # Both Home Assistant and the ESPHome dashboard use mDNS to identify the IP address
  # of all ESPHome nodes on the network. If mDNS is disabled, they will no longer
  # be able to automatically find your devices.
  disabled: false

## ------------------------------------------------------------------
## COMPONENT Over-the-Air Updates
## https://esphome.io/components/ota/#over-the-air-updates
## ------------------------------------------------------------------
ota:
  platform: esphome
  password: !secret ota_pswd
  on_begin:
    then:
      - logger.log:
          format: "OTA Start"
          tag: "OTA"
          level: WARN
  on_progress:
    then:
      - logger.log:
          level: WARN
          tag: "OTA"
          format: "OTA progress %0.1f%%"
          args: ["x"]
  on_end:
    then:
      - logger.log:
          format: "OTA End"
          tag: "OTA"
          level: WARN
  on_error:
    then:
      - logger.log:
          format: "OTA update error %d"
          tag: "OTA"
          level: ERROR
          args: ["x"]

## ------------------------------------------------------------------
## COMPONENT WEBSERVER
## The web_server component creates a simple web server on the node
## that can be accessed through any browser and a simple REST API.
## https://esphome.io/components/web_server.html
## ------------------------------------------------------------------
web_server:
  port: 80
  version: 3
  local: false

## ---------------------------------------------------
## Home Assistant API COMPONENT
## ---------------------------------------------------
api:
  id: espapi_wmbus_esp32
  port: 6053
  reboot_timeout: 0s

## ---------------------------------------------------
## SNTP COMPONENT
## ---------------------------------------------------
time:
  - platform: sntp
    id: time_sntp
    timezone: Europe/Berlin
    servers:
      - 0.at.pool.ntp.org
      - 0.pool.ntp.org
      - 1.pool.ntp.org
    on_time_sync:
      then:
        - logger.log:
            tag: "system"
            level: INFO
            format: "Synchronized sntp clock"


## ------------------------------------------------------------------
##           WMBUS CC1101 --> ESP32 az-delivery-devkit-v4
## ------------------------------------------------------------------
##
##
##                                                               o 1 (3.3V)
##                                                               |
##   ╭――x――x――x――x――x――x――x――x――x――x――x――x――x――x――x――x――x――x――x――o―╮
##   |                                                             |
##   |                                                             |
## - | 5v               az-delivery-devkit-v4                      | -- ANT
##   |                                                             |
##   |                          16 17 5  18 19               23    |
##   ╰――x――x――x――x――x――x――x――x――o――x――o――o――o――o――o――o――o――o――o――o―╯
##                              |  |  |  |  |                 |   |
##                              o  |  |  o  |                 |   ╰-o - 2 (GND)
##                              7  o  |  4  o                 o
##                            GDO0 6  | CLK 5                 3
##                               GD02 o    MISO              M0SI
##                                    8
##                                   CSN
##
## ------------------------------------------------------------------
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)

  # log_unknown (Optional): Show telegrams from not configured meters in log.
  # Defaults to False
  log_unknown: True


## ---------------------------------------------------
## SWITCHES, BUTTONS
## ---------------------------------------------------
button:
  # reset boot counter value
  - platform: template
    name: Device Boot Counter reset
    entity_category: "config"
    icon: mdi:restart
    on_press:
      then:
        - lambda: |-
            id(boot_counter) = 0;
            id(bootcounter).publish_state(id(boot_counter));
        - logger.log:
            level: WARN
            tag: "system"
            format: "${device_name_short} reset boot counter o.k!"
        - component.update: bootcounter

  - platform: safe_mode
    name: "Device Restart (Safe Mode)"
    icon: mdi:restart
    entity_category: "config"
    disabled_by_default: false

  - platform: restart
    name: "Device Restart"
    id: restart_switch
    icon: mdi:restart
    entity_category: "config"
    disabled_by_default: false

  - platform: factory_reset
    name: Device Restart Factory
    icon: mdi:restart
    entity_category: "config"
    disabled_by_default: false

## ---------------------------------------------------
## SENSORS
## ---------------------------------------------------
sensor:

  - 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
    # edit watermeterid in the secrets file
    meter_id: ${wmid}
    type: izar
    add_prefix: true

    # The LQI value reported by the CC1101 is a 7 bit unsigned number with a range from 0 to 127.
    # Note that a lower value indicates a better link.
    # The LQI of a received packet will be bad (higher number) when there is lot of interference.
    lqi:
      id: wmbus_cc1101_lqi
      name: "CC1101 LQI"
      unit_of_measurement: "lqi"
      icon: mdi:rss
      entity_category: "diagnostic"

    # The RSSI value reported by the CC1101 is a 8 bit signed number with an effective
    # range from -138 dBm to -10.5 dBm when the CC1101 is operating around 868 MHz.
    # RSSI stands for received signal strength (power) indication (in dBm).
    # A higher value indicates higher power.
    rssi:
      id: wmbus_cc1101_rssi
      name: "CC1101 RSSI"
      icon: mdi:wifi-strength-1
      unit_of_measurement: "dbm"
      entity_category: "diagnostic"

    # reports the watermeter display value
    total_water_m3:
      id: "waterdisplay"
      name: "Total water"
      unit_of_measurement: "m³"
      state_class: total_increasing
      device_class: "water"
      accuracy_decimals: 3
      icon: mdi:counter
      # update and calulatet all watermeter data values
      on_value:
        then:
          - lambda: |-
              ESP_LOGI("wmbus", "Water Display value: %.3f, last value: %.3f", id(waterdisplay).state, id(last_value));
              id(last_value)=id(waterdisplay).state;
          - text_sensor.template.publish:
              id: watermeter_lastupdate
              state: !lambda return id(time_sntp).now().strftime("%Y-%m-%dT%H:%M:%S %Z");

    # get the last month total watermter m3 from the wmbus telegram  (wM-Bus 2.1.10)
    last_month_total_water_m3:
      name: "Water last month"
      id: "waterdisplay_lastmonth"
      unit_of_measurement: "m³"
      state_class: total_increasing
      device_class: "water"
      accuracy_decimals: 3
      icon: mdi:counter

    # water current month (wM-Bus v2.1.4)
    current_month_total_water_l:
      name: "Water current month"
      id: "watermonth"
      accuracy_decimals: 2
      unit_of_measurement: "L"
      state_class: total_increasing
      device_class: "water"

    # get the battery life time (wM-Bus v2.1.4)
    remaining_battery_life_y:
      name: "Battery Life"
      id: "watermeter_batterie"
      accuracy_decimals: 2
      unit_of_measurement: "Years"
      icon: mdi:battery

    # get the last transmit periode (wM-Bus v2.1.4)
    transmit_period_s:
      name: "Intervall"
      id: "watermeter_transmit_periode"
      unit_of_measurement: "sec"
      accuracy_decimals: 2
      icon: mdi:timelapse

    ## get the current watermeter alarms and publish the text message (wM-Bus 2.1.10)
    current_alarms:
      id: "watermeter_current_alarms"
      name: "Current alarm code"
      icon: mdi:alarm-light
      entity_category: "diagnostic"

    ## get the prevois watermeter alarms and publish the text message (wM-Bus 2.1.10)
    previous_alarms:
      id: "watermeter_previous_alarms"
      name: "Pervious alarm code"
      icon: mdi:alarm-light
      entity_category: "diagnostic"

  # device uptime in hours
  - platform: uptime
    name: Device Uptime
    id: device_uptime
    icon: mdi:clock-start
    filters:
      - lambda: return x / 3600;
    unit_of_measurement: "h"
    entity_category: "diagnostic"
    state_class: "measurement"
    accuracy_decimals: 2

  # device internal temperature
  - platform: internal_temperature
    name: Device Internal Temperature
    id: device_internal_temperature
    icon: mdi:thermometer-lines
    state_class: "measurement"
    update_interval: 60s
    entity_category: "diagnostic"
    disabled_by_default: true

  - platform: wifi_signal
    id: wifisignal
    name: Device WiFi Signal
    icon: mdi:wifi-strength-1
    update_interval: 60s
    entity_category: diagnostic
    disabled_by_default: true
    force_update: false
    unit_of_measurement: dBm
    accuracy_decimals: 0
    device_class: signal_strength
    state_class: measurement

  # device boot counter
  - platform: template
    name: Device Boot counter
    id: bootcounter
    icon: mdi:counter
    accuracy_decimals: 0
    state_class: "measurement"
    entity_category: "diagnostic"
    lambda: return (id(boot_counter));

## ---------------------------------------------------
## TEXT SENSOREN
## https://esphome.io/components/text_sensor/
## ---------------------------------------------------
text_sensor:

  # Wifi Info (parts only on webserver)
  # https://esphome.io/components/text_sensor/wifi_info.html
  - platform: wifi_info

    ssid:
      name: Device WIFI WLAN SSID
      id: wlan_ssid
      icon: mdi:wifi-settings
      entity_category: "diagnostic"

    bssid:
      name: Device WIFI WLAN BSSID
      icon: mdi:wifi-star
      disabled_by_default: true
      entity_category: "diagnostic"

    ip_address:
      name: Device WIFI IP Address
      icon: mdi:ip
      disabled_by_default: true
      entity_category: "diagnostic"

    dns_address:
      name: Device WIFI DNS Address
      icon: mdi:dns
      disabled_by_default: true
      entity_category: "diagnostic"

  # waterdisplay timestamp last update (updated by id: "waterdisplay")
  - platform: template
    name: Timestamp
    id: watermeter_lastupdate
    icon: mdi:clock-start
    entity_category: "diagnostic"

  # installed esphome version
  - platform: version
    name: ESPHome Version
    id: eshome_version
    hide_timestamp: true
    disabled_by_default: true
    icon: mdi:information-box-outline

## E.O.F

if all is working you can see this:

Hi Petsie.
thanks for your support but no luck so far. Using meter id “0” I got this in diagnostics:


using my meter id i got this:

The most interessting values “sensor and control” is displayed NA for both.
Just to be sure are you confident my C1101 is working proberly? I dont have an Ozi to verify. Would you suggest a longer antenna? In some docs there is given a 8.3cm antenna. Mine is only 2cm. What do you think.
thanks for your patience and support
oferl