SzczepanLeon / esphome-components

156 stars 55 forks source link

No messages send to homeassistant #151

Closed code4me2all closed 3 weeks ago

code4me2all commented 3 weeks ago

Hi,

I have some trouble to get messages to hass. My hardware (esp32 woom) is up and running and receive telegrams from the watermeter.

[I][wmbus:104]: hydrus [0x71236535] RSSI: -78dBm T: *********7170077A150030051***** (63) T1 A //shorten with!

The analyzing of the telegram with https://wmbusmeters.org/analyze gave me this { "media":"water", "meter":"hydrus", "name":"", "id":"01234567", "flow_temperature_c":20.8, "remaining_battery_life_y":12.734005, "target_m3":484.945, "target_datetime":"2024-10-31 23:59", "total_m3":490.992, "status":"OK", "timestamp":"2024-11-08T18:46:19Z" }

then i add in esphome.yaml:

mqtt:
  broker: *.*.*.* #ip of my mqtt server
  username: mqttuser
  password: !secret mqtt_password

sensor:
  - platform: wmbus
    meter_id: 1234567
    type: hydrus
    key: "51728910e66d83f851728910e66d83f8"
    sensors:
      - name: "Hauptwasserzaehler RSSi"
        field: "rssi"
        accuracy_decimals: 0
        unit_of_measurement: "dBm"
        device_class: "signal_strength"
        state_class: "measurement"
        entity_category: "diagnostic"

      - name: "Hauptwasserzaehler_total"
        field: "total"
        accuracy_decimals: 3
        unit_of_measurement: "m³"
        device_class: "water"
        state_class: "total_increasing"
        icon: "mdi:water"

I get on mqtt server log:

2024-11-08 21:01:14: New client connected from *.*.*.*:51623 as watermeter-********** (p2, c0, k15, u'mqttuser').

But no values are transmitted in HASS over MQTT Some hint why not?

SzczepanLeon commented 3 weeks ago

In VERBOSE logs do you see something MQTT related?

code4me2all commented 3 weeks ago

Not really , only at the beginning:

[18:31:08][W][component:170]: Component mqtt cleared Warning flag
[18:31:08][I][mqtt:286]: MQTT Connected!
[18:31:08][W][component:237]: Component mqtt took a long time for an operation (117 ms).
[18:31:08][W][component:238]: Components should block for at most 30 ms.
SzczepanLeon commented 3 weeks ago

I'm not mqtt component expert. It is not related to my component.

code4me2all commented 3 weeks ago

I also do not see the values on the webif -> State NA Is there an other possability to get the values into hass?

SzczepanLeon commented 3 weeks ago

Hass=HomeAssistant??

Please include full DEBUG log.

code4me2all commented 3 weeks ago

Found a solution. Send to hass addon wmbusmeter with clients:

In wmbusmeter configuration set netcat-listen-tcp to 9022 and in wmbusmeters HA addon configuration in the device section rtlwmbus:CMD(nc -lk 9022)

Also need full meter setup (driver,id,key,name)

SzczepanLeon commented 3 weeks ago

This is not solution. It is workaround (rather ugly one).

If You want help then please include DEBUG or VERBOSE log from time period when telegram is received and processed.

code4me2all commented 3 weeks ago

here the verbose log file watermetermqtt_logs (2).txt

SzczepanLeon commented 3 weeks ago

You have wrong ID in YAML. Should be 0x71236535 or 1898145077.

code4me2all commented 3 weeks ago

I changed the ID and it works, but i do not understand why it is here a hex value. On my linux system i have this working config: /etc/wmbusmeters.d/MyTapWater name=Hauptwasserzaehler id=71236535 key=51728910e66d83f851728910e66d83f8 driver=hydrus Anyway

Great thank's for your help.

I want to sponsore your project a little bit, if possible.

SzczepanLeon commented 3 weeks ago

but i do not understand why it is here a hex value.

Because it is in hex - see RAW frame.

I want to sponsore your project a little bit, if possible.

There are two "coffe" links on github page