File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,6 +87,19 @@ def inverter_summary(self):
8787 result = json .loads (response .text )
8888 return result
8989
90+ def production_telemetry (self ):
91+ '''
92+ Run the enlighten API telemetry/production_micro route (https://developer-v4.enphase.com/docs.html).
93+ This route returns the telemetry for all the production micros of a system.
94+ It will return the default 'day' granularity i.e. start from midnight today in 5 minutes increments
95+ '''
96+ print (self .__log_time () + "Pulling EnlightenAPI inverter summary..." )
97+ url = f'{ self .config ["api_url" ]} api/v4/systems/{ self .config ["system_id" ]} /telemetry/production_micro?key={ self .config ["app_api_key" ]} '
98+ response = requests .get (url , headers = {'Authorization' : 'Bearer ' + self .config ["access_token" ]})
99+ self .__assert_success (response )
100+ result = json .loads (response .text )
101+ return result
102+
90103 def __init__ (self , config ):
91104 '''
92105 Initialize the englightAPI class
You can’t perform that action at this time.
0 commit comments