Hi.
If i understand correctly, you made a prefab of the switch to turn on/off the light.
if so :
When you create a prefab, the connection to the Light Game objects will be lost (unless they would also be in the prefab)
Prefabs can not communicate directly with Scene objects (this is a unity limitation)
in your case you do not need to create these object at runtime, so i would do something like this :
have one (empty) game object and call it for example 'Bathroom Light Handler'
have a fsm on it (Call it 'Light Switch' for example)
Make the same setup as on the image you send. except the mouse button down. (remove the action)
Also instead of On/Off Transition use a single transition name for both states (call it 'Flip Switch' for example.
Now on the 'Cube Switch' you will do the mouse event, but i beliebe the Action 'Get Mouse Button Down' will always trigger, even when not targeting the light switch.
So instead you can use 'Mouse Pick Event' and use the mouse down event to transition to the next state.
in the next state you can use 'Send Event By Name' and target the "Bathroom Light Handler" with the 'Flip Switch' transition.
From the 'Cube Switch' you can make a prefab.
But on the 'Send Event By Name' you will lose the target, so when you drag in a new prefab you will need to place the target in it.
The good thing is, you can use the same prefab for different rooms as well.
just make for example a "Living room Light Handler" and target that with the 'Cube Switch'
Here are some videos that can help :