{"id":2367,"date":"2020-12-06T20:13:34","date_gmt":"2020-12-06T19:13:34","guid":{"rendered":"https:\/\/blog.rostman.pl\/?p=2367"},"modified":"2021-04-18T13:56:48","modified_gmt":"2021-04-18T11:56:48","slug":"sonoff-rf-r2-pir-am312-am2301","status":"publish","type":"post","link":"https:\/\/rostman.eu\/index.php\/2020\/12\/06\/sonoff-rf-r2-pir-am312-am2301\/","title":{"rendered":"Sonoff RF R2 + PIR AM312 + AM2301"},"content":{"rendered":"<p>Zast\u0105pienie ORNO AKO001 SONOFF-em RF R2 + pomiar temperatury.<br \/>\nSonoff ma wgrany soft TASMOTA i wyprowadzone piny:<br \/>\nGND &#8211; kolor br\u0105zowy<br \/>\nTX &#8211; kolor pomara\u0144czowy<br \/>\nRX &#8211; kolor \u017c\u00f3\u0142ty<br \/>\n3V3 &#8211; kolor czerwony<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2369\" src=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/SONOF_RF_R2-300x219.png\" alt=\"\" width=\"300\" height=\"219\" srcset=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/SONOF_RF_R2-300x219.png 300w, https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/SONOF_RF_R2.png 553w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>AM2301<br \/>\nGND &#8211; kolor czarny po\u0142\u0105czony z br\u0105zowym<br \/>\nSDA &#8211; kolor \u017c\u00f3\u0142ty<br \/>\nVDD &#8211; kolor czerwony<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2371\" src=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/AM2301-300x159.png\" alt=\"\" width=\"300\" height=\"159\" srcset=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/AM2301-300x159.png 300w, https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/AM2301.png 424w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>AM312<br \/>\nGND &#8211; kolor br\u0105zowy<br \/>\nVOUT &#8211; kolor pomara\u0144czowy<br \/>\nVCC &#8211; kolor czerwony<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2370\" src=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/AM312-300x133.png\" alt=\"\" width=\"300\" height=\"133\" srcset=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/AM312-300x133.png 300w, https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/AM312.png 368w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Schemat po\u0142\u0105cze\u0144<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2375\" src=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/Pola\u0328czenia-300x262.png\" alt=\"\" width=\"300\" height=\"262\" srcset=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/Pola\u0328czenia-300x262.png 300w, https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/Pola\u0328czenia.png 531w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Ustawienia w TASMOTA<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2377\" src=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/TASMOTA-191x300.png\" alt=\"\" width=\"191\" height=\"300\" srcset=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/TASMOTA-191x300.png 191w, https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/TASMOTA.png 378w\" sizes=\"(max-width: 191px) 100vw, 191px\" \/><\/p>\n<p>Ustawienie idx dla prze\u0142\u0105cznika i czujnika AM2301 w Domoticzu<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2381\" src=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/IDX-187x300.png\" alt=\"\" width=\"187\" height=\"300\" srcset=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/IDX-187x300.png 187w, https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/IDX.png 396w\" sizes=\"(max-width: 187px) 100vw, 187px\" \/><\/p>\n<p>Regu\u0142y:<\/p>\n<pre><code>switchmode1 1\r\nrule1 ON switch1#state DO publish SYPIALNIA2\/PIR\/state %value% ENDON\r\nrule1 1<\/code><\/pre>\n<p>Dodanie do DOMOTICZ-a czujnika PIR o idx 41:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2379\" src=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/PIR1-300x108.png\" alt=\"\" width=\"300\" height=\"108\" srcset=\"https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/PIR1-300x108.png 300w, https:\/\/rostman.eu\/wp-content\/uploads\/2020\/12\/PIR1.png 390w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<pre><code>rule2 ON switch1#state=0 DO publish domoticz\/in {\"idx\":41,\"nvalue\":0} ENDON\r\nON switch1#state=1 DO publish domoticz\/in {\"idx\":41,\"nvalue\":1} ENDON\r\nrule2 1<\/code><\/pre>\n<p>Ustawienie aby po wykryciu ruchu w\u0142\u0105czy\u0142 si\u0119 na 120 sekund<\/p>\n<pre><code>rule3 ON switch1#state=1 DO backlog power1 ON; ruletimer1 120 ENDON ON rules#timer=1 DO power1 OFF ENDON\r\nrule3 1<\/code><\/pre>\n<p>Poprawiona regu\u0142a o to \u017ce zadzia\u0142a w nocy:<\/p>\n<pre><code>Rule1 ON Switch1#State=1 DO Backlog Event checksunrise=%time%; Event checksunset=%time% ENDON ON Event#checksunrise&lt;%sunrise% DO Backlog Power 1; RuleTimer1 120\r\nENDON ON Event#checksunset&gt;%sunset% DO Backlog Power 1; RuleTimer1 120 ENDON ON Rules#Timer=1 DO Power 0 ENDON<\/code><\/pre>\n<pre><code>rule1 1<\/code><\/pre>\n<p>&#8211; aktywacja regu\u0142y<\/p>\n<pre><code>rule1 \"<\/code><\/pre>\n<p>&#8211; kasowanie regu\u0142y<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zast\u0105pienie ORNO AKO001 SONOFF-em RF R2 + pomiar temperatury. Sonoff ma wgrany soft TASMOTA i wyprowadzone piny: GND &#8211; kolor br\u0105zowy TX &#8211; kolor pomara\u0144czowy RX &#8211; kolor \u017c\u00f3\u0142ty 3V3 &#8211; kolor czerwony AM2301 GND &#8211; kolor czarny po\u0142\u0105czony z br\u0105zowym SDA &#8211; kolor \u017c\u00f3\u0142ty VDD &#8211; kolor czerwony AM312 GND &#8211; kolor br\u0105zowy VOUT [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[148],"tags":[151,152,154,149,155,153,150],"_links":{"self":[{"href":"https:\/\/rostman.eu\/index.php\/wp-json\/wp\/v2\/posts\/2367"}],"collection":[{"href":"https:\/\/rostman.eu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rostman.eu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rostman.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rostman.eu\/index.php\/wp-json\/wp\/v2\/comments?post=2367"}],"version-history":[{"count":19,"href":"https:\/\/rostman.eu\/index.php\/wp-json\/wp\/v2\/posts\/2367\/revisions"}],"predecessor-version":[{"id":2398,"href":"https:\/\/rostman.eu\/index.php\/wp-json\/wp\/v2\/posts\/2367\/revisions\/2398"}],"wp:attachment":[{"href":"https:\/\/rostman.eu\/index.php\/wp-json\/wp\/v2\/media?parent=2367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rostman.eu\/index.php\/wp-json\/wp\/v2\/categories?post=2367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rostman.eu\/index.php\/wp-json\/wp\/v2\/tags?post=2367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}