Sonoff Slampher and PIR Coordination of 2 Separate Units

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

I retired from a large mid-western medical equipment manufacturer on December 31 (2019) and decided to try to let everyone in on my life and my transition into retirement. I have a varied set of interests. I live in a 90 year old cape cod in the middle of a small city of 70,000 people. I have a small lot across the street from the city seat of government, but despite that I have a 1952 Allis Chalmers farm tractor that I drive around the city from time to time. My wife has a business that has me fixing and creating cool home decor out of broken windows and drywall screws. I have been known to buy things on 'for sale' lists, fix it up, clean it up, generally add value and sell it off. Oh, yes, I'm getting chickens! But first I have to build the chicken coop and run. It will be like no other you have ever seen. Also will give me something to do. I am into home automation, have a Home Assistant enabled home and so will the chickens! I'll have to give them a password...
Social Media Auto Publish Powered By : XYZScripts.com