{"id":4764,"date":"2020-02-17T12:51:47","date_gmt":"2020-02-17T11:51:47","guid":{"rendered":"http:\/\/blog.fh-kaernten.at\/ingmarsretro\/?p=4764"},"modified":"2021-02-23T11:27:31","modified_gmt":"2021-02-23T10:27:31","slug":"homematic-nachrichten-per-telegram-update","status":"publish","type":"post","link":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/2020\/02\/17\/homematic-nachrichten-per-telegram-update\/","title":{"rendered":"Homematic Nachrichten per Telegram UPDATE"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_4764\" class=\"pvc_stats all  \" data-element-id=\"4764\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p style=\"text-align: justify\"><strong>Update<\/strong>: bei mir war auch die Pfadangabe zum &#8222;<em>curl<\/em>&#8220; Befehl das Problem. Mit Angabe des &#8222;pseudo&#8220; absoluten Pfades zum Befehl wurde er nicht mehr gefunden. Siehe unten:<\/p>\n<p>&nbsp;es gen\u00fcgt, den curl Befehl direkt aufzurufen, also anstelle von : &#8230;.<em>State(&#8222;extra\/curl -s -k https:\/\/api.telegram.org\/bot&#8220;#botAPI#&#8220;\/sendMessage<\/em>&#8230;..<\/p>\n<p>die Pfadangabe &#8222;extra\/&#8220; entfernen, je nach CCU Variante und Cuxd Version, also:&nbsp; &#8230;&#8230; <em>State(&#8222;curl -s -k https:\/\/api.telegram.org\/bot&#8220;#botAPI#&#8220;\/sendMessage<\/em> &#8230;..<\/p>\n<p>Wer sich nicht sicher ist, wo das Kommando liegt, am besten im cuxd oder \u00fcber SSH nachsehen&#8230;<\/p>\n<p><strong>Update Ende.<\/strong><\/p>\n<p style=\"text-align: justify\">In den Kommentaren zum Beitrag &#8222;<a href=\"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/2019\/09\/09\/homematic-nachrichten-pushen-mit-telegram\/\">Nachrichten pushen mit Telegram<\/a>&#8220; wurde mehrfach darauf hingewiesen, dass die Push Nachrichten nicht mehr gesendet werden. Zuerst dachte ich es gibt irgendwelche grundlegende \u00c4nderungen bei der Telegram Api. Aber dem war nicht so. Also habe ich noch einmal ein Skript zusammengebastelt. Um zu debuggen, habe ich einen gesamten String aus einzelnen Teilen zusammengebaut. Das ist zwar alles andere als sch\u00f6n, aber es l\u00e4sst sich leichter nachvollziehen was funktioniert oder eben nicht. Auch den Pfad zum curl-Kommando habe ich vollst\u00e4ndig angegeben. Mit dem folgenden Beispiel Skript funktioniert bei mir die Textausgabe wieder:<\/p>\n<pre style=\"font-family: arial;font-size: 12px;border: 1px dashed #CCCCCC;width: 99%;height: auto;overflow: auto;background: #f0f0f0;;background-image: url('https:\/\/2.bp.blogspot.com\/_z5ltvMQPaa8\/SjJXr_U2YBI\/AAAAAAAAAAM\/46OqEP32CJ8\/s320\/codebg.gif');padding: 0px;color: #000000;text-align: left;line-height: 20px\"><code style=\"color: #000000\"> string msg = \"Hallo Telegram\";  \r\n string chatid = \"123456789\";                     \r\n string botAPI = \"987654321:AABBCCDDEEFFGGGHHIIJJKKLLMMNNOOPPQQ\";   \r\n string request;  \r\n string command1 = \"\/usr\/local\/addons\/cuxd\/curl -s -k https:\/\/api.telegram.org\/bot\"; !#botAPI#   \r\n string command2 = \"\/sendMessage -F text=\"; !#msg#   \r\n string command3 = \" -F chat_id=\"; !#chatid#  \r\n request = command1+botAPI+command2+msg+command3+chatid;  \r\n dom.GetObject(\"CUxD.CUX2801001:1.CMD_EXEC\").State(request);  \r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>Dann sollte alles wieder klappen&#8230;.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_4764\" class=\"pvc_stats all  \" data-element-id=\"4764\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>Update: bei mir war auch die Pfadangabe zum &#8222;curl&#8220; Befehl das Problem. Mit Angabe des &#8222;pseudo&#8220; absoluten Pfades zum Befehl wurde er nicht mehr gefunden. Siehe unten: &nbsp;es gen\u00fcgt, den curl Befehl direkt aufzurufen, also anstelle von : &#8230;.State(&#8222;extra\/curl -s -k https:\/\/api.telegram.org\/bot&#8220;#botAPI#&#8220;\/sendMessage&#8230;.. die Pfadangabe &#8222;extra\/&#8220; entfernen, je nach CCU Variante und Cuxd Version, also:&nbsp; &#8230;&#8230;&hellip; <br \/> <a class=\"read-more\" href=\"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/2020\/02\/17\/homematic-nachrichten-per-telegram-update\/\">Weiterlesen<\/a><\/p>\n","protected":false},"author":86,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"ngg_post_thumbnail":0,"footnotes":""},"categories":[1],"tags":[469,1311,1310,1314,1313,1307,1306,1382,1308,1303,1304,1305,1312,1309],"class_list":["post-4764","post","type-post","status-publish","format-standard","hentry","category-allgemeines","tag-ccu","tag-cux-daemon","tag-cuxd","tag-dlink-dcs932","tag-fd81xx","tag-homematic-ipcam","tag-homematic-push-nachrichten","tag-homematic-telegram-funktioniert-nichth-mehr","tag-ipcam-bilder-per-telegram","tag-telegram","tag-telegram-messenger","tag-telegram-und-homematic","tag-vivotec","tag-whatsapp-alternative"],"a3_pvc":{"activated":true,"total_views":251,"today_views":0},"_links":{"self":[{"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/posts\/4764","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/users\/86"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/comments?post=4764"}],"version-history":[{"count":0,"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/posts\/4764\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/media?parent=4764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/categories?post=4764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/ingmarsretro\/wp-json\/wp\/v2\/tags?post=4764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}