{"id":515,"date":"2011-06-25T14:27:24","date_gmt":"2011-06-25T13:27:24","guid":{"rendered":"http:\/\/katastrophos.net\/andre\/blog\/?p=515"},"modified":"2013-03-04T09:56:26","modified_gmt":"2013-03-04T08:56:26","slug":"fhem-module-for-elv-esa1000-wzzgas-series-of-devices","status":"publish","type":"post","link":"https:\/\/katastrophos.net\/andre\/blog\/2011\/06\/25\/fhem-module-for-elv-esa1000-wzzgas-series-of-devices\/","title":{"rendered":"FHEM module for ELV ESA1000 (WZ\/Z\/GAS) series of devices"},"content":{"rendered":"<p><a href=\"http:\/\/fhem.de\" target=\"_blank\">FHEM<\/a>, the amazing home-automation server software, already has support for several sensors, meters and switches produced by <a href=\"http:\/\/www.elv.de\" target=\"_blank\">ELV<\/a>. In October 2010 I bought two meters, <a href=\"http:\/\/www.elv.de\/output\/controller.aspx?cid=74&#038;detail=10&#038;detail2=22049\" target=\"_blank\">ESA1000WZ<\/a> and <a href=\"http:\/\/www.elv.de\/output\/controller.aspx?cid=74&#038;detail=10&#038;detail2=25408\" target=\"_blank\">ESA1000GAS<\/a> for my house in the hope that FHEM would support them. Unfortunately it did not (at the time). I quickly found some hints that somebody, namely Gerd K., was working on adding support. So I contacted him and a day later received his module for testing. In the meantime eager in anticipation I was hacking away, duplicating the existing EM1000 extension and customizing it to read the raw strings coming from my <a href=\"http:\/\/busware.de\" target=\"_blank\">Busware.de<\/a> CUL 868 MHz USB adapter. While I got the power meter&#8217;s values (<a href=\"http:\/\/www.elv.de\/output\/controller.aspx?cid=74&#038;detail=10&#038;detail2=22049\" target=\"_blank\">ESA1000WZ<\/a>) figured out pretty quickly, it was a bit more involving to get correct readings from the gas meter (<a href=\"http:\/\/www.elv.de\/output\/controller.aspx?cid=74&#038;detail=10&#038;detail2=25408\" target=\"_blank\">ESA1000GAS<\/a>). Unfortunately Gerd&#8217;s code did not include support for the gas meter, so I emailed him my changes, but sadly never received feedback.<br \/>\nSo today I am releasing my code on a works-for-me basis:<\/p>\n<p><strong>Download<\/strong><\/p>\n<p><strong>UPDATE:<\/strong><a class=\"downloadlink\" href=\"http:\/\/katastrophos.net\/downloads\/FHEM\/cul_esa-for-fhem-5.3.patch\"><strong>Patch for FHEM 5.3<\/strong> Version: Feb 10th 2013 for FHEM 5.3<\/a><br \/>\n<a class=\"downloadlink\" href=\"http:\/\/katastrophos.net\/downloads\/FHEM\/CUL_ESA.tar.gz\"><strong>Package for FHEM 5.0<\/strong> Version: Oct 25th 2010 for FHEM 5.0<\/a><\/p>\n<ul>\n<li>Supports <a href=\"http:\/\/www.elv.de\/output\/controller.aspx?cid=74&#038;detail=10&#038;detail2=22049\" target=\"_blank\">ESA1000WZ<\/a> power meter (infrared version, possibly others as well)<\/li>\n<li>Supports ESA1000Z and <a href=\"http:\/\/www.elv.de\/output\/controller.aspx?cid=74&#038;detail=10&#038;detail2=25408\" target=\"_blank\">ESA1000GAS<\/a> gas meters (infrared version and version using impulse transducer for the Elster-Kromschroeder BK-G4)<\/li>\n<li>Features proper graph files to plot current and cumulated day\/month consumption<\/li>\n<\/ul>\n<p><strong>Photos \/ Screenshots<\/strong><br \/>\n<div id='gallery-1' class='gallery galleryid-515 gallery-columns-3 gallery-size-thumbnail'><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_002.jpg'><img loading=\"lazy\" decoding=\"async\" width=\"113\" height=\"150\" src=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_002-113x150.jpg\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" srcset=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_002-113x150.jpg 113w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_002-227x300.jpg 227w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_002.jpg 775w\" sizes=\"(max-width: 113px) 100vw, 113px\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_003.jpg'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"112\" src=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_003-150x112.jpg\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" srcset=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_003-150x112.jpg 150w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_003-300x225.jpg 300w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_003.jpg 1024w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_004.jpg'><img loading=\"lazy\" decoding=\"async\" width=\"112\" height=\"150\" src=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_004-112x150.jpg\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" srcset=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_004-112x150.jpg 112w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_004-224x300.jpg 224w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_004.jpg 767w\" sizes=\"(max-width: 112px) 100vw, 112px\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_005.jpg'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"113\" src=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_005-150x113.jpg\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" srcset=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_005-150x113.jpg 150w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_005-300x227.jpg 300w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_005.jpg 1024w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_006.jpg'><img loading=\"lazy\" decoding=\"async\" width=\"113\" height=\"150\" src=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_006-113x150.jpg\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" srcset=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_006-113x150.jpg 113w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_006-227x300.jpg 227w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/20110625_006.jpg 776w\" sizes=\"(max-width: 113px) 100vw, 113px\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/gasmeter.png'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"76\" src=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/gasmeter-150x76.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" srcset=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/gasmeter-150x76.png 150w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/gasmeter-300x153.png 300w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/gasmeter-1024x524.png 1024w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/gasmeter.png 1106w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/gasmeterdetails.png'><img loading=\"lazy\" decoding=\"async\" width=\"129\" height=\"150\" src=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/gasmeterdetails-129x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" srcset=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/gasmeterdetails-129x150.png 129w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/gasmeterdetails-258x300.png 258w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/gasmeterdetails.png 797w\" sizes=\"(max-width: 129px) 100vw, 129px\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon landscape'>\n\t\t\t\t<a href='https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/powermeter.png'><img loading=\"lazy\" decoding=\"async\" width=\"150\" height=\"78\" src=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/powermeter-150x78.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" srcset=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/powermeter-150x78.png 150w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/powermeter-300x156.png 300w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/powermeter-1024x535.png 1024w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/powermeter.png 1108w\" sizes=\"(max-width: 150px) 100vw, 150px\" \/><\/a>\n\t\t\t<\/div><\/figure><figure class='gallery-item'>\n\t\t\t<div class='gallery-icon portrait'>\n\t\t\t\t<a href='https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/powermeterdetails.png'><img loading=\"lazy\" decoding=\"async\" width=\"128\" height=\"150\" src=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/powermeterdetails-128x150.png\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" srcset=\"https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/powermeterdetails-128x150.png 128w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/powermeterdetails-256x300.png 256w, https:\/\/katastrophos.net\/andre\/blog\/wp-content\/uploads\/2011\/06\/powermeterdetails.png 790w\" sizes=\"(max-width: 128px) 100vw, 128px\" \/><\/a>\n\t\t\t<\/div><\/figure>\n\t\t<\/div>\n<\/p>\n<p><strong>Installation<\/strong><\/p>\n<p>If you are using FHEM 5.3, please download the tar-ball version (or SVN version for that matter) and directly apply the patch <strong>cul_esa-for-fhem-5.3.patch<\/strong>.<\/p>\n<p><strong>UPDATE 2:<\/strong> Here is a completely patched version based on the tar-ball version of FHEM 5.3: <a class=\"downloadlink\" href=\"http:\/\/katastrophos.net\/downloads\/FHEM\/fhem-5.3-cul_esa.tar.gz\"><strong>fhem-5.3-cul_esa.tar.gz<\/strong> Version: Feb 10th 2013<\/a><\/p>\n<p>If you are using FHEM 5.0:<br \/>\nCopy <strong>19_CUL_ESA.pm<\/strong> and all <strong>.gplot files<\/strong> to your FHEM directories.<br \/>\nSadly adding autocreate support and extending the CUL module to understand the raw message strings requires patching. Check <strong>cul_esa-for-fhem-5.0.patch<\/strong> to patch the files. This was diffed against the Debian package of FHEM 5.0. The very same version of FHEM as tar.gz has some differences in the sourcecode and some files missing. I contacted the author of FHEM about this issue but he has not updated the packages yet. So if you run into issues here it is probably due to these differences.<\/p>\n<p><strong>UPDATE 1:<\/strong> Here is a completely patched version based on the Debian package of FHEM 5.0: <a class=\"downloadlink\" href=\"http:\/\/katastrophos.net\/downloads\/FHEM\/fhem-5.0-cul_esa.tar.gz\"><strong>fhem-5.0-cul_esa.tar.gz<\/strong> Version: Oct 25th 2010<\/a><\/p>\n<p><strong>Here are some notes in German I made while developing the module, mostly concerning the different behavior of the ESA1000GAS compared to the ESA1000WZ:<\/strong><\/p>\n<p>Der ESA1000GAS mit dem ESA1000Z-Messger\u00c3\u00a4t verh\u00c3\u00a4lt sich leider anders als das ESA1000WZ, soda\u00c3\u0178 ich wieder die Korrektur-Faktoren einbinden mu\u00c3\u0178te.<br \/>\nIch konnte nicht herausfinden, wozu der \u00c3\u00bcbermittelte Tick beim ESA1000Z dient. Zwar \u00c3\u00a4ndert sich dieser mit ge\u00c3\u00a4nderter Z\u00c3\u00a4hlerkonstante, allerdings ergibt der Wert im Zusammenhang mit den von der Einheit \u00c3\u00bcbermittelten Werten keinen Sinn, soda\u00c3\u0178 ich hier direkt mit der Z\u00c3\u00a4hlerkonstante multipliziere, um die Kubikmeter zu erhalten, und dann zus\u00c3\u00a4tzlich noch mit dem Umrechnungsfaktor (bei der EWE ergibt sich dieser aus der Zustandszahl * Brennwert Hs) multipliziere, um die Kilowattstunden aus der Gasmenge zu erhalten.<br \/>\nLeider \u00c3\u00a4ndern sich damit die Parameter bei der Definition:<\/p>\n<p>Stromz\u00c3\u00a4hler:<br \/>\n<strong>define CUL_ESA_286 CUL_ESA 1925 286 1 1 23.086<\/strong><br \/>\nalso:<br \/>\ncorr1 = corr2 = 1 (und damit wirkungslos)<br \/>\nCostPerUnit = 23.086 Cent\/kWh<\/p>\n<p>Gasz\u00c3\u00a4hler:<br \/>\n<strong>define CUL_ESA_798 CUL_ESA 1429 798 0.001 9.5154 4.5339<\/strong><br \/>\nalso:<br \/>\ncorr1 = 0.001<br \/>\ncorr2 = 9.5154 kWh\/m3<br \/>\nCostPerUnit = 4.5339 Cent\/kWh<\/p>\n<p>Ich habe ebenfalls noch einen Durchschnittswert in Kilowatt implementiert, soda\u00c3\u0178 man die Durchschnittleistung einigerma\u00c3\u0178en sinnvoll in einem Diagramm darstellen kann. Hier gab es allerdings bei meinem Drehstromz\u00c3\u00a4hler Probleme mit Unterabtastung, weil sich die Drehscheibe bei geringem Verbrauch zu langsam dreht, soda\u00c3\u0178 das Me\u00c3\u0178ger\u00c3\u00a4t zwischendurch schon Nullwerte zur\u00c3\u00bcckmeldet, weil kein Impuls eingegangen ist. Daf\u00c3\u00bcr habe ich einen entsprechenden Schwellenwert bei der Berechnung des Durchschnittswertes implementiert. Nicht sch\u00c3\u00b6n, funktioniert aber f\u00c3\u00bcr meine Zwecke.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FHEM, the amazing home-automation server software, already has support for several sensors, meters and switches produced by ELV. In October 2010 I bought two meters, ESA1000WZ and ESA1000GAS for my house in the hope that FHEM would support them. Unfortunately it did not (at the time). I quickly found some hints that somebody, namely Gerd [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[20,19,39,13,38,16],"class_list":["post-515","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-development","tag-hack","tag-home-automation","tag-server","tag-software","tag-thoughts"],"_links":{"self":[{"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/posts\/515"}],"collection":[{"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/comments?post=515"}],"version-history":[{"count":33,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/posts\/515\/revisions"}],"predecessor-version":[{"id":552,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/posts\/515\/revisions\/552"}],"wp:attachment":[{"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/media?parent=515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/categories?post=515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/katastrophos.net\/andre\/blog\/wp-json\/wp\/v2\/tags?post=515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}