Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with DIEHL LNE6250 #55

Open
Anoxym opened this issue Nov 26, 2024 · 15 comments
Open

Compatibility with DIEHL LNE6250 #55

Anoxym opened this issue Nov 26, 2024 · 15 comments

Comments

@Anoxym
Copy link

Anoxym commented Nov 26, 2024

Hi,

Is this project could work with this water meter :

IMG_4927
IMG_4929

Thanks

@SzczepanLeon
Copy link

99% to yes

@Anoxym
Copy link
Author

Anoxym commented Nov 26, 2024

Great thanks I'll try :)

@g0mml
Copy link

g0mml commented Nov 26, 2024

I have the same meter as you and I was able to get the meter ID using the the 🛠 ESP32 Test configuration.
The transmitted telegram contained all the data. I'll now try to use the more complete examples...

@Anoxym
Copy link
Author

Anoxym commented Nov 29, 2024

Hi,

I try to deploy the esp32 test on my esp32 with ESPHome on Home Assistant but it won't work, I don't understand, can we have a minimalist code to get the ID ?

Screenshot 2024-11-29 at 4 05 34 PM

@SzczepanLeon
Copy link

SzczepanLeon commented Nov 29, 2024

Please read informations on my main repo page.
Minimal YAML is described there.

@Anoxym
Copy link
Author

Anoxym commented Nov 29, 2024

Did you have a working esphome configuration to get the ID ?

with this :

wmbus:
all_drivers: True
log_all: True

What did I need to get a working code ?

@zibous
Copy link
Owner

zibous commented Nov 29, 2024

@Anoxym
Copy link
Author

Anoxym commented Nov 29, 2024

I have the same error :

Screenshot 2024-11-29 at 4 35 53 PM

@SzczepanLeon
Copy link

SzczepanLeon commented Nov 29, 2024

Userfriendly solution is ongoing:

20241127_163946.jpg

20241127_141517.jpg

@Anoxym
Copy link
Author

Anoxym commented Nov 29, 2024

It works adding "platform: esphome" :

ota:
platform: esphome
password: "wmi01-testcase"
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"]

We need to be close to the watermeter to get ID ?

@Anoxym
Copy link
Author

Anoxym commented Nov 29, 2024

[17:17:14][V][rxLoop:167]: Have 56 bytes from CC1101 Rx, RSSI: -52 dBm LQI: 128
[17:17:14][D][mbus:034]: Processing T1 A frame
[17:17:14][V][mbus:045]: Frame: 37271C99934D70D38B39638D4E3593966A6C4E6A535963565994DAB255A39ACA65CA538E2E969964EB1CA4E5A6D199AC8D965A9A62D3A72A (56) [RAW]
[17:17:14][V][mbus:052]: Frame: 1E44A511412320217B079AF87AF700100576890BA8F9E9223F655284F20AC5A8B556AA37FE (37) [with CRC]
[17:17:14][V][mbus:095]: Validating CRC for Block1
[17:17:14][V][crc:031]: calculated: 0x9AF8, read: 0x9AF8
[17:17:14][V][mbus:115]: Validating CRC for Block2
[17:17:14][V][crc:031]: calculated: 0xF20A, read: 0xF20A
[17:17:14][V][mbus:115]: Validating CRC for Block3
[17:17:14][V][crc:031]: calculated: 0x37FE, read: 0x37FE
[17:17:14][V][mbus:062]: Frame: 1E44A511412320217B077AF700100576890BA8F9E9223F655284C5A8B556AA (31) [without CRC]
[17:17:14][D][wmbus:182]: Meter ID [0x21202341] RSSI: -52 dBm LQI: 128 Frame: T1 A not found in configuration T: 1E44A511412320217B077AF700100576890BA8F9E9223F655284C5A8B556AA (31)
[17:17:28][V][rxLoop:167]: Have 56 bytes from CC1101 Rx, RSSI: -49 dBm LQI: 128
[17:17:28][D][mbus:034]: Processing T1 A frame
[17:17:28][V][mbus:045]: Frame: 37271C99934D70D38B39638D4E3593966A6C4E6A535963565994DAB255A39ACA65CA538E2E969964EB1CA4E5A6D199AC8D965A9A62D3A72A (56) [RAW]
[17:17:28][V][mbus:052]: Frame: 1E44A511412320217B079AF87AF700100576890BA8F9E9223F655284F20AC5A8B556AA37FE (37) [with CRC]
[17:17:28][V][mbus:095]: Validating CRC for Block1
[17:17:28][V][crc:031]: calculated: 0x9AF8, read: 0x9AF8
[17:17:28][V][mbus:115]: Validating CRC for Block2
[17:17:28][V][crc:031]: calculated: 0xF20A, read: 0xF20A
[17:17:28][V][mbus:115]: Validating CRC for Block3
[17:17:28][V][crc:031]: calculated: 0x37FE, read: 0x37FE
[17:17:28][V][mbus:062]: Frame: 1E44A511412320217B077AF700100576890BA8F9E9223F655284C5A8B556AA (31) [without CRC]
[17:17:28][D][wmbus:182]: Meter ID [0x21202341] RSSI: -49 dBm LQI: 128 Frame: T1 A not found in configuration T: 1E44A511412320217B077AF700100576890BA8F9E9223F655284C5A8B556AA (31)
[17:17:31][D][esp32.preferences:114]: Saving 1 preferences to flash...
[17:17:31][V][esp32.preferences:137]: NVS data not changed skipping 3484741779 len=7
[17:17:31][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed

Meter ID is 0x21202341 ? even if it says "T1 A not found in configuration T" ?

@Anoxym
Copy link
Author

Anoxym commented Nov 29, 2024

Can someone help me with the code :

`
substitutions:
device_name_short: "watermeter"
device_description: "Wasserzähler ESP32, CUL - CC1101, IZAR module (Diehl IZAR RC 868 I R4 PL (SzczepanLeon) my Watermeter"
projectname: "Diehl IZAR RC 868.Watermeter"
appversion: "2.0.7"

log_level: "WARN"
log_wmbus: "ERROR"
log_baudrate: "0"

esphome:
name: ${device_name_short}
comment: ${device_description}
name_add_mac_suffix: false
project:
name: ${projectname}
version: ${appversion}
build_path: ./build/${device_name_short}
on_boot:
- priority: -100.00
then:
- globals.set:
id: boot_counter
value: !lambda "return id(boot_counter)+=1;"
- logger.log:
level: WARN
tag: "system"
format: "BOOTMESSAGE:${device_name_short} API is connected, Device ready!"
- component.update: bootcounter
- priority: 800
then:
- logger.log:
level: WARN
tag: "system"
format: "BOOTMESSAGE:${device_name_short} hardware initialization of vital components is executed "

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

esp32:
board: az-delivery-devkit-v4
framework:
type: arduino

external_components:

  • source: github://SzczepanLeon/esphome-components@main
    refresh: 0s
    components: [wmbus]

  • source:
    type: local
    path: custom_components
    components: [backup]

backup:
auth:
username: "admin"
password: "admin"
force_update: false

globals:

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

wifi:
networks:
- ssid: !secret wifi_ssid
password: !secret wifi_password
domain: !secret domain

mdns:
disabled: false

captive_portal:

logger:
id: appslogger
level: ${log_level}
baud_rate: ${log_baudrate}
logs:
wmbus: ${log_wmbus}
wMBus-lib: ${log_wmbus}

ota:
platform: esphome
password: "OTAUpdates!!"
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"]

web_server:
port: 80
version: 2
js_url: !secret webserver_jsurl

api:
id: espapi_wmbus_esp32
port: 6053
reboot_timeout: 0s

time:

  • platform: sntp
    id: time_sntp
    timezone: Europe/Berlin
    servers:

    • 0.at.pool.ntp.org
    • 0.pool.ntp.org

    on_time_sync:
    then:
    - logger.log:
    level: WARN
    tag: "system"
    format: "Synchronized sntp clock"

wmbus:
mosi_pin: GPIO23 ## SI
miso_pin: GPIO19 ## SO
clk_pin: GPIO18 ## SCLK
cs_pin: GPIO05 ## CSN
gdo0_pin: GPIO16 ## GD00
gdo2_pin: GPIO17 ## GD02

switch:

  • platform: template
    name: Device Boot Counter reset
    turn_on_action:
    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: restart
    name: "Device Restart"
    id: restart_switch

sensor:

  • platform: wmbus

    meter_id: !secret watermeterId
    type: izar
    add_prefix: false

    lqi:
    id: wmbus_cc1101_lqi
    name: "Watermeter CC1101 LQI"
    entity_category: "diagnostic"
    unit_of_measurement: "lqi"
    state_class: "measurement"

    rssi:
    id: wmbus_cc1101_rssi
    name: "Watermeter CC1101 RSSI"
    unit_of_measurement: "dbm"
    entity_category: "diagnostic"

    total_water_m3:
    name: "Watermeter display"
    id: "waterdisplay"
    unit_of_measurement: "m³"
    state_class: total_increasing
    device_class: "water"
    accuracy_decimals: 3
    icon: mdi:counter

    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"

    last_month_total_water_m3:
    name: "Watermeter last month"
    id: "waterdisplay_lastmonth"
    unit_of_measurement: "m³"
    state_class: total_increasing
    device_class: "water"
    accuracy_decimals: 3

    remaining_battery_life_y:
    name: "Watermeter Battery Life"
    id: "watermeter_batterie"
    entity_category: "diagnostic"
    icon: mdi:battery

    transmit_period_s:
    name: "Watermeter transmit periode"
    id: "watermeter_last_reading"
    entity_category: "diagnostic"
    icon: mdi:timelapse

    current_alarms:
    id: "watermeter_current_alarms"
    name: "Watermeter current alarm"
    entity_category: "diagnostic"
    icon: mdi:alarm-light

    previous_alarms:
    id: "watermeter_prev_alarms"
    name: "Watermeter previous alarm"
    entity_category: "diagnostic"
    icon: mdi:alarm-light

  • platform: wifi_signal
    id: wifi_signal_db
    update_interval: 60s
    internal: true
    disabled_by_default: true

  • platform: copy
    source_id: wifi_signal_db
    name: "Device WLAN RSSI"
    filters:

    • lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
      unit_of_measurement: "%"
      entity_category: "diagnostic"
  • platform: template
    name: Device Boot counter
    id: bootcounter
    accuracy_decimals: 0
    state_class: "measurement"
    entity_category: "diagnostic"
    lambda: return (id(boot_counter));

  • platform: template
    name: "Device Last Boot"
    disabled_by_default: true
    id: device_lastBoot_time
    icon: mdi:clock-start

`

There is errors and I don't know why, maybe esphome can't get to wmbus ? :

Screenshot 2024-11-29 at 9 02 33 PM

@SzczepanLeon
Copy link

source: github://SzczepanLeon/esphome-components@main

If you want to stay with this YAML format, then replace main with version_3

@Anoxym
Copy link
Author

Anoxym commented Nov 29, 2024

Same errors but the url with @version_3 works

@Anoxym
Copy link
Author

Anoxym commented Nov 29, 2024

I found the error and managed to upload the code to ESP. On Home Assistant I can show the Water meter but entities are Unknown :

Screenshot 2024-11-29 at 10 20 21 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants