Get your smart electric, water and gas meter scm readings into home assistant with a RTL-SDR

No luck…I tried to convince my gas service provider to swap out the old meter for a newer one, but they didn’t want to do it.

1 Like

Thank you for the instructions. It took me a few hours but I was able to get through it. After scanning the terminal to find my gas and water meter I realized I won’t be able to make good use of the tool. My water meter (Neptune R900) has an encrypted Flexnet device to communicate with the utility and my gas meter (Itron 40GB Type 2) isn’t compatible (wake up mode?). No luck here!

I think I have a similar gas and water meter. No luck on the water meter. The gas meter does show up when the utility truck drives by 1-2 times a month. Kinda fun when it does, but not that useful.

1 Like

That’s good to hear! I was hoping it would trigger when they drove by. I’ll be finding out in a few days…

Nope, I plan to get one of these soonish https://www.smappee.com/us/gas-water-monitor.html

Thanks for posting this. This is what I needed to get mine working as well. Unfortunately with your script I am getting a ton of messages. Is there any way to modify it so that it only sends a new message once every five minutes or so? I’m guessing I need to put a sleep in there somewhere but I’m not skilled enough to know where. Any help is most appreciated.

Can the code be updated to read AMR first then read Weather stuffs? i.e.

Wondering if this will work --> move the rtltcp and rtlamr processes inside the infinite while loop and add the weather process? Basically, the idea is start the processes each iteration of the loop and shut them down at the end of the loop.

Sorry - having issues with my SDR antenna – Probably i have a bad one – so couldn’t try it yet.

I’m guessing this isn’t a supported model?

@biochemguy, have you looked at adding SCM+ message support?

@jcgoette
I had a quick look at the list and could not find the model number, I am guessing that it’s unfortunately probably not supported.

@fermat1357
I don’t have enough programming skills to do it. It would be a super cool project though, as it could expand the use of a single rtl-sdr. Probably fairly simple for someone with more knowledge.

@dcnoren
SCM+ message should be fairly easy to do. I don’t have a meter to test it with, but this projects uses rtlamr to look for the specific data that we want. Since SCM+ is supported by rtlamr, it should be no problem to support it.

You would have to modify the amrscm2mqtt file to match your type of meter. Here is probably the changes you would have to make to the program:
(Note that I have edited to simply show a section of the program and added a few comments)

# start the rtlamr program.
rtlamr = subprocess.Popen([settings.RTLAMR,
    '-msgtype=scm',
    '-format=csv'], stdout=subprocess.PIPE)
# In SCM and SCM+ msgtype should be the same.
while True:

    try:
        # rtlamr's readline returns byte list, remove whitespace and convert to string
        amrline = rtlamr.stdout.readline().strip().decode()
        # split string on commas
        flds = amrline.split(',')

        if len(flds) != 9:

            # proper SCM results have 9 fields. If SCM+ have more fields, you can adjust this number.
            continue

        # make sure the meter id is one we want - Change this if the meter ID is in another field.
        meter_id = int(flds[3])
        if len(settings.WATCHED_METERS) and meter_id not in settings.WATCHED_METERS:
            continue

        # get some required info: current meter reading, current interval id, most recent interval - SCM+ Change this if there is more fields in the data
        read_cur = int(flds[7])

basically this takes the data and separates the meter data in different fields. The fields are createdby spaces in the meter reading. You just have to select the correct field for the data you are looking for.

Here is an example of a message divided into fields by running rtlamr and converting it to csv:

rtlamr -format=csv

2020-11-01T23:28:31.614978734-04:00,0,0,16911175,7,0x0,0x3,4822556,0x7f33

Field 3 is the meter and field 7 is the reading (the data is separated by commas and fields count starts at 0).

Hope this helps…

1 Like

Anyone know if there is a way to do this with HassOS addon?

I’ve been using RTLAMR with a homebrew PHP/SQLite DB on a Raspberry Pi for a couple years and love it (Dominion VA Power the meter ID is on the bottom below/behind the dial plate) but I’d love to bring it over into my home automation system to reduce how many machines I have to maintain.

With a bit of math on the previous/current readings, you can also compute the “real-ish time” power consumption of your house (e.g. average over past 2 minutes) without the need for any expensive gear or modifications to your breaker panel.

I know I can just MQTT the data from the Pi into HomeAssistant (probably will) but it would be a lot cleaner to do it all in HomeAssistant on the one server.

I also need to figure out how to read our water meter (which I believe is wireless) later…

@jaaem created a docker container for this. I am not using HassOS, but I believe that you might be able to add it manually.

As for the math, if you follow the way I described it, it takes the average current usage of the last 10 minutes. The reasoning behind it is that my meter sends a signal every 5-7 minutes. Therefore if I only compare the last meter value and it doesn’t update within the timeframe, the current usage will fall to zero, which can be untrue.

Ah, yeah I’m not sure that I can add a plan docker container to HassOS.

Interesting the difference…my meter updates a few times a minute (the previous house it was every few seconds). Wonder if it has to do with how they collect them or how dense the radios are.

Actually, now I remember, the signal is sent much more often, but the value is only updated after 5-7 min

My docker container repo can be directly used added as as a HassOS addon, thanks to fcfort. Just add the repo. I’ve always wanted to make a real-time-ish computation, but my math never seemed to work out. I allow pinging multiple meters, so hard to keep track of last reading/time in a nice way. You can edit the shell script easily if you like.

@jaaem Hi, your add-on works great. I am able to pull in readings from my electricity meter w/ MQTT. This is probably a dumb question, but, is there some conversion I should be doing? I’m based in the US, getting a reading of ~135,500, appears to be climbing at approximately 1 KwH per 5 minutes from the sensor. My ‘normal’ electricity consumption is around 650 KwH per month. I assume there’s probably a conversion/template I need to use.

Any help appreciated.

I am in the US and my meter puts out kWh natively. For my meter, the value is just what the meter is at right now. Look at your last bill and see if the reading is somewhere around 135,500. You can also look on the meter to see what it shows, if it has a display.

Maybe your meter outputs in another unit. It could be in Wh (1/1000 of a kWh)?

I am not expert on meters, I just ported someone else code. Try googling if others have your meter. Also be sure you are tapping into your meter and not a business near by.

@jaaem

Got it, no worries, thank you for responding. I took another look at the meter and my next door neighbors, it is in kWh – for whatever reason, RTLAMR was pulling in with a couple more digits. If helpful for anyone else that has a similar issue, I just made a template sensor to convert.

sensor:
  - platform: template
    sensors:
      converted_power:
        value_template: "{{ ((states.sensor.power_meter.state | float * 1 / 100)) | round(0) }}"
        unit_of_measurement: kWh
1 Like

Thanks for posting this! I found another way which was much easier for me to setup by only requiring rlt_433 (which also reads other frequencies): Refrigerator Sensor and Gas Meter Reading with rtl_433 and cheap USB rtl-sdr tuner

1 Like

Can anyone estimate the range of the NooElec nano dongle when it comes to monitoring their meter? My power meter is about 100m from my house, and I’m debating if I’ll need something more beefy to read the signal (assuming its there)