From 6fdd2ec2f1447622f6cf8d61e59c618153d591ec Mon Sep 17 00:00:00 2001 From: root <62441271+bmjones2@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:37:06 -0500 Subject: [PATCH] Add support for R900 and R900BCD --- amr2mqtt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/amr2mqtt b/amr2mqtt index 8124478..8c26f51 100755 --- a/amr2mqtt +++ b/amr2mqtt @@ -63,7 +63,7 @@ print("rtltcp started, waiting 4 seconds") # start the rtlamr program. rtlamr = subprocess.Popen([settings.RTLAMR, - '-msgtype=idm,scm,scm+', + '-msgtype=idm,scm,scm+,r900,r900bcd', '-format=json'], stdout=subprocess.PIPE) print("rtlamr started, waiting 4 seconds") time.sleep(4) @@ -96,6 +96,14 @@ while True: parsedmessage = parsedjson["Message"] parsed_id = parsedmessage["ERTSerialNumber"] type = "idm" + if parsedjson["Type"] == 'R900': + parsedmessage = parsedjson["Message"] + parsed_id = parsedmessage["ID"] + type = "r900" + if parsedjson["Type"] == 'R900BCD': + parsedmessage = parsedjson["Message"] + parsed_id = parsedmessage["ID"] + type = "r900bcd" # make sure the meter id is one we want meter_id = int(parsed_id) @@ -106,4 +114,4 @@ while True: send_mqtt('readings/' + str(meter_id) + '/'+type, amrline) except: - time.sleep(2) \ No newline at end of file + time.sleep(2)