Enphase: Add "devices_reporting" as item

Hi there! I noticed that sometimes when I’m querying the current power using the Enphase binding, the power is obviously lower than it should be. I did some research and found that sometimes the power reported may not include the latest power produced by all of the modules, if some of the modules (microinverters) have not yet updated their latest value. For for instance, if there are 20 modules in the system, and each is producing 100W, the system power should be 2000W. But, if only 15 of the modules have reported their latest power, the number will be 1500W.

I’d like to have an item that gives the number of modules reporting, which appears to be available from the “stats” API call:

GET https://api.enphaseenergy.com/api/v2/systems/[system_id]/stats

Sample response
{
“system_id”:1765,
“total_devices”:31,
“meta”: {“status”: “normal”, “last_report_at”: 1445619615, “last_energy_at”: 1445619033, “operational_at”: 1357023600},
“intervals”:[
{“end_at”:1381496400, “powr”:173, “enwh”:14, “devices_reporting”:27},
{“end_at”:1381496700, “powr”:258, “enwh”:22, “devices_reporting”:31},
{“end_at”:1381497000, “powr”:308, “enwh”:26, “devices_reporting”:31},
{“end_at”:1381497300, “powr”:386, “enwh”:32, “devices_reporting”:31},
{“end_at”:1381497600, “powr”:476, “enwh”:40, “devices_reporting”:31}
]
}

I looked at the github code for the Enphase binding and it’s a bit over my head to try to modify it myself. Any chance someone could add this as a possible item?

If we have this info, we might even be able to estimate the current power production by doing some simple math:

“power_estimate” = (current_power)*(devices)/(devices_reporting)

I’m trying to use the current power value to estimate outside light level to trigger house lights. Presently, when the current_power value is low due to all devices not reporting, I’m getting lights turning on too early. I think my suggestion for adding the “devices_reporting” item could solve this for me (and hopefully someone else!!)

Thanks in advance!!

-Todd