HomeServer/plot_meross.py
2023-09-19 10:52:12 +02:00

21 lines
338 B
Python

import sqlite3
import matplotlib.pyplot as plt
import numpy as np
con = sqlite3.connect("data.db")
cur = con.cursor()
res = cur.execute("SELECT time, watts FROM data")
x_values = []
y_values = []
for time, watts in res:
x_values.append(time)
y_values.append(watts)
plt.plot(x_values, y_values)
plt.ylim([0, 200])
plt.show()