Neues Modul: GasCalculator

Begonnen von Sailor, 21 Januar 2016, 12:48:11

Vorheriges Thema - Nächstes Thema

bellhawk

Heute Morgen um 8:30 Uhr war es auf alle Fälle dabei!

Nur eine kleine Zwischenfrage an euch:
Die Idee mit den HM-Komponenten und dem Original-Elstermodul finde ich super. den Stecker bekommt man ja auch für 10 oder 20 Cent. Aber sehe ich das richtig, dass wenn ich mit dem HM-ES-TX-WM nur einen Sensor auslesen kann? Sprich, ich brauche für Gas und Strom jeweils eine HM-ES-TX-WM Einheit!?

no_Legend

Zitat von: bellhawk am 23 Januar 2016, 09:03:33
Heute Morgen um 8:30 Uhr war es auf alle Fälle dabei!

Nur eine kleine Zwischenfrage an euch:
Die Idee mit den HM-Komponenten und dem Original-Elstermodul finde ich super. den Stecker bekommt man ja auch für 10 oder 20 Cent. Aber sehe ich das richtig, dass wenn ich mit dem HM-ES-TX-WM nur einen Sensor auslesen kann? Sprich, ich brauche für Gas und Strom jeweils eine HM-ES-TX-WM Einheit!?

Richtig.

Drei Leseköpfe und drei HM-ES-TX_WM.

Das ist auch ein Grund warum ich es mal mit Firmata probieren will.
Der User Dirk, macht dass gerade hier im Forum mit der Selbstbau Sensor Platine.

Gruß Robert
IntelNUC mit Ubuntu mit FHEM immer aktuell,2x HMLAN, CUL443, CUL868 -homekit/siri -tablet ui -homebridge
Device, diverse:
HM-SEC-KEY,HM-LC-BL1-FM,HM-SEC-SD,HM-Sen-DB-PCB,HM-Sec-RHS,HM-Sec-SC-2,HM-WDS10-TH-O,Harmony,Netamo, 433MHz Steckdosen uvm.

Sailor

Hi Bellhawk

Zitat von: bellhawk am 23 Januar 2016, 09:03:33
Sprich, ich brauche für Gas und Strom jeweils eine HM-ES-TX-WM Einheit!?

Korrekt... Leider!

Gruss
    Sailor
******************************
Man wird immer besser...

ZeitlerW

#18
Hallo Sailor,

erst mal vielen Dank für das Modul.

2 Fragen / Anregungen hätte ich noch:


  • Was passiert, wenn der Zählerwert zurück - gesetzt wird (z.B. Stromausfall) und  wieder bei 0 beginnt. Wird dann ein Offset - Wert gesetzt
  • Wie kann ich das Modul zurücksetzen. z.B. wenn die Parameter nicht stimmen und ich nach Änderung neu beginnen will


p.s. Müßte das Modul in der Commandref nicht als Helper-Modul erscheinen?


lG
Wolfgang

Sailor

Hallo Wolfgang

Zitat von: ZeitlerW am 23 Januar 2016, 20:04:28

  • Was passiert, wenn der Zählerwert zurück - gesetzt wird (z.B. Stromausfall) und  wieder bei 0 beginnt. Wird dann ein Offset - Wert gesetzt
Der Zähler sollte eigentlich mit einer eigenen Batterie ausgestattet sein, so dass trotz Stromausfall die Impulse weitergezählt werden.
Ansonsten muss man den Offset korrigieren, was der Kurve zwar eine kleine Stufe verpasst, aber zumindest ist sie der Realität wieder angepasst.


Zitat von: ZeitlerW am 23 Januar 2016, 20:04:28

  • Wie kann ich das Modul zurücksetzen. z.B. wenn die Parameter nicht stimmen und ich nach Änderung neu beginnen will
Hier arbeite ich noch dran. Mann muss alle Readings löschen. Beispielsweise:
deletereadings myGasCalculator .*
zusätzlich noch alle Einträge im Log.
An Letzterem muss ich noch arbeiten, da es 2 verschiedene Log-Varianten gibt: File-Log und DbLog.

Zitat von: ZeitlerW am 23 Januar 2016, 20:04:28
Müßte das Modul in der Commandref nicht als Helper-Modul erscheinen?

OK, das lässt sich schnell ändern.

Danke!

Gruss
    Sailor
******************************
Man wird immer besser...

fruit

Very interesting module - and lots of useful information but it does not work for me.

My meter is a Krom Schroder BK-G4 G4 with three wheels after the decimal point, the last with a magnet, so 1/10,1/100,1/1000 cubic meter.

I count with a panStamp, counts are 5/1000 cubic meter each but the module seems to work to 2 DP (decimal places) only.

I think UK gas bills may be different to German bills too (I bet yours are simpler!), not a problem of course.
We are charged per kWh and have text such as
ZitatThis is how we convert gas units into kilowatt hours (kWh)
171.28 metric units used
x 1.022640 volume correction
= 175.15 corrected units
x 39.3 calorific value
/ 3.6 to convert to kWh
= 1912.05 kWh
Feel free to follow up in German if you prefer

no_Legend

Zitat von: fruit am 25 Januar 2016, 08:15:08
Very interesting module - and lots of useful information but it does not work for me.

My meter is a Krom Schroder BK-G4 G4 with three wheels after the decimal point, the last with a magnet, so 1/10,1/100,1/1000 cubic meter.

I count with a panStamp, counts are 5/1000 cubic meter each but the module seems to work to 2 DP (decimal places) only.

I think UK gas bills may be different to German bills too (I bet yours are simpler!), not a problem of course.
We are charged per kWh and have text such as

Hi you can add this feature by our own.
U can use an user reading.
I use the same to convert the sun brightness.

Here my example:
userReadings luminosity2 { ReadingsVal("Outdoor.Helligkeit","luminosity",0)/0.265; }

BR Robert
IntelNUC mit Ubuntu mit FHEM immer aktuell,2x HMLAN, CUL443, CUL868 -homekit/siri -tablet ui -homebridge
Device, diverse:
HM-SEC-KEY,HM-LC-BL1-FM,HM-SEC-SD,HM-Sen-DB-PCB,HM-Sec-RHS,HM-Sec-SC-2,HM-WDS10-TH-O,Harmony,Netamo, 433MHz Steckdosen uvm.

Sailor

#22
Hi fruit

Zitat von: fruit am 25 Januar 2016, 08:15:08
I think UK gas bills may be different to German bills too (I bet yours are simpler!), not a problem of course.
We are charged per kWh and have text such as
Gas prize

Holly shit!

No, you are absolutely correct... We are billed in €/kWh as well!

The calculations and numbers in my modules are correct already, since I just multiply the energy (in kWh) with gasprize (in curreny/kWh).

So I just corrected the commandref description and the name of one attribute:
GasPricePerCubic is now GasPricePerKWh

Everybody: Please apply update and as soon you see the attribute GasPricePerKWh in your device, please use deleteattr myGasCalculator GasPricePerCubic or the standard web-interface to delete the obsolescent (old) attribute.


Volume conversion
About your volume correction - I saw this factor before on the gas bill of my father-in-law (Amersham, Bucks) and it is corresponding with our Gas z Value.
In your case, you are sitting lower than the gas main supply station so your gas ends up higher compressed than originally pumped in the consumer network at the gas main supply station.

In my case,    my   counter provides 1 Impuls / (1/100)m3   = 1 Impuls / 0.010m3 = 1Impuls/10l), which means the attribute GasCubicPerCounts must be set to 0.01.
In your case, your counter provides 1 Impuls / (5/1000)m3 = 1 Impuls / 0.005m3 = 1Impuls/5l),   which means the attribute GasCubicPerCounts must be set to 0.005.

I renamed this attribute as well!

You seems to have already an newer gas meter unit in m3.
Otherwise the additional conversion from imperial to metric would be 0.028317 m3/ft3.


calorific conversion
This is a very British thing!  ;)

Please calculate (39.3 calorific value / 3.6 to convert to kWh) = 10,9167 and add the value in the attribute "GasNominalHeatingValue".


Thanks a lot for the bug-finding!

Best regards
    Sailor
******************************
Man wird immer besser...

fruit

Zitat von: Sailor am 25 Januar 2016, 09:45:10No, you are absolutely correct... We are billed in €/kWh as well!
Not done just to confuse us in the UK then ;)
Zitat
Volume conversion
About your volume correction - I saw this factor before on the gas bill of my father-in-law (Amersham, Bucks) and it is corresponding with our Gas z Value.
In your case, you are sitting lower than the gas main supply station so your gas ends up higher compressed than originally pumped in the consumer network at the gas main supply station.

In my case,    my   counter provides 1 Impuls / (1/100)m3   = 1 Impuls / 0.010m3 = 1Impuls/10l), which means the attribute GasCubicPerCounts must be set to 0.01.
In your case, your counter provides 1 Impuls / (5/1000)m3 = 1 Impuls / 0.005m3 = 1Impuls/5l),   which means the attribute GasCubicPerCounts must be set to 0.005.
I'm still a bit confused by this but will play more tomorrow.

I tried setting to .005 but from a quick look at the code yesterday I think you subtract previous-reading from new-reading - but previous-reading has been rounded to 2DP so the calculation ignores the least significant digit
I could be wrong of course ;)

ZitatYou seems to have already an newer gas meter unit in m3.
Most UK meters are now m3 - but it is only a matter of conversion factor as you say
Decimalisation/metrication was only 40+ years ago here - we're getting there slowly ;)

Zitatcalorific conversion
This is a very British thing!  ;)
and probably is done to confuse us!
No problem to calculate it - except that it changes from time to time! I don't expect the module to cope with that :)

Thanks for getting back
Feel free to follow up in German if you prefer

Sailor

Hi fruit

Zitat von: fruit am 25 Januar 2016, 10:56:19
I tried setting to .005 but from a quick look at the code yesterday I think you subtract previous-reading from new-reading - but previous-reading has been rounded to 2DP so the calculation ignores the least significant digit
I could be wrong of course ;)

I corrected it. Should be 3 digits by now.

Regards
    Sailor
******************************
Man wird immer besser...

fruit

Excellent! I'll try with the new version when it appears
Many thanks
Feel free to follow up in German if you prefer

fruit

I started again this morning but still problems, on starting
2016.01.26 07:55:43 1: PERL WARNING: Use of uninitialized value $GasCountReadingValuePrevious in concatenation (.) or string at ./FHEM/73_GasCalculator.pm line 359.
then
2016.01.26 15:51:45 3: myGasCalculator : GasCalculator - The attribute Volume was missing and has been set to m³
2016.01.26 15:51:45 3: myGasCalculator : GasCalculator - The attribute Currency was missing and has been set to €

Perhaps a locale issue? Easily changed anyway.

I am running with a basic config, just to get working correctly initially, setting only verbose 5 and
GasCounterOffset 8456.056
GasCubicPerCounts 0.005


My actual readings and counts are
8456.056
8456.121 (13 count x .005m[sup]3[/sup])
8456.186 (18 count)
8456.226 (8 count)
8456.231 (1 count)


The module is showing from logs
GasCountReadingValueDelta                : 0.000 m³
Current Reading Value                    : 8456.121
Previous Reading Value                   : 8456.121

GasCountReadingValueDelta                : -0.025 m³
Current Reading Value                    : 8456.096
Previous Reading Value                   : 8456.121

GasCountReadingValueDelta                : -0.035 m³
Current Reading Value                    : 8456.061
Previous Reading Value                   : 8456.096

GasCountReadingValueDelta                : 0.000 m³
Current Reading Value                    : 8456.061
Previous Reading Value                   : 8456.061


Should GasCountReadingValueDelta not show my count x 0.005 from above? Or am I misunderstanding something and a negative delta is expected?

I hope that is reasonable clear
Feel free to follow up in German if you prefer

LarsK

Hallo,

ich bräuchte mal eine kleine Hilfestellung bezglich der RegEx, die den Gascounter triggern soll. Irgendwie laufen alle Versuche ins Leere und der Counter zählt nicht, auch nicht mit Regex, die bei Notify bzw. Logs funktionieren.

Mein Aufbau ist folgender: Ich habe ein Readkontakt am Zähler der 01 liefert, wenn er angesprochen wird und 00 liefert, wenn der Impuls wieder vorbei ist.
Die Events kommen, das Logfile wird geschrieben.

Auszug Logfile:

2016-01-28_21:34:54 DEB3 01
2016-01-28_21:35:12 DEB3 00
2016-01-28_21:40:31 DEB3 01
2016-01-28_21:41:19 DEB3 00


Was lief war "DEB3.*". Dann zählt er allerdings jeden Impuls, also auch die fallende Flanke, was natürlich nicht gewollt ist.
Nun hab ich diverse Kombinationen durchprobiert. DEB3:01 DEB3.01 etc. keiner dieser Ausdrücke bringt allerdings den Counter zum zählen.

Vielleicht kann ja jemand einen Tip geben, wie es funktionieren könnte.
Gruß

Lars

sweetie-pie

Hallo,

ich teste derzeit auch mit dem GasCounter. Heute morgen hatte ich dann folgenden Fehler im Log.

Illegal division by zero at ./FHEM/73_GasCalculator.pm line 495.

Vielleicht sollte man das abfangen...

Gruß
  sweetie-pie

Sailor

Hallo Lars

Zitat von: LarsK am 28 Januar 2016, 22:43:32
Was lief war "DEB3.*". Dann zählt er allerdings jeden Impuls, also auch die fallende Flanke, was natürlich nicht gewollt ist.
Nun hab ich diverse Kombinationen durchprobiert. DEB3:01 DEB3.01 etc. keiner dieser Ausdrücke bringt allerdings den Counter zum zählen.

Das kann so auch nicht klappen, da das Modul einen fortlaufenden Zaehlerwert erwartet.

Soll heißen:


2016-01-28_21:34:54 DEB3 01
2016-01-28_21:35:12 DEB3 02
2016-01-28_21:40:31 DEB3 03
2016-01-28_21:41:19 DEB3 04


Gruss
    Sailor
******************************
Man wird immer besser...