ProudElm / packaging_solaredgeoptimizers

MIT License
3 stars 3 forks source link

Get historical panel data #8

Closed gjdv closed 1 year ago

gjdv commented 1 year ago

Implemented the retrieval of historical panel values between starttime and endtime (either datetime.datetime type or unix timestamp in ms, or None for default today)

requestHistoricalData(self, starttime=None, endtime=None, parameter="Power")

You can choose parameter from {"Power", "Current", "Voltage", "Energy", "PowerBox Voltage"}. It returns a dictionary of type Dict[SolarlEdgeOptimizer, Dict[datetime, float]].

This solves issue #6 .

Turns out that your means of authenticating, and administration of cookies works perfectly well also for this GET request. Hence I took the liberty to generalize your request function further to include all request-methods. In my initial attempts I missed that my timestamps were formatted as floats rather than ints, which was not accepted by the SE portal.

ProudElm commented 1 year ago

Thanx!