I’m looking at modifying the code for the enphase_envoy sensor to include gathering data for each of the microinverters. As each installation is different, homes might have 10 or 20 or more microinverters.
What are the best practices in home assistant in handling this? Do I create multiple sensors, i.e. Inverter1, Inverter2, Inverter3, etc… then have the attributes under each object? Or do I just have one object such as Inverter and put all the attributes under this one?
As well the enphase_envoy sensor is using an external library https://github.com/jesserizzo/envoy_reader which I requesting them to include this gathering of data from the microinverters.
Currently, the data returned from the enphase envoy device is:
[{'serialNumber': '000000000000', 'lastReportDate': 1554513164, 'lastReportWatts': 22, 'maxReportWatts': 234}, {'serialNumber': '000000000001', 'lastReportDate': 1554513167, 'lastReportWatts': 22, 'maxReportWatts': 237}, {'serialNumber': '000000000002', 'lastReportDate': 1554513172, 'lastReportWatts': 19, 'maxReportWatts': 221}, {'serialNumber': '000000000003', 'lastReportDate': 1554513161, 'lastReportWatts': 22, 'maxReportWatts': 240}, {'serialNumber': '000000000004', 'lastReportDate': 1554513169, 'lastReportWatts': 19, 'maxReportWatts': 220}, {'serialNumber': '000000000005', 'lastReportDate': 1554513172, 'lastReportWatts': 19, 'maxReportWatts': 222}, {'serialNumber': '000000000006', 'lastReportDate': 1554513162, 'lastReportWatts': 24, 'maxReportWatts': 249}, {'serialNumber': '000000000007', 'lastReportDate': 1554513169, 'lastReportWatts': 19, 'maxReportWatts': 219}, {'serialNumber': '000000000008', 'lastReportDate': 1554513159, 'lastReportWatts': 24, 'maxReportWatts': 250}, {'serialNumber': '000000000009', 'lastReportDate': 1554513164, 'lastReportWatts': 24, 'maxReportWatts': 248}, {'serialNumber': '000000000010', 'lastReportDate': 1554513166, 'lastReportWatts': 19, 'maxReportWatts': 220}, {'serialNumber': '000000000011', 'lastReportDate': 1554513171, 'lastReportWatts': 19, 'maxReportWatts': 220}, {'serialNumber': '000000000012', 'lastReportDate': 1554513160, 'lastReportWatts': 20, 'maxReportWatts': 232}, {'serialNumber': '000000000013', 'lastReportDate': 1554513164, 'lastReportWatts': 24, 'maxReportWatts': 250}]
A pointer to how another sensor handled this in home assistant might help me out as well.
Thank you
Greg