jdeath / RTLAMR2MQQT

MIT License
36 stars 8 forks source link

Compliments to the great addon #12

Closed cpyarger closed 2 years ago

cpyarger commented 2 years ago

I absolutely love this addon, but I tend to have issues with MQTT not being stable for me.

So I went and forked and rebuilt the addon to use the Home Assistant API Directly

I would love if you could check it out and offer any suggestions you may have!

Regards,

Chris

jdeath commented 2 years ago

I tried it and works well. Pretty fool proof for a new user! No need to make mqtt sensors!

I do like having the ability in the script to add in a listen duration and sleep time before the next iteration, to reduce processor load. Since you pull the script in directly from your github, it will be too hard to change those variables. Perhaps adding a listen duration and a pause time setting in the config and I all the bases would be covered. Probably everybody uses hassio.local:8123, but those should probably be passed in. Also, I try not to update if the value doesn't change, just to save updates.

really nice job.

For those who want to try, it is here : https://github.com/cpyarger/Home-Assistant-Addons

cpyarger commented 2 years ago

I was just thinking about adding a config option regarding the pause command Thank you !!! (UM, the link is plural addons) 😸

cpyarger commented 2 years ago

I added the config options for

jdeath commented 2 years ago

To have what I did, make line 54 be: /go/bin/rtlamr -format json -msgtype=$AMR_MSGTYPE -filterid=$AMR_IDS -duration=$READ_DURATIONs | while read line

where $READ_DURATION is a variable you pass in. I think the initial sleep time you use $IWT is not something you really need to change, and 15 seconds is probably enough.

It is this rtlamr call that uses a ton of resources. By reading for a fixed duration, you usually get a few readings. For instance, my electric meter sends info every few seconds, but my gas meter once a minute. Things do not change very much, so no need to read very often.

I like how you made the default listen to all, that would be handy to find out your meter ID. Good thinking...

cpyarger commented 2 years ago

I added the ability to set duration, Also, For the meters I have at least, an r900 for water and a SCM+ gas meter with endpoint id 156 The proper sensors are created in Home Assistant, So, you can use the gas meter readings directly in the energy dashboard without needing to make a template sensor.

a couple other useful helpers have been added to the config page

Oh I also changed the name to SDR Meter Reader