Turning on light with switch in a different room

I have lights in one room and the switch for them in another room. I want the lights to be a light source, but I only want them to be switchable using the switch in another location.

I can think of a way of doing this but involves a lot of smoke and mirrors, is there an elegant solution?

Can you say a little more about the difficulty you’re running into? I don’t really see how being in a different location makes this more complicated to code, so I’m worried I might be missing something. In case it’s helpful, I think this tiny example does what you want, but again, apologies if I’m misunderstanding things!



The problem is that because the lightbulb is a light source you can turn it on when you are in the room with the lightbulb - I only want to be able to turn it on using the switch in the other room.

OK, that makes more sense! Without looking at your code, sounds like you’ve made the lightbulb or whatever a switchable device, but you don’t need to do that if you want it to be exclusively controlled by the switch in the other room – if you try out the code I pasted in above, you shouldn’t be able to manually toggle the bulb. Hopefully that works out, if not feel free to post your actual code and I (and I’m sure other, smarter folks) would be glad to take a look!