Posting data once a day to Mindergas.nl
Moderator: leecollings
-
- Posts: 6
- Joined: Friday 15 August 2014 20:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: NL
- Contact:
Posting data once a day to Mindergas.nl
After working on it for a week I have created a script that will post data to the website: mindergas.nl
If you don't mind your data being on an external webservice, then you can use this script.
I am still testing the correct working of the script at this time, but it looks like it works just fine.
Find my detailed description right here:
http://www.domoticz.com/wiki/Mindergas.nl
If you don't mind your data being on an external webservice, then you can use this script.
I am still testing the correct working of the script at this time, but it looks like it works just fine.
Find my detailed description right here:
http://www.domoticz.com/wiki/Mindergas.nl
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Posting data once a day to Mindergas.nl
'nickyb2' from Tweakers (also on this forum) created a simple Python script to upload gas consumption from smartmeter to Mindergas. I tested it, and it works fine.
You can find it here: http://gathering.tweakers.net/forum/lis ... 1#43606221
You can find it here: http://gathering.tweakers.net/forum/lis ... 1#43606221
I am not active on this forum anymore.
-
- Posts: 6
- Joined: Friday 15 August 2014 20:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: NL
- Contact:
Re: Posting data once a day to Mindergas.nl
Great finds... I'm not a bash/sed/curl programmer, but I agree it looks like it can be done in a simplere way.
Love the find on tweakers, will take a look into it.
Btw. the wiki article is quite simple, it installs some stuff, if you follow the step by step it does work, but I agree it can be improved.
So I will look into these two finds.
And document the results.
Love the find on tweakers, will take a look into it.
Btw. the wiki article is quite simple, it installs some stuff, if you follow the step by step it does work, but I agree it can be improved.
So I will look into these two finds.
And document the results.
- tcviper
- Posts: 89
- Joined: Monday 30 June 2014 13:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Posting data once a day to Mindergas.nl
Im seeing this when I run the script on my RPI2 with Domoticz:
Traceback (most recent call last):
File "/home/pi/domoticz/scripts/mindergas.py", line 61, in <module>
sys.exit(main())
File "/home/pi/domoticz/scripts/mindergas.py", line 34, in main
device_data = json.load(urllib2.urlopen("%s/json.htm?type=devices&rid=%s" % (args.url, args.device), timeout=5))
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 401, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 419, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1211, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1181, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 97] Address family not supported by protocol>
Any idea? Token and IDX of the gas meter are filled in correctly.
Update: Looks like adding -u http://192.168.1.16:80 (which is my domoticz address) now seems to b e working. Hope thats all
Traceback (most recent call last):
File "/home/pi/domoticz/scripts/mindergas.py", line 61, in <module>
sys.exit(main())
File "/home/pi/domoticz/scripts/mindergas.py", line 34, in main
device_data = json.load(urllib2.urlopen("%s/json.htm?type=devices&rid=%s" % (args.url, args.device), timeout=5))
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 401, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 419, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1211, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1181, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 97] Address family not supported by protocol>
Any idea? Token and IDX of the gas meter are filled in correctly.
Update: Looks like adding -u http://192.168.1.16:80 (which is my domoticz address) now seems to b e working. Hope thats all

-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Posting data once a day to Mindergas.nl
How do you call the script from your crontab? Did you supply all the parameters needed?
The URL to Domoticz needs to be something like: "http://1.2.3.4:8080" i thought (without the quotes ofcourse).
If the URL is not supplied it will use "http://localhost:8080".
See also the wiki, it is all explained there: http://domoticz.com/wiki/Mindergas.nl#The_Python_way
The URL to Domoticz needs to be something like: "http://1.2.3.4:8080" i thought (without the quotes ofcourse).
If the URL is not supplied it will use "http://localhost:8080".
See also the wiki, it is all explained there: http://domoticz.com/wiki/Mindergas.nl#The_Python_way
I am not active on this forum anymore.
- tcviper
- Posts: 89
- Joined: Monday 30 June 2014 13:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Posting data once a day to Mindergas.nl
That's why i posted Update at the bottom of my post 

-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Posting data once a day to Mindergas.nl
Did it work this night
?

I am not active on this forum anymore.
- tcviper
- Posts: 89
- Joined: Monday 30 June 2014 13:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Posting data once a day to Mindergas.nl
Looks like it did
Thx!

-
- Posts: 1602
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Posting data once a day to Mindergas.nl
dear all..
I will try to use the phyton way..
install phyton.
make the script
make the crontab..
Is there a way to test. this option?
Because it is not working...
I will try to use the phyton way..
install phyton.
make the script
make the crontab..
Is there a way to test. this option?
Because it is not working...
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
-
- Posts: 1602
- Joined: Friday 18 October 2013 23:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Arnhem/Nijmegen Nederland
- Contact:
Re: Posting data once a day to Mindergas.nl
Should i perhaps remove the http://?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Who is online
Users browsing this forum: No registered users and 1 guest