Dec-16-2022, 07:50 PM
Does it help to arrange response_data like this?
{ 'data': { 'count': 1, 'telemetries': [ { 'date': '2022-12-16 12:03:50', 'totalActivePower': 4118.73, 'dcVoltage': 386.966, 'groundFaultResistance': 11000.0, 'powerLimit': 100.0, 'totalEnergy': 973109.0, 'temperature': 46.1466, 'inverterMode': 'MPPT', 'operationMode': 0, 'vL1ToN': 121.436, 'vL2ToN': 121.364, 'L1Data': { 'acCurrent': 16.9855, 'acVoltage': 242.799, 'acFrequency': 59.9962, 'apparentPower': 4125.01, 'activePower': 4118.73, 'reactivePower': 227.599, 'cosPhi': 1.0} } ] } }'telemetries' and 'count' are keys in the same dictionary. The value for 'count' is 1, and the value for 'telemetries' is a list of dictionaries that must contain telemetry data. This prints date and time from each dictionary of telemetry data.
for telemetry in response_data['data']['telemetries']: print(telemetry['date'], telemetry['temperature'])