import time import random from influxdb_client import InfluxDBClient client = InfluxDBClient(url="http://localhost:8086", token="influxdbTSGAMES", org="raspberry") writer = client.write_api() while True: writer.write("influxdb","raspberry", ["solar,type=A value=" + str(random.randrange(10))]) writer.write("influxdb","raspberry", ["solar,type=V value=12"]) time.sleep(1)