You can write a small Python program that reads the most recent value of CO2 from the DB (use function "getMeasurements" at line 125 as a reference.) https://github.com/FirstCypress/LiV/blob/S_development/software/liv/livXMPP/livXMPP.py If the value exceeds your defined threshold limit, you can use the function "GPIO.output" to write GPIO.HIGH to the GPIO pin you are using. When the value goes under the limit, you will write GPIO.LOW to the GPIO pin. The RPI.GPIO python library is already installed on LIV, so you only need to import it into your code. https://learn.sparkfun.com/tutorials/raspberry-gpio/python-rpigpio-example Your Python program will run in a forever loop, with some time sleep period (a couple of minutes or more will be OK.)
Once your Python program works, you can add its name to the process starting script, so your program will automatically start running when LiV is powered.