{"id":582,"date":"2019-07-31T17:41:55","date_gmt":"2019-07-31T16:41:55","guid":{"rendered":"https:\/\/www.flat-planet.net\/?p=582"},"modified":"2019-07-31T17:41:55","modified_gmt":"2019-07-31T16:41:55","slug":"hass-io-and-a-custom-relay","status":"publish","type":"post","link":"https:\/\/flat-planet.net\/?p=582","title":{"rendered":"Hass.io and a custom relay"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">While I&#8217;m currently <a href=\"https:\/\/www.openhab.org\/\">OpenHab<\/a> based, I was looking into Hass.io as an option, but that does leave the challenge of getting my <a href=\"https:\/\/www.flat-planet.net\/?p=575\">WiFi controlled relays<\/a> to work correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This turns out to be fairly simple in the end, by using the platform command-line option + CURL<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nswitch:\n   - platform: command_line\n     switches:\n        relay1:\n          command_on: &#039;\/usr\/bin\/curl -X GET http:\/\/&amp;lt;ip address&gt;\/relay\/on&#039;\n          command_off: &#039;\/usr\/bin\/curl -X GET http:\/\/&amp;lt;ip address&gt;\/relay\/off&#039;\n          command_state: &#039;\/usr\/bin\/curl -X GET http:\/\/&amp;lt;ip address&gt;\/relay\/state&#039;\n          value_template: &#039;{{ value == &quot;ON&quot; }}&#039;\n          friendly_name: My Relay\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>While I&#8217;m currently OpenHab based, I was looking into Hass.io as an option, but that does leave the challenge of getting my WiFi controlled relays to work correctly. This turns out to be fairly simple in the end, by using the platform command-line option + CURL<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[70,380,383],"series":[],"class_list":["post-582","post","type-post","status-publish","format-standard","hentry","category-projects","tag-home-automation","tag-relay","tag-hass-io"],"_links":{"self":[{"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/posts\/582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=582"}],"version-history":[{"count":1,"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/posts\/582\/revisions"}],"predecessor-version":[{"id":583,"href":"https:\/\/flat-planet.net\/index.php?rest_route=\/wp\/v2\/posts\/582\/revisions\/583"}],"wp:attachment":[{"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=582"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/flat-planet.net\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}