How to use an RPi as a surrogate smart meter?
Posted: Friday 02 December 2016 21:25
At this moment, I do not have a "really" smart meter with a P1 RJ-11 serial port. I will eventually get one and by then things should be easy. I think...
However, I am currently stuck with an Iskra MT171 meter. I just installed an optical pick-up with a TTL interface to communicate through the P0 port of the meter and that pick-up is connected to an RPi P1 connector, using the 3V3, GND, RTX and TXD connections. I also have a Python script running every 5 minutes by using cron, and that reads the Telegram from the meter and manipulates the Telegram information into a .csv file so I can import the readings in MS-Excel and make graphs. So that part works. So far so good.
I also have Domoticz running on that same RPi, and would like to use that as my back-end to display the meter data, but here I'm stuck at the moment. I'm pretty sure Domoticz cannot handle the optical pick-up communication and interrogate my meter by itself. My take is that the protocall is very different from the standard hardware definition. If there is a way, I have not found it, so please lead me the way to a solution if it is possible.
After searching for a few days, I have not found an easy enough method (for me
) to transfer the data that I collect on my RPi into Domoticz. At this moment, I would like to avoid the LUA script way if at all possible. Seems too complicated for just this one off task, and nothing I found is really applicable without many changes.
So, another method that I think could work is as follows. Because I will eventually, any time really soon, don't hold your breath, get a real smartmeter, that would solve my problem. No, I don't want to spend 70 Euros to get a meter sooner. To bridge that time period however, I would like to see if it is possible to let Domoticz interrogate my RPi, letting it think the RPi is the smartmeter. The Rpi would then need to offer the data to Domoticz as if it's coming from the real thing. As a bonus, one would have total flexibility in what to offer in terms of data, not only coming from the smartmeter itself.
Has anybody already done something like this, and if so are you willing to share how you did it? If not, is there interest by this community to create this temporary stop-gap? I am pretty good with RPi's, hardware and Python, but sorely miss any Domoticz skills. I need some serious guidance on this.
Thanks!

However, I am currently stuck with an Iskra MT171 meter. I just installed an optical pick-up with a TTL interface to communicate through the P0 port of the meter and that pick-up is connected to an RPi P1 connector, using the 3V3, GND, RTX and TXD connections. I also have a Python script running every 5 minutes by using cron, and that reads the Telegram from the meter and manipulates the Telegram information into a .csv file so I can import the readings in MS-Excel and make graphs. So that part works. So far so good.
I also have Domoticz running on that same RPi, and would like to use that as my back-end to display the meter data, but here I'm stuck at the moment. I'm pretty sure Domoticz cannot handle the optical pick-up communication and interrogate my meter by itself. My take is that the protocall is very different from the standard hardware definition. If there is a way, I have not found it, so please lead me the way to a solution if it is possible.
After searching for a few days, I have not found an easy enough method (for me

So, another method that I think could work is as follows. Because I will eventually, any time really soon, don't hold your breath, get a real smartmeter, that would solve my problem. No, I don't want to spend 70 Euros to get a meter sooner. To bridge that time period however, I would like to see if it is possible to let Domoticz interrogate my RPi, letting it think the RPi is the smartmeter. The Rpi would then need to offer the data to Domoticz as if it's coming from the real thing. As a bonus, one would have total flexibility in what to offer in terms of data, not only coming from the smartmeter itself.
Has anybody already done something like this, and if so are you willing to share how you did it? If not, is there interest by this community to create this temporary stop-gap? I am pretty good with RPi's, hardware and Python, but sorely miss any Domoticz skills. I need some serious guidance on this.
Thanks!