Page 1 of 1

Posting data once a day to Mindergas.nl

Posted: Saturday 01 November 2014 19:52
by number3
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

Re: Posting data once a day to Mindergas.nl

Posted: Tuesday 20 January 2015 14:15
by ThinkPad
'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

Re: Posting data once a day to Mindergas.nl

Posted: Tuesday 20 January 2015 22:37
by number3
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.

Re: Posting data once a day to Mindergas.nl

Posted: Tuesday 13 October 2015 11:35
by tcviper
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 :P

Re: Posting data once a day to Mindergas.nl

Posted: Tuesday 13 October 2015 11:40
by ThinkPad
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

Re: Posting data once a day to Mindergas.nl

Posted: Tuesday 13 October 2015 11:44
by tcviper
That's why i posted Update at the bottom of my post :)

Re: Posting data once a day to Mindergas.nl

Posted: Wednesday 14 October 2015 16:15
by ThinkPad
Did it work this night :) ?

Re: Posting data once a day to Mindergas.nl

Posted: Wednesday 14 October 2015 16:18
by tcviper
Looks like it did :) Thx!

Re: Posting data once a day to Mindergas.nl

Posted: Saturday 17 September 2016 10:33
by Derik
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...
ScreenShot014.jpg
ScreenShot014.jpg (14.58 KiB) Viewed 2260 times
ScreenShot015.jpg
ScreenShot015.jpg (101.56 KiB) Viewed 2260 times

Re: Posting data once a day to Mindergas.nl

Posted: Sunday 18 September 2016 11:08
by Derik
Should i perhaps remove the http://?