I am trying to figure out how to make a laser fence, that I’m both able to switch to on/off and also trigger a switch if something breaks the laserbeam.
I think what you are looking for is a “dry” relay - in that you are not expecting voltage on the NO or NC contact, but want to know when there’s continuity, you’ll need some sort of ground as well which will probably need to be common between the Sonoff’s
Can you take a picture of the Sonoff units you are using with the associated pins available?
I have almost the same concept already running for a security beam for my windows.
I use a nodemcu as the comm device and controller. It is connected to the output of a effector 01d100 laser. The laser and nodemcu are powered by a standard 24v wall wart power supply that needs to be reduced to 3.3v for the nodemcu using a buck voltage regulator.
The laser is pretty expensive but it was the only thing i could find that had what I needed at the time. If you have a source for a different laser system that’s cheaper and can still supply the correct outputs that would be good info to have.
If you only want to detect smallish spans say your driveway or the opening to your Garage I would look into using a TOF (Time of Flight) Sensor. You can get ones such as the VL53L1X which can cover a span up to 4M. So would be idle for most single drives.
They are only about £13 to buy and you don’t need a receiver at the other end which simplifies the install. Would be ideal with an ESP board.