For the hardware, I use GPIO to control one of 4 relays that ultimately connect the keyfob push buttons - this sends the proper signals to the camper's 12VDC leveling control (I have the 12VDC keyfob receiver mounted inside of the camper's manual control box).
The first iteration uses a RPI 2, a RPI Sense Hat (for the IMU and display of level), a usb wifi dongle and a separate portable WiFi access point to provide the user web interface for controlling the auto-leveling of the camper.
Youtube video: https://www.youtube.com/watch?v=vOFq5evArE0
The second iteration uses a RPI Zero W and a tiny IMU to do all of the above. I turn the RPI Zero W into a WiFi access point providing the user web interface on any connected wireless device web browser.
Youtube video: https://www.youtube.com/watch?v=aCiFrJ4rooo