Page 2 of 4

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Monday 15 December 2014 16:36
by Conn-artist
ThinkPad wrote:The GPIO solution is very nice Conn-artist. I was already looking for something like that.

I am planning to read the pulse LED of my kWh-meter, and also the gasmeter with a reed-contact/IR-sensor which responds to the little mirror in the zero of the counting reel.
The gasmeter has been working fine.
I fiddled a bit with a home-made sensor for the watermeter but it only has the tiny rotating serrated wheel and I have not been able to come up with a proper, reliable mechanical solution to read it. Quite frustrating.

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Monday 15 December 2014 18:15
by ThinkPad
I have tried to read the pulses of my kWh-meter, but it turns out Domoticz is too slow detecting those pulses, see my post here: http://www.domoticz.com/forum/viewtopic ... 151#p27971

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Thursday 18 December 2014 9:43
by pwhooftman
ThinkPad wrote:I have tried to read the pulses of my kWh-meter, but it turns out Domoticz is too slow detecting those pulses, see my post here: http://www.domoticz.com/forum/viewtopic ... 151#p27971
Are you sure you want to go this route? Opposite to counting gasmeter or watermeter revolutions, the number of blinks on your kWh meter is huge (1000 for every kWh, so tens of thousands a day). That will fill up your Domoticz database nicely :o

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Thursday 18 December 2014 9:50
by ThinkPad
Hmmm that is a very good aspect that i didn't think of yet. Also not very good for your SD-card in the Pi, will wear it out quickly i think.

I think it is better to use the S0PCM (S0 Pulse Counter Module), as that spits out telegrams and not thousands of pulses :lol: But i am not sure if that works with the photodiode module and the TCRT5000 module (which spit out 5V or 3.3V when connected to 5V or 3.3V power supply, and go to 0V when a pulse is detected).

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Friday 19 December 2014 14:07
by pwhooftman
Do you happen to have a TP-LINK 1043ND router? I hooked up a photoresistor to one of its gpio ports once, and let a c+ program running on the router do the math & upload it to Domoticz and PVoutput every few minutes. I can supply sources if needed (digging in my email).

Also the TP-LINK Wr703n is big fun, there is a whole wiki dedicated to diy projects http://wiki.openwrt.org/toh/tp-link/tl-wr703n, so maybe that one will do also.
You can have one for around $25 on ebay.

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Friday 19 December 2014 23:08
by ThinkPad
I know both of these routers. Unfortunately i have a WRT54GL. I think somethink like hooking up a LDR to the internal ports is also possible with that one.
But i think i will choose the S0PCM module.

However, sharing the code/schematics you are using is always useful for others!

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Thursday 19 February 2015 17:12
by deennoo
Thank you very much !! work for france gas meter too and with a 3€ door contact from ebay !

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Sunday 22 February 2015 15:34
by Siewert308SW
Thx for the guide and script.
I know it aint the most perfect solution as the KaKu isn't the best device for this kind of usage.
But just wanted to try it out as i was bored and don't have a rfxmeter or some other device to measure accurate.
So last evening i heated up my soldering iron device and a un used KaKu Doorsensor. ;-)
I have a slightly different gasmeter and after some fiddling i found the magnetic spot.
Running for almost 20hr now and last night it was a busy night with movement in the house but the gascounter is still in sync.

Just one question.
As the total counter is displaying the numeric after the decimal also.
But the today counter doesn't, it only shows a full number.
No matter what device type (counter, gascounter ect) you choose to use.
Is it a Domoticz issue or script issue?

Below two screenies of the Domoticz Frontpage on my Tablet and Domoticz Dashboard showing the today counter only in full numbers and not with numbers after the decimal.

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Sunday 22 February 2015 16:26
by ThinkPad
This one is also interesting: http://gathering.tweakers.net/forum/lis ... 6#43783066 (Dutch).

Uses ESP8266 + photodiode module + reedcontact for catching LED-pulses of kWh-meter and rotation of gasmeter digits (magnet).

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Sunday 22 February 2015 16:31
by Siewert308SW
ThinkPad wrote:This one is also interesting: http://gathering.tweakers.net/forum/lis ... 6#43783066 (Dutch).

Uses ESP8266 + photodiode module + reedcontact for catching LED-pulses of kWh-meter and rotation of gasmeter digits (magnet).
It is indeed only sad thing unusable for me.
My Kwh meter is a oldy one (1969) and we are not scheduled for a smartmeter this year, maybe it will be installed next year.
And don't have a clue how to read such an old kwh meter.

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Sunday 22 February 2015 16:32
by ThinkPad
CNY70 and TCRT5000 are often used, see this for example: http://juerd.nl/site.plp/kwh (Arduino).

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Sunday 22 February 2015 16:35
by Siewert308SW
ThinkPad wrote:CNY70 and TCRT5000 are often used, see this for example: http://juerd.nl/site.plp/kwh (Arduino).
thx...
Saved to my favorites ;)

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Sunday 22 February 2015 17:04
by roblom
ThinkPad wrote:This one is also interesting: http://gathering.tweakers.net/forum/lis ... 6#43783066 (Dutch).

Uses ESP8266 + photodiode module + reedcontact for catching LED-pulses of kWh-meter and rotation of gasmeter digits (magnet).
Er staat een hoop informatie op Tweakers maar het is onmogelijk te volgen omdat iedereen door elkaar praat.

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Sunday 22 February 2015 17:05
by ThinkPad
roblom wrote:
ThinkPad wrote:This one is also interesting: http://gathering.tweakers.net/forum/lis ... 6#43783066 (Dutch).

Uses ESP8266 + photodiode module + reedcontact for catching LED-pulses of kWh-meter and rotation of gasmeter digits (magnet).
Er staat een hoop informatie op Tweakers maar het is onmogelijk te volgen omdat iedereen door elkaar praat.
Hmm, i don't agree. If everyone nicely quotes each other you can follow the conversation fine :)

Oh and please talk English here, as the Domoticz forum is English orientated ;)

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Sunday 22 February 2015 20:48
by roblom
Strange.. my language switched from dutch to english accidentally :-)
But what i meant was that for example this ESP8266 is leaded with projects and updates of projects. But it's hard to see which update belongs to which project because it's all in one topic.

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Sunday 01 March 2015 18:44
by Toulon7559
Got interested when seeing the screenshot with G4RF1, which is also in my network meter-setup (in a version built by Rombach).
Other guys also experimenting with read-out of this gasmeter: see http://www.nodo-domotica.nl/forum/viewt ... 895#p10124
The Flukso reed-sensorhead shown is nicely compact, less 'homemade' and fits well: any idea where a cheaper equivalent for such sensorhead can be found?

;) For cheapness nothing better than a 'bare' reed-contact as shown in the start of this thread, with DIY-circuit acting as quasi-S0-interface?
Debouncing shall be required over the reed-contact, by means of a small capacitor:
otherwise most probably too many pulses going to the pulse-readout ......

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Wednesday 04 March 2015 9:14
by pwhooftman
Siewert308SW wrote:Thx for the guide and script.

Just one question.
As the total counter is displaying the numeric after the decimal also.
But the today counter doesn't, it only shows a full number.
No matter what device type (counter, gascounter ect) you choose to use.
Is it a Domoticz issue or script issue?

Below two screenies of the Domoticz Frontpage on my Tablet and Domoticz Dashboard showing the today counter only in full numbers and not with numbers after the decimal.
I see decimals in both examples....?

It's a thing of the Domoticz Dashboard to not show decimals when they are zero. Just use some more gas to make it go past x.000 :-)

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Wednesday 01 April 2015 22:44
by Kubra
Build this and it looks like its all working. It is registering the usage of gas correctly for a few days now.

But in the logfile I get these errors.

Wed Apr 1 22:06:55 2015 Script event triggered: /usr/local/domoticz/scripts/lua/script_device_gaspuls.lua
Wed Apr 1 22:06:55 2015 (RFXCOM) Lighting 2 (gaspuls)
Wed Apr 1 22:06:55 2015 Executing script: /volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua
/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: line 1: --: not found
/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: line 1: 6452.401: not found
/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: line 4: commandArray: not found
/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: local: line 6: /volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: bad variable name
/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: local: line 7: 24: bad variable name
/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: line 13: syntax error: unexpected "(" (expecting "then")
Wed Apr 1 22:06:55 2015 Error: Error executing script command (/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua). returned: 512

Can anyone tell me why these errormessages appear?

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Thursday 02 April 2015 0:59
by ThinkPad
Welcome to this forum!

Maybe you can upload your script (www.pastebin.com for example) so we can have a look? It looks like the syntax of the script isn't correct.

Maybe you did something wrong when you copy-pasted the script?

Re: Working: Gasmetersensor based on Kaku doorsensor (15 eur

Posted: Thursday 02 April 2015 12:39
by pwhooftman
Kubra wrote:Build this and it looks like its all working. It is registering the usage of gas correctly for a few days now.

But in the logfile I get these errors.

Wed Apr 1 22:06:55 2015 Script event triggered: /usr/local/domoticz/scripts/lua/script_device_gaspuls.lua
Wed Apr 1 22:06:55 2015 (RFXCOM) Lighting 2 (gaspuls)
Wed Apr 1 22:06:55 2015 Executing script: /volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua
/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: line 1: --: not found
/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: line 1: 6452.401: not found
/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: line 4: commandArray: not found
/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: local: line 6: /volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: bad variable name
/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: local: line 7: 24: bad variable name
/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua: line 13: syntax error: unexpected "(" (expecting "then")
Wed Apr 1 22:06:55 2015 Error: Error executing script command (/volume1/@appstore/domoticz/scripts/lua/script_device_gaspuls.lua). returned: 512

Can anyone tell me why these errormessages appear?

Seems like the very first line starting with --| is missing in the script.