Automating IoT device tests

I have an iot device (based on a raspberry pi) running a Python software that reads sensors and writes to PLCs.
The read data is sent to the cloud via MQTT, and data for writing into the PLC is received from the cloud in the same way.
The data uploaded is then processed, saved, and displayed on a dashboard.

I currently do qa manually to the device part - a 200+ rows checklist that checks everything from different sensor protocols, to connectivity issues recovery etc.

I want to automate these tests as they are very cumbersome, but I’m wondering what would be the best way to do that…
So for example, in the dashboard i have an indicator that says if the iot device is online and it’s able to sample a sensor - would a good automation test be a script that start up the device and then crawls the ui and finds that connectivity indicator? Or maybe i just need to test the iot device side itself?
Maybe add code in my production code that checks some “test switch” and routes the output from the MQTT to a local output that i can test?

Any insights would be very appreciated. Thanks