Get smart meter values through script

Post Reply
Hobbybob
Posts: 144
Joined: Monday 01 May 2017 19:03
Target OS: Raspberry Pi
Domoticz version: Stable
Contact:

Get smart meter values through script

Post by Hobbybob » Tuesday 23 May 2017 15:57

Does anybody know if it is possible to get the values of the smart meter through a script instead of directly from the P1-port?

I am reading the P1-port with an Arduino-board that sends the values to my own website for further analysis/visualization. I can build a API that generates values in any given format (e.g. JSON). That is no problem, but how would I go about integrating the values in Domoticz?

Has anybody done this before? Kind of like a virtual P1-reader...

Rolo
Posts: 56
Joined: Sunday 27 December 2015 20:19
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: The Netherlands
Contact:

Re: Get smart meter values through script

Post by Rolo » Tuesday 23 May 2017 19:00

Youre already sending html so you could send json urls to domoticz. First create dummy devices of the type needed (energy meter in this case). Then compose the json url using the idx number of the sensor. Test it in your browser and if the values are correctly updated implement them in your arduino code.

Verstuurd vanaf mijn ONEPLUS A3003 met Tapatalk

Hobbybob
Posts: 144
Joined: Monday 01 May 2017 19:03
Target OS: Raspberry Pi
Domoticz version: Stable
Contact:

Re: Get smart meter values through script

Post by Hobbybob » Tuesday 23 May 2017 19:36

Rolo wrote:Youre already sending html so you could send json urls to domoticz. First create dummy devices of the type needed (energy meter in this case). Then compose the json url using the idx number of the sensor. Test it in your browser and if the values are correctly updated implement them in your arduino code.
Okay, that is another approach than I was thinking of, but it should work!

I didn't know about the json.htm url's, thanks for pointing me in that direction. I think I should be alright from here on, thank you!

Hobbybob
Posts: 144
Joined: Monday 01 May 2017 19:03
Target OS: Raspberry Pi
Domoticz version: Stable
Contact:

Re: Get smart meter values through script

Post by Hobbybob » Tuesday 23 May 2017 20:50

One more thing though: how often do you recommend to save the values? The P1-port gives me an update every 10 seconds, but I think that is a bit overkill.

In my Arduino-script I save the values once every minute. Anybody who wants to share how often they save the values?

Post Reply

Who is online

Users browsing this forum: edwindred and 0 guests