I can offer:
github.com/wotalota/indi-rolloffino.git as an example from which you can develop your own.
It is a INDI rolloff roof driver and includes two different implementations of Arduino programs communicating over
USB. It presently only works using USB, I have not looked into what it would take especially on the Arduino side to
support Ethernet. The driver is packaged as a third party driver except for the install directions being from the
perspective that it is not already included. I mean to ask Jasem if it can be included as an option.
See readme.txt for a brief overview of the protocol and INSTALL for build directions.
After the build you should be able to see the rolloffino as an option under Dome when you edit the EKos profile.
The driver works with the Observatory module and weather drivers as you would expect. I am presently using it with
the Vantage, WeatherMeta and WeatherProxy for a rain detector.
If you study the included rolloff.ino programs I think it will be straight forward to include the I/O interface into your own.
rolloff.ino.boutons written by forum member Christophe, maintains state and controls relays to stop roof movement
when end of travel is detected. rolloff.ino.ar1450 which I use relies on the stop built into an external motor controller.
Both will signal the fully opened/closed condition back to the driver.
Regards
Tom