i am trying to get data out of my database “PV_data”, measurement “mqtt_consumer” for further processing, but only data with a certain topic, e.g “only_this_topic” …
my code:
from influxdb import InfluxDBClient
dbClient = InfluxDBClient(database=‘PV_data’)
E_today = dbClient.query(‘select last(ENERGY_Today) from ‘mqtt_consumer’, topic=‘only_this_topic’ WHERE time < now()’)
what is the correct syntax for such a query?
MANY THANKS