I have made cheap, reliable devices that serve the purpose. If it doesn't have to be overly accurate and you can use discrete inputs, try this:
You need:
Four pieces of 1/2" x 6" schedule 80 PVC pipe
Two pieces of 1/2" x 1" schedule 80 PVC pipe
Two schedule 80 PVC Tees
Six Schedule 80 PVC caps
Six barrel-style prox switches that will detect the ball bearings -
1. Bore holes through the center of each cap to accept the prox switches
2. Mount four prox switches so they protrude into the inside of the PVC caps
3. Using a PVC Tee, join the two 6" pieces of pipe. make sure the pieces of pipe are cut square and inserted fully into the socket. Try to keep the bore as smooth as possible.
4. Close the ends of the pipes with the caps you prepared in step 2
5. Glue the 1" long pieces into the side run of the tee
6. Drop ball bearing into the tee and make sure it can roll from end to end
7. With the ball bearing in the tee, measure from the top of the ball bearing to the top of the short pipe
8. Set up the remaining two prox switches so there is a couple mm clearance between the end of the switch and the ball bearing
9. Glue the caps in place
Once completed, mount the two assemblies perpendicular to each other on your trailer when it's in the LEVEL position. The top prox switches should detect the ball bearing, which should be in the middle of the tee. I have dimpled the bottom of the tee with a suitable drill bit to keep the ball bearing in position. I have also filled the entire assembly with mineral oil to dampen the ball movement - just be sure to seal the prox switch openings appropriately.
For levelling, tie all six switches to a PLC. Four PLC outputs control electric jacks at each corner of the trailer. If the switch that detects the ball on the right side of the trailer is made, extend both jack on the right until the center prox switch detects the ball. If the switch that detects the front of the trailer being low is made, move extend both forward jacks until the center prox switch is made.
Sketch attached.