{"id":1943,"date":"2021-08-01T14:47:32","date_gmt":"2021-08-01T12:47:32","guid":{"rendered":"http:\/\/jeedom.sigalou-domotique.fr\/?p=1943"},"modified":"2021-08-01T18:12:50","modified_gmt":"2021-08-01T16:12:50","slug":"un-relais-domotique-pour-2-61e","status":"publish","type":"post","link":"https:\/\/www.sigalou-domotique.fr\/en\/un-relais-domotique-pour-2-61e","title":{"rendered":"A home automation relay for 2.61\u20ac"},"content":{"rendered":"<h2>Objective<\/h2>\n<p>Using a Chinese home automation relay: <span data-spm-anchor-id=\"a2g0o.detail.1000023.i0.49b857d8JLqU9g\">10A\/250VAC 10A\/30VDC associated with a WIFI module (ESP8266 module), we can have a relay in <strong>electrical cut-off or dry contact<\/strong>.<\/span><\/p>\n<p>And as a bonus, in addition to the interface in Jeedom, it is possible to order this relay from anywhere in the world with a simple internet connection.<!--more--><\/p>\n<h2>Material<\/h2>\n<p>The ordered package costs \u20ac2.61, including shipping.<\/p>\n<table style=\"width: 100%; border-collapse: collapse;\" border=\"2\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1944\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/espwifi.png\" alt=\"\" width=\"1011\" height=\"411\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/espwifi.png 1011w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/espwifi-600x244.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/espwifi-300x122.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/espwifi-768x312.png 768w\" sizes=\"auto, (max-width: 1011px) 100vw, 1011px\" \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>It is specified that this equipment worked with Tuya or SmartLife, I quickly tried to connect to Wifi AI-THINKER_D8D017 out of curiosity but there is no web server, you have to send AT commands. I am not wasting time on this, but it must explain the negative opinions on the buyer\u2019s page, as customers probably want a product that is close to being used.<\/p>\n<h2>Flashing the EPS-01S Wifi Module<\/h2>\n<h3>Module connectors<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1945\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/esp01sdos.png\" alt=\"\" width=\"377\" height=\"261\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/esp01sdos.png 377w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/esp01sdos-300x208.png 300w\" sizes=\"auto, (max-width: 377px) 100vw, 377px\" \/><\/p>\n<h3>Connection to the FTDI<\/h3>\n<p>As explained in the other tutorials on flashing Sonoff products, an FTDI232 must be used:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1946\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/FTDI232.png\" alt=\"\" width=\"195\" height=\"260\" \/><\/p>\n<ul>\n<li>the 3V3 together<\/li>\n<li>the NDGs together<\/li>\n<li>the TX on the RX<\/li>\n<li>the RX on the TX<\/li>\n<li>The GPIO IO0 at the GND<\/li>\n<li>EN to 3V3<\/li>\n<\/ul>\n<h3>Flash Software<\/h3>\n<p>Go get the latest version of <a href=\"https:\/\/github.com\/letscontrolit\/ESPEasy\/releases\" target=\"_blank\" rel=\"noopener\">ESP EASY<\/a><\/p>\n<p>I took <a href=\"https:\/\/github.com\/letscontrolit\/ESPEasy\/releases\/download\/mega-20210503\/ESPEasy_ESP82xx_mega-20210503.zip\" target=\"_blank\" rel=\"noopener\">ESPEasy_ESP82xx_mega-20210503.zip<\/a> to create this tutorial.<\/p>\n<p>Unzip the zip in a folder. Retrieve the ESP_Easy_mega_20210503_normal_ESP8266_1M.bin file from the bin folder and remount it next to the FlashESP8266.exe file<\/p>\n<p>Launch FlashESP8266.exe, select the FTDI port and select the Firmware and then Launch the <strong>Flash<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1949\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/flasher.png\" alt=\"\" width=\"406\" height=\"225\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/flasher.png 406w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/flasher-300x166.png 300w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/p>\n<p>If all goes well, it ends with:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1950\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/flasher2.png\" alt=\"\" width=\"137\" height=\"139\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/flasher2.png 137w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/flasher2-100x100.png 100w\" sizes=\"auto, (max-width: 137px) 100vw, 137px\" \/><\/p>\n<p>Disconnect and store the FTDI.<\/p>\n<h2>Connect to Wifi<\/h2>\n<p>First, it is necessary to configure the Wifi.<\/p>\n<p>Connect the Wifi module to the yellow terminal block of the relay.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-1951\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/relaiswifi.png\" alt=\"\" width=\"216\" height=\"216\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/relaiswifi.png 450w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/relaiswifi-300x300.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/relaiswifi-100x100.png 100w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/relaiswifi-150x150.png 150w\" sizes=\"auto, (max-width: 216px) 100vw, 216px\" \/><\/p>\n<p>Power the module in 5v.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1953\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/5v-1.png\" alt=\"\" width=\"181\" height=\"198\" \/><\/p>\n<p>Connect to the Wi-Fi generated by the module with the mobile phone. (ESP-Easy). If a password is required, it is <strong>configesp<\/strong><\/p>\n<p>Go to 192.168.4.1 for the Wi-Fi identification page.<\/p>\n<p>Choosing the Wi-Fi of the local network, putting the password and clicking on Connect, this will relaunch the connection.<\/p>\n<p>Depending on the version of Esp Easy, the page is reloaded and the IP can be retrieved or the last IP assigned by the DHCP can be seen in the router.<\/p>\n<p>Enter the IP address in a browser on the local network to access Esp Easy.<\/p>\n<h2>Orders to be sent<\/h2>\n<p>Nothing was really well documented, it was necessary to look for the commands to be sent to operate the relay module.<\/p>\n<p>Reminder: When the relay is deactivated or switched off:<\/p>\n<ul>\n<li>NC (Normally Closed) is glued (On) and<\/li>\n<li>NO (Normally Open) is open (Off).<\/li>\n<\/ul>\n<p>I found 4 commands that work (192.168.1.93 being the ip of my module)<\/p>\n<ul>\n<li>http:\/\/192.168.1.93\/control?cmd=GPIO,2,1 <strong>Turn off the LED<\/strong><\/li>\n<li>http:\/\/192.168.1.93\/control?cmd=GPIO,2,0 <strong>Turn on the LED<\/strong><\/li>\n<li>http:\/\/192.168.1.93\/control?cmd=GPIO,0,1 <strong>Activate Relay<\/strong> NC Off and NF On<\/li>\n<li>http:\/\/192.168.1.93\/control?cmd=GPIO,0,0 <strong>Disables relay<\/strong> NC On and NF Off<\/li>\n<\/ul>\n<h2>Configuration of LED and Contact devices<\/h2>\n<table style=\"width: 100%; border-collapse: collapse;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1957\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/led-1.png\" alt=\"\" width=\"562\" height=\"287\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/led-1.png 562w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/led-1-300x153.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u00a0<\/p>\n<table style=\"width: 100%; border-collapse: collapse;\" border=\"1\">\n<tbody>\n<tr>\n<td style=\"width: 100%;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1958\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/contact.png\" alt=\"\" width=\"575\" height=\"293\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/contact.png 575w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/contact-300x153.png 300w\" sizes=\"auto, (max-width: 575px) 100vw, 575px\" \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Integration in Jeedom<\/h2>\n<p>For integration in Jeedom, we follow the ESPEasy plugin documentation or my other tutorials on integrating Sonoff modules.<\/p>\n<p>Both Contact and Led info appear automatically<\/p>\n<p>The commands to add are to send On or Off to the Led or to the contact<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1959\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/commandes.png\" alt=\"\" width=\"470\" height=\"579\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/commandes.png 470w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/commandes-244x300.png 244w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/><\/p>\n<p>And on the DashBoard:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1960\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/dashboard.png\" alt=\"\" width=\"290\" height=\"103\" \/><\/p>\n<h2>Bonus: Reach this relay without going through Jeedom, from outside<\/h2>\n<h3>Configure router<\/h3>\n<p>Reach port 80 of the relay thanks to port 1993 from the internet.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1965\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/routeur1980-1.png\" alt=\"\" width=\"510\" height=\"298\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/routeur1980-1.png 510w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/routeur1980-1-300x175.png 300w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/p>\n<p>Thus, with the IP address of the box (or Reverse DNS) the relay can be accessed from the outside.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1966\" src=\"http:\/\/jeedom.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/exterieur-1.png\" alt=\"\" width=\"646\" height=\"467\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/exterieur-1.png 646w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/exterieur-1-600x434.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2021\/08\/exterieur-1-300x217.png 300w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/p>\n<p>Or send a paste command to the relay:<\/p>\n<ul>\n<li><strong>http:\/\/xxx.hd.free.fr:1993\/control?cmd=GPIO,0,1<\/strong><\/li>\n<\/ul>\n<h2>Requests for clarification, \u2026 questions<\/h2>\n<p>Please use the Jeedom forum rather than the comments below which are much less convenient for me.<\/p>\n<p><a href=\"https:\/\/community.jeedom.com\/t\/un-relais-domotique-pour-2-61\/65392\" target=\"_blank\" rel=\"noopener\"><strong>https:\/\/community.jeedom.com\/t\/un-relais-domotique-pour-2-61\/65392<\/strong><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>","protected":false},"excerpt":{"rendered":"<p>Objective Using a Chinese home automation relay: 10A\/250VAC 10A\/30VDC combined with a WIFI module (module ESP8266), we can have a relay in power outage or dry contact. And as a bonus, in addition to the interface in Jeedom, it is possible to order this relay from anywhere in the world with a simple connection [...]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14],"tags":[],"class_list":["post-1943","post","type-post","status-publish","format-standard","hentry","category-domotique"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/1943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/comments?post=1943"}],"version-history":[{"count":0,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/1943\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/media?parent=1943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/categories?post=1943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/tags?post=1943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}