Get thermostat setpoints into the "sensor data" list

I’m running a script on my PC that pulls the tables made by event watcher every five minutes, and stores to an ascii file on a server. One thing i would like to have is the current active setpoint on virtual thermostats (to put in the temperature graphs as reference), how is this done?

Today all thermostats com e in with the same value as the controlling temp sensor, which for me is not as useful…