So here is the layout of how it works:
Physical Device -> Smart Switch -> hub 1 -> Cloud Interface SmartApp exposes control of switch via url to anyone with that security token.
Virtual Switch -> hub 2 -> exposed to Alexa which can only be connected to one hub (location) in this case hub 2.
Final part is to use Alexa Helper SmartApp in hub 2 to create a Virtual Switch whose sole purpose is to make the URL call (the call to hub 1’s Cloud Interface SmartApp) and when turned off to make a separate URL call (almost same but with off rather than on). That switch you expose to the Alexa SmartApp so you can use voice control so the flow of data is as follows:
User makes voice request to Alexa to turn on virtual switch -> Alexa SmartApp makes call to hub 2 to turn on virtual switch -> hub 2 Virtual Switch turns on which evokes a url call to hub 1 Cloud Interface SmartApp -> hub 1 Cloud Inteface SmartApp processes request and tells hub 1 to turn on the hub 1 SmartSwitch -> Lights come on…
That works pretty well so long as you always use hub 2’s virtual switch (either via app or alexa) to control hub 1’s physical switch. If you ever use hub 1’s switch either manually by pressing it or via hub 1 app then you probably need to setup Cloud Interface going back to virtual to keep them in synch.
Let’s say the light is on and both hub 1’s physical and hub 2’s virtual show on. If you physical press the toggle off. it will turn off light, turn off hub 1 physical. Hub 1 physical will evoke rule to make url call to hub 2 Cloud Interface. hub 2 cloud interface will turn off hub 2 virtual. hub 2 virtual will make url call to hub 1 Cloud Interface to turn off hub 1 physical. hub 1 physical switch is already off so nothing will be done but both switches will again be in synch (both off)…That’s the advantage of using on/off rather than toggle.
Hope that helps let us know if get stuck.