{"id":12586,"date":"2019-01-16T20:48:58","date_gmt":"2019-01-16T19:48:58","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=12586"},"modified":"2020-09-04T07:41:38","modified_gmt":"2020-09-04T05:41:38","slug":"alexa-echo-sprachausgabe-via-raspberry-pi-und-openhab-2","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=12586","title":{"rendered":"Alexa Echo Sprachausgabe via Raspberry Pi und openHAB 2"},"content":{"rendered":"<p>Wie kann man eine Sprachausgabe \u00fcber Alexa Echo machen wenn die T\u00fcr aufgeht? Bei mir kommt z.B. eine Ansage von Alexa &#8222;<strong>Die Haust\u00fcr ist ge\u00f6ffnet worden<\/strong>&#8220; oder &#8222;<strong>Die Haust\u00fcr wurde geschlossen<\/strong>&#8222;. Das l\u00e4uft bei mir analog auch f\u00fcr die Fenster, alles mit Kontakten von Homematic und einem CUL im USB des Pi.<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2020-09-04-um-07.40.44.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2020-09-04-um-07.40.44.png\" alt=\"\" width=\"1558\" height=\"1180\" class=\"aligncenter size-full wp-image-15264\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2020-09-04-um-07.40.44.png 1558w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2020-09-04-um-07.40.44-300x227.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2020-09-04-um-07.40.44-1024x776.png 1024w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2020-09-04-um-07.40.44-768x582.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2020-09-04-um-07.40.44-1536x1163.png 1536w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Wenn openHAB 2 l\u00e4uft, braucht man nur eine Rules Datei: \/etc\/openhab2\/rules\/Alexa.rules mit folgenden Regeln kopieren: <!--more--><\/p>\n<pre class=\"lang:default decode:true \" >\r\n\r\n# (c) 2019 Thomas Wenzlaff\r\n\r\nrule \"Alexa Haust\u00fcr ge\u00f6ffnet\"\r\nwhen\r\n    Item flurKontakt changed from 0 to 1\r\nthen\r\n    Echo_Living_Room_TTS.sendCommand('Die Haust\u00fcr wurde ge\u00f6ffnet. Wer kommt den da?')\r\nend\r\n\r\n\r\nrule \"Alexa Haust\u00fcr geschlossen\"\r\nwhen\r\n    Item flurKontakt changed from 1 to 0\r\nthen\r\n    Echo_Living_Room_TTS.sendCommand('Die Haust\u00fcr wurde geschlossen.')\r\nend\r\n\r\nrule \"Alexa Fenter ge\u00f6ffnet\"\r\nwhen\r\n    Item arbeitszimmerFensterKontakt changed from 0 to 1\r\nthen\r\n    Echo_Living_Room_TTS.sendCommand('Das Fenster im Arbeitszimmer wurde ge\u00f6ffnet.')\r\nend\r\n\r\n\r\nrule \"Alexa Fenster geschlossen\"\r\nwhen\r\n    Item arbeitszimmerFensterKontakt changed from 1 to 0\r\nthen\r\n    Echo_Living_Room_TTS.sendCommand('Das Fenster im Arbeitszimmer wurde geschlossen.')\r\nend\r\n<\/pre>\n<p>Dann noch die Variablen der Kontakte den eigenen Namen anpassen.<\/p>\n<p>Und eine Item Datei \/etc\/openhab2\/items\/Alexa.items mit diesem Inhalt:<\/p>\n<pre class=\"lang:default decode:true \" >\r\nString Echo_Living_Room_TTS                   \"Text to Speech\"                        (Alexa_Living_Room) {channel=\"amazonechocontrol:echo:6c17bfb6:G090QU067XXXXXXXX:textToSpeech\"}\r\n<\/pre>\n<p>Der Channel muss mit der eigenen Nr. angepasst werden. Die kann hier aus den things kopiert werden:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2019-01-16-um-20.35.59.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2019-01-16-um-20.35.59.png\" alt=\"\" width=\"1040\" height=\"590\" class=\"aligncenter size-full wp-image-12590\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2019-01-16-um-20.35.59.png 1040w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2019-01-16-um-20.35.59-300x170.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2019-01-16-um-20.35.59-768x436.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2019-01-16-um-20.35.59-1024x581.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Vorher muss man aber noch das Binding f\u00fcr Amazon Echo installieren:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2019-01-16-um-20.35.09.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2019-01-16-um-20.35.09.png\" alt=\"\" width=\"985\" height=\"520\" class=\"aligncenter size-full wp-image-12591\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2019-01-16-um-20.35.09.png 985w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2019-01-16-um-20.35.09-300x158.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/01\/Bildschirmfoto-2019-01-16-um-20.35.09-768x405.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Weitere Infos und Ideen direkt im <a href=\"https:\/\/www.openhab.org\/addons\/bindings\/amazonechocontrol\/\" rel=\"noopener noreferrer\" target=\"_blank\">Amazon Echo Control Binding<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wie kann man eine Sprachausgabe \u00fcber Alexa Echo machen wenn die T\u00fcr aufgeht? Bei mir kommt z.B. eine Ansage von Alexa &#8222;Die Haust\u00fcr ist ge\u00f6ffnet worden&#8220; oder &#8222;Die Haust\u00fcr wurde geschlossen&#8222;. Das l\u00e4uft bei mir analog auch f\u00fcr die Fenster, alles mit Kontakten von Homematic und einem CUL im USB des Pi. Wenn openHAB 2 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.wenzlaff.de\/?p=12586\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eAlexa Echo Sprachausgabe via Raspberry Pi und openHAB 2\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[220,852,808,2807,1023,2752],"tags":[3066,3517,3518,3519,2576,1596,497,881,1247,1144,2808,3516,809,880],"class_list":["post-12586","post","type-post","status-publish","format-standard","hentry","category-anleitung","category-heimautomatisierung","category-linux-2","category-openhab2","category-raspberry-pi","category-raspberry-pi-zero-w","tag-alexa","tag-alexa-echo","tag-amazona","tag-amazona-binding","tag-binding","tag-dot","tag-echo","tag-fenster","tag-hausautomatisation","tag-kontakt","tag-openhab2","tag-sprachausgabe","tag-sprache","tag-tuer"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/12586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12586"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/12586\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12586"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}