Skip to content

Instantly share code, notes, and snippets.

@esamattis
Last active February 9, 2023 11:31
Show Gist options
  • Save esamattis/5078d0e9d3036441ea7f18c698a652fc to your computer and use it in GitHub Desktop.
Save esamattis/5078d0e9d3036441ea7f18c698a652fc to your computer and use it in GitHub Desktop.
Reading Hydrodigit-S1 water meter with iM871A-USB and wmbusmeters to Home Asisstant sensor
# /etc/wmbusmeters.d/ColdWater
name=ColdWater
# the id printed on the meter
id=030xxxxx
key=NOKEY
driver=hydrodigit
# The Home Assistant /config/configuration.yaml
template:
- trigger:
- platform: webhook
webhook_id: water-030xxxxx-secret
sensor:
- name: "Water Warm"
state: "{{ trigger.json.total_m3 }}"
unit_of_measurement: "m³"
device_class: water
state_class: total
- trigger:
- platform: webhook
webhook_id: water-030xxxxx-secret
sensor:
- name: "Water Cold"
state: "{{ trigger.json.total_m3 }}"
unit_of_measurement: "m³"
device_class: water
state_class: total
# /etc/wmbusmeters.d/WarmWater
name=WarmWater
# the id printed on the meter
id=030xxxxx
key=NOKEY
driver=hydrodigit
# /etc/wmbusmeters.conf
loglevel=verbose
device=/dev/ttyUSB0:im871a:t1
logtelegrams=true
format=json
meterfiles=/var/lib/wmbusmeters/meter_readings
meterfilesaction=overwrite
logfile=/var/log/wmbusmeters/wmbusmeters.log
donotprobe=/dev/ttyAMA0
shell=/usr/bin/curl --fail -H "content-type: application/json" -d "$METER_JSON" http://homeassistant.local:8123/api/webhook/water-$METER_ID-secret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment