As an example of another approach that doesn’t need the intermediate csv file and has a much cleaner “refresh”, I made an adapter plugin that accesses real-time robot data via ROS: https://github.com/locusrobotics/qgis_ros
The ability to extend QGIS because of the C++ and Python APIs is immensely powerful.