HomeServer/plot_meross.py

21 lines
338 B
Python
Raw Normal View History

2023-09-19 08:52:12 +00:00
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()