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!
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!