You could probably use it for a simple web server or maybe turn it into a crappy surveillance camera.
For automation, you could play around with the pogo pins on the back, but I don't know how easy that is. You can also use a Raspberry PI Pico instead. You can program the board in Python or C and communicate with it over USB (you plug it into the phone). I had an idea to use the PinePhone with the Pico, add 2 motors to it and turn it into a remote controlled car (PineCar?), controlled by a gamepad over bluetooth. I think that wouldn't be too difficult, but it requires some programming. Another idea: turn it into a weather station. Add some sensors like temperature, humidity, maybe air quality sensors and then either display the data on screen or share it over HTTP to access it over the network.
You can install aircrack and try hacking your own wifi. Maybe you could somehow make a map of wifi networks in your area. There is a distro called Nethunter Pro, which is a mobile version of Kali Linux (https://youtu.be/i1bDofmvhNw).
You can buy an SDR (Software Defined Radio) USB dongle and after plugging it into the phone you should be able listen to radio signals on the go (https://youtu.be/ffEGdbXt2Qo).
Since gamepads work, you can play some old games like Doom (https://youtu.be/IhBfy8xfoI8) and Quake 1. Maybe some emulation of very old games? DOS games should work (https://youtu.be/x-LvYEKjX78). Apparently it's also possible to stream games from your PC (https://youtu.be/XgQT5gEkK24).
You might be able to run OpenRGB on it, but I'm not sure how that could be useful. So far I've only seen this mod for the keyboard: https://youtu.be/9DGIwjaXMeI.
Maybe use it to periodically fetch and display information like weather or public transport schedule.