It is definitely possible to use webCoRE to talk (and listen to) multiple hubs…
… BUT…
it will make even a simple piston quite complex, and make a single ‘light on’ command actually send out multiple web requests as well. (which will double if you want to verify the status of the Simulated Switch)
So, while all of this is possible, I highly recommend steering away from this idea. You will drive yourself bat-crazy, and you would miss out on the true power of webCoRE.
(and even if you went thru the process, there is nothing stopping ChildA from giving a command to ChildB’s Alexa… If there is a will, there is a way)
Perhaps the easiest solution (if they were my kids), is to simply take away their Alexa for awhile if they cannot play nice and abide by your house rules.
That being said, here is one basic example of one hub talking to another. Double the code if you are syncing a SimSwitch. Triple it if you send a reply back to verify the device’s status.
(and triple it again since you are considering 3 hubs)
Notice each light or command has to be programmed on each & every hub.
Here is another example more geared towards your goal. The following example assumes that:
- HallLight is connected to Hub-A
- SimSwitchB is connected to Hub-B
- SimSwitchC is connected to Hub-C
HUB-A
If HallLight changes to on
Then
Send GET request to HubB with arguments 'onReal'
Send GET request to HubC with arguments 'onReal'
End If
If HallLight changes to off
Then
Send GET request to HubB with arguments 'offReal'
Send GET request to HubC with arguments 'offReal'
End If
If incoming web request has the argument 'onSim'
Then
Turn on HallLight
End If
If incoming web request has the argument 'offSim'
Then
Turn off HallLight
End If
HUB-B
If incoming web request has the argument 'onReal'
Then
Turn on SimSwitchB
End If
If incoming web request has the argument 'offReal'
Then
Turn off SimSwitchB
End If
If SimSwitchB changes to on
Then
Send GET request to HubA with arguments 'onSim'
End If
If SimSwitchB changes to off
Then
Send GET request to HubA with arguments 'offSim'
End If
HUB-C
If incoming web request has the argument 'onReal'
Then
Turn on SimSwitchC
End If
If incoming web request has the argument 'offReal'
Then
Turn off SimSwitchC
End If
If SimSwitchC changes to on
Then
Send GET request to HubA with arguments 'onSim'
End If
If SimSwitchC changes to off
Then
Send GET request to HubA with arguments 'offSim'
End If
It is important to note that there will be about 1-2 seconds delay from the moment a SimSwitch is toggled, until the command is read and acted upon back in Hub-A.
So that is at least 16 groups of logic in 3 different pistons for the most basic command possible.
(which means if someone flips the HallLight 5 times quickly, you can basically create a mini-DoS attack on your home network)
Seriously, don’t do this. You can thank me later
The only reason I took the time to create this example is to show you how much grey hair you’ll aquire if you go down this path…