zibous / ha-watermeter

Data provider for smartmeter watermeter.
GNU General Public License v3.0
157 stars 27 forks source link

telegrams monthly #36

Closed mauriziozito01 closed 3 months ago

mauriziozito01 commented 5 months ago

Hi everyone I would like to ask you some information I followed this project.

wmbusmeters hears nothing except 169Mhz telegrams in n mode. It's probably the electricity meter. I don't need this meter but I would like to read the water and gas meters. These meters probably transmit at 430Mhz. They probably only send a few telegrams monthly. So I would like to put wmbusmeters to listen to all telegrams transmitted at 430Mhz and send them to MQTT. Then I write a python job that goes to MQTT and if it finds something it saves these telegrams somewhere, so I can easily check offline. Is it possible to put wmbusmeters in this generic reading mode? If so, can you tell me how?

Thanks in advance.

I apologize for my English which is probably not perfect.

Maurizio

zibous commented 5 months ago

@mauriziozito01

mqtt on esp32 need a lot of memory, better use a rest api call with a small python script.

sample:

# simple rest get message for all watermeter data
  # (disable this if you do not need rest service)
  - platform: template
    id: watermeterdata
    internal: true
    disabled_by_default: true
    lambda: |-
      char buf[128];
      sprintf(buf, "%.3f|%.3f|%.3f|%.3f|%.3f|%.3f|%.3f|%.3f|%.3f|%s",
             id(waterdisplay).state,
             id(current_value),
             id(hour_value),
             id(daily_value),
             id(yesterday_value),
             id(week_value),
             id(watermonth).state,
             id(lastmonth_value),
             id(year_value),
             id(systime).state.c_str()
             );
      std::string s = buf;
      return s;

So you can get the data with:

curl -i http://water-meter-esp.local/text_sensor/watermeterdata 
HTTP/1.1 200 OK
Content-Length: 245
Content-Type: application/json
Access-Control-Allow-Origin: *
Connection: close
Accept-Ranges: none

{"id":"text_sensor-watermeterdata","value":"529.759|0.000|0.977|112.000|246.948|112.000|3281.000|7580.000|3501.953|2024-01-15T13:36:11 CET","state":"529.759|0.000|0.977|112.000|246.948|112.000|3281.000|7580.000|3501.953|2024-01-15T13:36:11 CET"}%  

see: https://github.com/zibous/ha-watermeter/blob/master/esphome/wm-esp32.yaml