{"id":114,"date":"2017-05-10T21:09:13","date_gmt":"2017-05-10T19:09:13","guid":{"rendered":"https:\/\/dev.drun.net\/?p=114"},"modified":"2017-05-10T21:09:13","modified_gmt":"2017-05-10T19:09:13","slug":"controlling-sonoff-devices-from-domoticz","status":"publish","type":"post","link":"https:\/\/dev.krasi.net\/?p=114","title":{"rendered":"Controlling Sonoff devices from Domoticz"},"content":{"rendered":"<p>It&#8217;s very easy to control Sonoff power switch devices that <a href=\"\/2017\/04\/27\/customizing-sonoff-esp-switch-to-work-with-anything\/\">were updated with ESPEasy firmware<\/a>.<\/p>\n<p>You can practically control them with commands like these ( explained and configured in the previous post ):<\/p>\n<p>On action:<\/p>\n<pre>http:\/\/192.168.88.20\/control?cmd=event,TurnOn<\/pre>\n<p>Off action:<\/p>\n<pre>http:\/\/192.168.88.20\/control?cmd=event,TurnOff<\/pre>\n<p>&nbsp;<\/p>\n<p>So, to control them from Domoticz, all you need to do is add a virtual device, type switch:<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-134\" src=\"https:\/\/dev.krasi.net\/wp-content\/uploads\/2017\/05\/domoticz_sonoff1.png\" alt=\"\" width=\"790\" height=\"270\" \/><\/p>\n<p>and configure it&#8217;s on \/ off actions\u00a0like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-135\" src=\"https:\/\/dev.krasi.net\/wp-content\/uploads\/2017\/05\/domoticz_sonoff2-1024x604.png\" alt=\"\" width=\"960\" height=\"566\" \/><\/p>\n<p>Now, when you press the icon, the Sonoff will switch On or Off. You can also send these events from within Domoticz&#8217;s highly <em>sophisticated scripting interface<\/em> or <em>Events<\/em>, it&#8217;s up to you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s very easy to control Sonoff power switch devices that were updated with ESPEasy firmware. You can practically control them with commands like these ( explained and configured in the previous post ): On action: http:\/\/192.168.88.20\/control?cmd=event,TurnOn Off action: http:\/\/192.168.88.20\/control?cmd=event,TurnOff &nbsp; So, to control them from Domoticz, all you need to do is add a virtual device, type switch: and configure it&#8217;s on \/ off actions\u00a0like this: Now, when you press the icon, the Sonoff will switch On or Off. You can also send these events from within Domoticz&#8217;s highly sophisticated scripting interface or Events, it&#8217;s up to you.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/dev.krasi.net\/index.php?rest_route=\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.krasi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.krasi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.krasi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.krasi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=114"}],"version-history":[{"count":0,"href":"https:\/\/dev.krasi.net\/index.php?rest_route=\/wp\/v2\/posts\/114\/revisions"}],"wp:attachment":[{"href":"https:\/\/dev.krasi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.krasi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.krasi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}