mpepping / solarman-mqtt

Send Solarman Smart PV inverter metrics to MQTT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: Process Sleep time

Jabroni opened this issue · comments

Was wondering maybe it would be a good idea to have in the config a way to set up work times for the script/requests, so whenever its night time it doesnt hammer solarman webservers with hits when we know our inverters are offline.

That would reduce the number of daily requests by at least 30% (and reduce the chances that maybe someday they see this as hammering their API and remove us access to it)

Definitely a good idea. The Solarman API also offers a method to renew tokens, instead of requesting a new token on every run. This should also be more friendly to the API. Your suggestion is interesting as well. Not sure how to implement that yet, but it's on the list :)

I really like this suggestion, but instead of defining hard "work times", the sunrise and sunset times could be used. Calculate them every day and go to sleep for example 30 minutes after sunset and awake 30 minutes before sunrise.
I'm doing something like that on an ESP8266 which is battery operated and measures outdoor illuminance.
There should be libraries out there which can do the calculation in python and the only thing you need for that is accurate time, latitude and longitude and an offset variable you want to wake before sunrise and go to sleep after sunset.