Non-metered Envoys return empty responses from /ivp/meters
Hello,
this API seems to be just what I need for my local metering system. However, when setting this up, I did the configuration and was able to connect to the Enphase system. Trying out gateway_console.py I found out that gateway.api_call('/ivp/meters') returns an empy response. This is probably due to my gateway being a non-metered one. The gateway_console.py script was easy to fix by adding next(..., {state: 'enabled'}) structure around the list comprehension on lines180 and 198 but I am wondering if the idea of the API would be return something where this non-meteredeness would be obvious?
Keep up the good work! Best regards, Marko
The /production endpoint will be missing eim types if it's a non-metered envoy and will be returning activecount=0 for eim type if it is a metered type without configured meters. It's a bit of a slow endpoint though. And the [] response (or 401 status for older firmware) for ivp/meters is as good an indication.
{
"production": [{
"type": "inverters",
"activeCount": 15,
"readingTime": 1694549655,
"wNow": 4085,
"whLifetime": 943236
}, {
"type": "eim",
"activeCount": 1,
"measurementType": "production",
"readingTime": 1694549732,
This one uses the /production page and the eim type to determine if it's metered and if not fallback to using the /api/v1/production endpoint (and /api/v1/production/inverters for the individual inverters)