{"id":5293,"date":"2018-03-15T21:04:38","date_gmt":"2018-03-15T20:04:38","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=5293"},"modified":"2018-03-24T20:22:48","modified_gmt":"2018-03-24T19:22:48","slug":"homeautomation-read-values-from-a-luxtronic2-heatpump-to-a-mqtt-broker","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/homeautomation-read-values-from-a-luxtronic2-heatpump-to-a-mqtt-broker\/","title":{"rendered":"Homeautomation: Read values from a Luxtronic2 Heatpump to a MQTT broker"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_5293 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_5293')){$('.twoclick_social_bookmarks_post_5293').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"Homeautomation%3A%20Read%20values%20from%20a%20Luxtronic2%20Heatpump%20to%20a%20MQTT%20broker\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Aduring%20automation%20of%20my%20home%20with%20OpenHab%20I%20had%20to%20include%20my%20Alpha%20Innotec%20Headpump%20because%20I%20want%20to%20display%20some%20values%20like%20temperature%2C%20errors...%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/homeautomation-read-values-from-a-luxtronic2-heatpump-to-a-mqtt-broker\\\/\",\"post_id\":5293,\"post_title_referrer_track\":\"Homeautomation%3A+Read+values+from+a+Luxtronic2+Heatpump+to+a+MQTT+broker\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>during automation of my home with OpenHab I had to include my Alpha Innotec Headpump because I want to display some values like temperature, errors&#8230;<br \/>\n<!--more--><br \/>\nI found some scripts which reads the values from the machine but only displays them in the screen. But I want to use them in Openhab.<\/p>\n<p>Writing values to a file and read them with OpenHab was not an option.<\/p>\n<p>Therefore I tried to write the values to an MQTT Broker, in my case mosquitto, so that other Homeautomationsystems like <a href=\"https:\/\/nodered.org\/\" target=\"_blank\" rel=\"noopener\">Nodered<\/a> can use them too.<\/p>\n<p>The script was written in python because libraries for all tasks (Read socket, write mqtt) are  available and they are easy to use.<\/p>\n<p>The publish path is defined my the prefix <code>sPrefixPublishPath='home\/heatpump\/0\/'<\/code>, followed by the Valuename of the Heatpump.<\/p>\n<p>For example the outside temperatures publish path is : <code>home\/heatpump\/0\/Temperatur_TA<\/code>.<\/p>\n<p>The payload is an json object:<br \/>\n<code><br \/>\n{<br \/>\n     \"Description\" : \"Aussentemperatur (\u00b0C)\",<br \/>\n     \"Name\" : \"Temperatur_TA\",<br \/>\n     \"Field\" : 15,<br \/>\n     \"Value\" : 8.2,<br \/>\n     \"Details\" : \"\"<br \/>\n}<br \/>\n{<br \/>\n  \"Description\" : \"Abtauen seit (hh:mm:ss)\",<br \/>\n  \"Name\" : \"Time_AbtIn\",<br \/>\n  \"Field\" : 141,<br \/>\n  \"Value\" : 595,<br \/>\n  \"Details\" : \"0:09:55\"<br \/>\n}<br \/>\n<\/code><\/p>\n<ul>\n<li><strong>Name:<\/strong> is the variable name<\/li>\n<li><strong>Field: <\/strong>is the index of the Data(One packet with ~200 4 Bytes Integer Values) returned by the Heatpump<\/li>\n<li><strong>Value: <\/strong>is the raw value returned<\/li>\n<li><strong>Description: <\/strong>is defined for each variable name in aValueDefinition<\/li>\n<li><strong>Details<\/strong>: further details if available(IP Address, Heatpumptype, OperatingState&#8230;)<\/li>\n<\/ul>\n<p>I&#8217;m not 100% sure if the Datatypes of the fields greater 120 are defined correct. Any improvements are welcome. Script is also published at <a href=\"https:\/\/github.com\/Race666\/Luxtronics2MQTT\" rel=\"noopener\" target=\"_blank\">github<\/a>. Please send pull requests!<\/p>\n<p>To run the script the following python modules are requiered:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\napt-get install \r\npip3 install setuptools wheel\r\npip3 install paho-mqtt\r\n<\/pre>\n<p>I used python3 but it should also work with 2.7.<\/p>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, during automation of my home with OpenHab I had to include my Alpha Innotec Headpump because I want to display some values like temperature, errors&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1151],"tags":[1155,1159,1157,1154,1156,247,1152,1153,1158],"class_list":["post-5293","post","type-post","status-publish","format-standard","hentry","category-homeautomation","tag-alpha-innctec","tag-heatpump","tag-home","tag-luxtronic","tag-mqtt","tag-read","tag-state","tag-values","tag-warempumpe"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=5293"}],"version-history":[{"count":12,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5293\/revisions"}],"predecessor-version":[{"id":5308,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/5293\/revisions\/5308"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=5293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=5293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=5293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}