I have completed this project where I have 2 separately wired lights in a basement stairway that need coordinated control (PIR Coordination of 2 Separate Units). I want top PIR sensor to turn on both the top and bottom lights, and I want the bottom PIR sensor to do the same. Since the Sonoff Slamphers are keyed to one code each, this poses an interesting problem. I do need a PIR on the top and on the bottom because the stair twists around a corner and it is blind from either side. The lights were never switched together. I decided to approach this in the following way.
Tasmota Code:
Backlog SSID1 YourSSID; Password1 YourWIFIPassword; MqttHost YourMQTTHostIP; MqttUser YourMQTTUserLogin; MqttPassword YourMQTTUserPassword; SysLog 2; WebLog 2; SerialLog 0; sleep 100; FullTopic %topic%/%prefix%/; SwitchMode 13
Backlog Topic bhall_socketU; FriendlyName1 bmt_hall_rf_socket; FriendlyName2 bmt_hall_socket; Hostname bmt_hall_rf_socket; MqttClient bmt_hall_rf_socket; PowerRetain 1; PulseTime1 5; PulseTime2 300
Backlog Rule1 on POWER1#state=1 do POWER2 ON endon on POWER2#state=1 do WebSend [192.168.57.103] POWER2 ON endon; Rule1 on
Template:
{"NAME":"SlampherSpltRF","GPIO":[17,255,0,255,0,0,0,0,22,56,0,0,21],"FLAG":0,"BASE":9}
Sample Control Panel Output:
00:06:50 MQT: bhall_socketU/stat/RESULT = {"POWER1":"ON"}
00:06:50 MQT: bhall_socketU/stat/POWER1 = ON (retained)
00:06:50 RUL: POWER1#STATE=1 performs "power2 on"
00:06:50 MQT: bhall_socketU/stat/RESULT = {"POWER2":"ON"}
00:06:50 MQT: bhall_socketU/stat/POWER2 = ON (retained)
00:06:50 RUL: POWER1#STATE=1 performs "WebSend [192.168.57.103] POWER2 ON"
00:06:51 MQT: bhall_socketU/stat/RESULT = {"WebSend":"Done"}
00:06:51 MQT: bhall_socketU/stat/RESULT = {"POWER1":"OFF"}
00:06:51 MQT: bhall_socketU/stat/POWER1 = OFF (retained)
00:10:10 MQT: bhall_socketU/stat/RESULT = {"POWER2":"OFF"}
00:10:10 MQT: bhall_socketU/stat/POWER2 = OFF (retained)
The rules go as follows. The PIR triggers POWER1 relay thru a 433mhz signal. When POWER1 comes on the rule turns on POWER2. Then a couple seconds later POWER1 goes off due to the PulseTime1 5
command. When POWER2 comes on, the next rule sends the WebSend
command to the other light to turn on POWER2 there. After 3 minures POWER2 turns off from the PulseTime2 300
command.
Both units are set-up in a similar way, with the WebSend
command IP address referring to the other device.
In case it is not clear, without rules like this the PIR will toggle the light on and off multiple times as it senses a person, making the light flip on and off as you walk by or leaving it on when you are not there and off when you walk by. The rule and the template basically allow the 433mhz signal from the PIR toggle the light when the light is off as you would expect it to operate.
Thanks for reading.
If you have any suggestions please don’t hesitate to share them with the group.
Contact Links:
What are we Fixing Today Homepage / Website:
https://www.WhatAreWeFixing.Today/
Channel Link URL: (WhatAreWeFixingToday)
https://bit.ly/WhatAreWeFixingTodaysYT
What are we Fixing Today Facebook page (Sir GoodEnough):
https://bit.ly/WhatAreWeFixingTodaybFB
What are we Fixing Today Twitter Account (Sir GoodEnough):
https://bit.ly/WhatAreWeFixingTodayTW
Discord Account: (Sir_Goodenough#9683)
https://discord.gg/Uhmhu3B
Please help support the channel:
Patreon: https://www.patreon.com/WhatAreWeFixingToday
Buy me Coffee: https://www.buymeacoffee.com/SirGoodenough
PayPal one-off donation link: https://www.paypal.me/SirGoodenough
Cash App $CASHTAG: https://cash.me/$SirGoodenough
Venmo cash link: https://venmo.com/SirGoodenough
If you would like to donate anything to this channel, please use this address:
C/O: Sirius GoodEnough
322 Buena Vista Ave.
Department: DYT
Waukesha, Wisconsin, 53188-3602