Closed everydaylearner closed 2 weeks ago
Not sure what your use case is but I just ended up switching to the Python unofficial API since all I really want was the usage and solar production over each day.
here is what my resulting python code. I have it run every minute and write to a database. Full code
from sense_energy import Senseable
from dotenv import load_dotenv
import os
load_dotenv()
sense = Senseable()
sense.authenticate("secret@gmail.com", os.environ.get("PASSWORD"))
sense.update_realtime()
print ("usage", int(sense.active_power), "W")
print ("solar", int(sense.active_solar_power), "W")
ohh i see!!! it looks like you are writing to Mongo db not influx. do you have any samples to write to influxdb2 by any chance? :)
I unfortunately don't because I've never worked with influx.
Part of the reason I moved to the unofficial API. Because it was db agnostic
Chatgpt would probably be happy to write that for you lol
Chat.openai.com
Sleep error was an annoying side effect of the old code. Sorry about that mess!! The new version is rewritten! Hope you can try it out!
Anyone getting the following error:
sleep: invalid option -- '1'
Constantly keeps showing up in the logs!
Thank you!