Using game inputs to effect real world events

I have a tough question that should be a real head scratcher.

I was wondering if it is possible to have a light in the real world turn off when a light in the game gets turned off in unreal engine. I there anyway way I might be able to do this? Can unreal engine communicate outside of the game… I figure if unreal engine can respond to a mouse input, or make a game controller vibrate, then unreal engine can make a usb Light turn on or off depending on a given input.

Any help in doing this would be much appreciated, I don’t know much about scripting but if I need to do some script or make a blueprint to make this work I’m willing to give it a go. thanks.

You can use network to communicate datas between multiple applications. UE4 has an abstraction for the network (FSocket).
I never tried but I think you can integrate third party libraries (like OpenCV) to make the communication between your hardware and UE.

Edit : However, you will have to do that in C++.

Thanks for the reply, Ill give it a look soon.

Yes, but I think that any communication other than mouse, keyboard, UDP, and TCP/IP you will have to add to the Engine via plugins or C++