Working: Gasmetersensor based on Kaku doorsensor (15 euros)

Moderator: leecollings

User avatar
Conn-artist
Posts: 21
Joined: Saturday 12 July 2014 12:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8367
Location: 127.0.0.1
Contact:

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

Post 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.
--
Martijn
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post 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
I am not active on this forum anymore.
pwhooftman
Posts: 75
Joined: Monday 11 November 2013 18:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
Domoticz v 1.16xx
1X RFXtrx433 USB 433.92MHz Transceiver Firmware version: 71
1X Synology Nas DS918+ DSM 7 (12Gb RAM mod)
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post 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).
I am not active on this forum anymore.
pwhooftman
Posts: 75
Joined: Monday 11 November 2013 18:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
Domoticz v 1.16xx
1X RFXtrx433 USB 433.92MHz Transceiver Firmware version: 71
1X Synology Nas DS918+ DSM 7 (12Gb RAM mod)
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post 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!
I am not active on this forum anymore.
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

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

Post by deennoo »

Thank you very much !! work for france gas meter too and with a 3€ door contact from ebay !
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
User avatar
Siewert308SW
Posts: 288
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

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

Post 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.
Attachments
GasCount_frontpage.png
GasCount_frontpage.png (8.68 KiB) Viewed 6854 times
GasCount_dasboard.png
GasCount_dasboard.png (16.28 KiB) Viewed 6854 times
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post 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).
I am not active on this forum anymore.
User avatar
Siewert308SW
Posts: 288
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

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

Post 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.
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post by ThinkPad »

CNY70 and TCRT5000 are often used, see this for example: http://juerd.nl/site.plp/kwh (Arduino).
I am not active on this forum anymore.
User avatar
Siewert308SW
Posts: 288
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

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

Post 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 ;)
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
roblom
Posts: 402
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

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

Post 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.
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post 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 ;)
I am not active on this forum anymore.
roblom
Posts: 402
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

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

Post 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.
Toulon7559
Posts: 848
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

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

Post 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 ......
Last edited by Toulon7559 on Thursday 02 April 2015 9:38, edited 4 times in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
pwhooftman
Posts: 75
Joined: Monday 11 November 2013 18:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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 :-)
Domoticz v 1.16xx
1X RFXtrx433 USB 433.92MHz Transceiver Firmware version: 71
1X Synology Nas DS918+ DSM 7 (12Gb RAM mod)
Kubra
Posts: 22
Joined: Wednesday 01 April 2015 22:06
Target OS: NAS (Synology & others)
Domoticz version: latest
Location: Hollanda
Contact:

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

Post 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?
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

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

Post 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?
I am not active on this forum anymore.
pwhooftman
Posts: 75
Joined: Monday 11 November 2013 18:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
Domoticz v 1.16xx
1X RFXtrx433 USB 433.92MHz Transceiver Firmware version: 71
1X Synology Nas DS918+ DSM 7 (12Gb RAM mod)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests