UNPKG

homebridge-enphase-envoy

Version:

Homebridge plugin for Photovoltaic Energy System manufactured by Enphase.

1,418 lines (1,417 loc) 187 kB
{ "pluginAlias": "enphaseEnvoy", "pluginType": "platform", "singular": true, "fixArrays": true, "strictValidation": true, "headerDisplay": "This plugin works with Enphase Photovoltaic system. Devices exposed to the HomeKit needs to be added manually.", "footerDisplay": "For documentation, please see [GitHub repository](https://github.com/grzegorz914/homebridge-enphase-envoy).", "schema": { "type": "object", "properties": { "name": { "title": "Platform", "type": "string", "default": "Enphase Envoy" }, "devices": { "title": "Devices", "type": "array", "items": { "type": "object", "properties": { "name": { "title": "Accessory name", "type": "string", "placeholder": "Accessory name", "description": "Accessory name to be displayed in Home app" }, "host": { "title": "IP/Hostname", "type": "string", "placeholder": "192.168.1.10 or pv.local", "pattern": "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)(\\.([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?))*)$", "description": "IP Address or hostname of the Enphase Envoy gateway (defaults to envoy.local). For firmware v7+, please set the IP address." }, "displayType": { "title": "Accessory type", "type": "integer", "minimum": 0, "maximum": 4, "default": 1, "description": "Accessory type for Home app", "anyOf": [ { "title": "Disabled", "enum": [ 0 ] }, { "title": "Light Bulb", "enum": [ 1 ] }, { "title": "Fan", "enum": [ 2 ] }, { "title": "Humidity Sensor", "enum": [ 3 ] }, { "title": "Carbon Monoxide Sensor", "enum": [ 4 ] } ] }, "envoyFirmware7xxTokenGenerationMode": { "title": "Envoy Credentials Mode", "type": "integer", "minimum": 0, "maximum": 2, "default": 0, "description": "Method used login to Envoy api", "anyOf": [ { "title": "Envoy password", "enum": [ 0 ] }, { "title": "Enlighten credentials", "enum": [ 1 ] }, { "title": "Self-generated token", "enum": [ 2 ] } ] }, "envoyPasswd": { "title": "Envoy password", "type": "string", "placeholder": "Envoy password", "description": "Envoy password (only if you altered the default password)", "format": "password", "condition": { "functionBody": "return model.devices[arrayIndices].envoyFirmware7xxTokenGenerationMode === 0;" } }, "enlightenUser": { "title": "Enlighten username/email address", "type": "string", "placeholder": "user@example.com", "description": "Enphase Enlighten username.", "condition": { "functionBody": "return model.devices[arrayIndices].envoyFirmware7xxTokenGenerationMode === 1;" } }, "enlightenPasswd": { "title": "Enlighten password", "type": "string", "placeholder": "password", "description": "Enlighten password", "format": "password", "condition": { "functionBody": "return model.devices[arrayIndices].envoyFirmware7xxTokenGenerationMode === 1;" } }, "envoyToken": { "title": "Envoy token", "type": "string", "placeholder": "Token", "description": "Provide self-generated token (if relevant)", "format": "password", "condition": { "functionBody": "return model.devices[arrayIndices].envoyFirmware7xxTokenGenerationMode === 2;" } }, "envoyTokenInstaller": { "title": "Installer", "type": "boolean", "description": "Enable for installer-provided token", "condition": { "functionBody": "return model.devices[arrayIndices].envoyFirmware7xxTokenGenerationMode === 2;" } }, "energyMeter": { "title": "Energy Meter", "type": "boolean", "description": "Enables energy meter as a axtra accessory to display charts in EVE app" }, "energyHistoryTime": { "title": "Energy History Save Time", "type": "integer", "default": 0, "description": "Here set the time (in years) for which the energy history data should be saved. Setting this to 0 will save all data without deleting old records (not recommended)" }, "energyHistoryReserveSpace": { "title": "Energy History Reserve Space", "type": "integer", "default": 1, "description": "Here set the reserve space (in GB) after which the plugin will start deleting old records to prevent storage from being full. Setting this to 0 will disable this functionality (not recommended)" }, "lockControl": { "title": "Lock Control", "type": "object", "properties": { "enable": { "title": "Enable", "type": "boolean", "description": "Enables system control auto lock accessory" }, "time": { "title": "Auto Lock Time", "type": "number", "minimum": 1, "maximum": 60, "multipleOf": 1, "description": "System control auto lock time (seconds)", "condition": { "functionBody": "return model.devices[arrayIndices].lockControl.enable === true" } }, "namePrefix": { "title": "Prefix", "type": "boolean", "description": "Use accessory name as a prefix", "condition": { "functionBody": "return model.devices[arrayIndices].lockControl.enable === true" } } }, "allOf": [ { "if": { "required": [ "enable" ], "properties": { "enable": { "const": true } } }, "then": { "required": [ "time" ] } } ] }, "productionStateSensor": { "title": "Production State Sensor", "type": "object", "properties": { "displayType": { "title": "Accessory type", "type": "integer", "minimum": 0, "maximum": 3, "description": "Accessory type for Home app", "anyOf": [ { "title": "Disabled", "enum": [ 0 ] }, { "title": "Motion Sensor", "enum": [ 1 ] }, { "title": "Occupancy Sensor", "enum": [ 2 ] }, { "title": "Contact Sensor", "enum": [ 3 ] } ] }, "name": { "title": "Accessory name", "type": "string", "placeholder": "Sensor name", "description": "Name for the sensor accessory in the Home app", "condition": { "functionBody": "return model.devices[arrayIndices].productionStateSensor.displayType > 0;" } }, "namePrefix": { "title": "Prefix", "type": "boolean", "description": "Use the accessory name as a prefix", "condition": { "functionBody": "return model.devices[arrayIndices].productionStateSensor.displayType > 0;" } } } }, "plcLevelControl": { "title": "PLC Level Refresh Control", "type": "object", "properties": { "displayType": { "title": "Accessory type", "type": "integer", "minimum": 0, "maximum": 3, "anyOf": [ { "title": "Disabled", "enum": [ 0 ] }, { "title": "Switch", "enum": [ 1 ] }, { "title": "Outlet", "enum": [ 2 ] }, { "title": "Lightbulb", "enum": [ 3 ] } ], "description": "Accessory type for Home app" }, "name": { "title": "Accessory name", "type": "string", "placeholder": "Accessory name", "description": "Accessory name for Home app", "condition": { "functionBody": "return model.devices[arrayIndices].plcLevelControl.displayType > 0;" } }, "namePrefix": { "title": "Prefix", "type": "boolean", "description": "Use accessory name as a prefix", "condition": { "functionBody": "return model.devices[arrayIndices].plcLevelControl.displayType > 0;" } } } }, "powerProductionSummary": { "title": "Power Summary", "type": "integer", "description": "Using the Enphase app, provide the total (W) of all microinverters (used to calculate percentage)" }, "powerProductionLevelSensors": { "title": "Sensors", "type": "array", "items": { "type": "object", "properties": { "displayType": { "title": "Accessory type", "type": "integer", "minimum": 0, "maximum": 3, "description": "Accessory type for Home app", "anyOf": [ { "title": "Disabled", "enum": [ 0 ] }, { "title": "Motion Sensor", "enum": [ 1 ] }, { "title": "Occupancy Sensor", "enum": [ 2 ] }, { "title": "Contact Sensor", "enum": [ 3 ] } ] }, "name": { "title": "Accessory name", "type": "string", "placeholder": "Sensor name", "description": "Name for the sensor accessory in the Home app" }, "compareMode": { "title": "Comparison mode", "type": "integer", "minimum": 0, "maximum": 5, "description": "Comparison mode", "anyOf": [ { "title": ">", "enum": [ 0 ] }, { "title": ">=", "enum": [ 1 ] }, { "title": "==", "enum": [ 2 ] }, { "title": "<", "enum": [ 3 ] }, { "title": "<=", "enum": [ 4 ] }, { "title": "!=", "enum": [ 5 ] } ], "condition": { "functionBody": "return model.devices[arrayIndices[0]].powerProductionLevelSensors[arrayIndices[1]].displayType > 0;" } }, "powerLevel": { "title": "Power Level", "type": "integer", "minimum": 0, "description": "Power level in (W) for comparison to sensor that was triggered", "condition": { "functionBody": "return model.devices[arrayIndices[0]].powerProductionLevelSensors[arrayIndices[1]].displayType > 0;" } }, "namePrefix": { "title": "Prefix", "type": "boolean", "description": "Use the accessory name as a prefix", "condition": { "functionBody": "return model.devices[arrayIndices[0]].powerProductionLevelSensors[arrayIndices[1]].displayType > 0;" } } }, "allOf": [ { "if": { "required": [ "displayType" ], "properties": { "displayType": { "enum": [ 1, 2, 3 ] } } }, "then": { "required": [ "compareMode", "powerLevel" ] } } ] } }, "energyProductionLevelSensors": { "title": "Sensors", "type": "array", "items": { "type": "object", "properties": { "displayType": { "title": "Accessory type", "type": "integer", "minimum": 0, "maximum": 3, "description": "Accessory type for Home app", "anyOf": [ { "title": "Disabled", "enum": [ 0 ] }, { "title": "Motion Sensor", "enum": [ 1 ] }, { "title": "Occupancy Sensor", "enum": [ 2 ] }, { "title": "Contact Sensor", "enum": [ 3 ] } ] }, "name": { "title": "Accessory name", "type": "string", "placeholder": "Sensor name", "description": "Name for the sensor accessory in the Home app" }, "compareMode": { "title": "Comparison mode", "type": "integer", "minimum": 0, "maximum": 5, "description": "Comparison mode", "anyOf": [ { "title": ">", "enum": [ 0 ] }, { "title": ">=", "enum": [ 1 ] }, { "title": "==", "enum": [ 2 ] }, { "title": "<", "enum": [ 3 ] }, { "title": "<=", "enum": [ 4 ] }, { "title": "!=", "enum": [ 5 ] } ], "condition": { "functionBody": "return model.devices[arrayIndices[0]].energyProductionLevelSensors[arrayIndices[1]].displayType > 0;" } }, "energyLevel": { "title": "Enargy Level", "type": "integer", "minimum": 0, "description": "Energy level in (Wh) to compare to sensor that was triggered", "condition": { "functionBody": "return model.devices[arrayIndices[0]].energyProductionLevelSensors[arrayIndices[1]].displayType > 0;" } }, "namePrefix": { "title": "Prefix", "type": "boolean", "description": "Use the accessory name as a prefix", "condition": { "functionBody": "return model.devices[arrayIndices[0]].energyProductionLevelSensors[arrayIndices[1]].displayType > 0;" } } }, "allOf": [ { "if": { "required": [ "displayType" ], "properties": { "displayType": { "enum": [ 1, 2, 3 ] } } }, "then": { "required": [ "compareMode", "energyLevel" ] } } ] } }, "energyProductionLifetimeOffset": { "title": "Energy Lifetime Offset", "type": "integer", "description": "Here set offset in (Wh) for energy production (if needed)" }, "gridProductionQualitySensors": { "title": "Sensors", "type": "array", "items": { "type": "object", "properties": { "displayType": { "title": "Accessory type", "type": "integer", "minimum": 0, "maximum": 3, "description": "Accessory type for Home app", "anyOf": [ { "title": "Disabled", "enum": [ 0 ] }, { "title": "Motion Sensor", "enum": [ 1 ] }, { "title": "Occupancy Sensor", "enum": [ 2 ] }, { "title": "Contact Sensor", "enum": [ 3 ] } ] }, "name": { "title": "Accessory name", "type": "string", "placeholder": "Sensor name", "description": "Name for the sensor accessory in the Home app" }, "compareType": { "title": "Comparison type", "type": "integer", "minimum": 0, "maximum": 3, "description": "Comparison type", "anyOf": [ { "title": "Current (A)", "enum": [ 0 ] }, { "title": "Voltage (V)", "enum": [ 1 ] }, { "title": "Frequency (Hz)", "enum": [ 2 ] }, { "title": "Power Factor (cos φ)", "enum": [ 3 ] } ], "condition": { "functionBody": "return model.devices[arrayIndices[0]].gridProductionQualitySensors[arrayIndices[1]].displayType > 0;" } }, "compareMode": { "title": "Comparison mode", "type": "integer", "minimum": 0, "maximum": 5, "description": "Comparison mode", "anyOf": [ { "title": ">", "enum": [ 0 ] }, { "title": ">=", "enum": [ 1 ] }, { "title": "==", "enum": [ 2 ] }, { "title": "<", "enum": [ 3 ] }, { "title": "<=", "enum": [ 4 ] }, { "title": "!=", "enum": [ 5 ] } ], "condition": { "functionBody": "return model.devices[arrayIndices[0]].gridProductionQualitySensors[arrayIndices[1]].displayType > 0;" } }, "compareLevel": { "title": "Comparison level", "type": "number", "description": "Here set level to compare at which the sensor fired.", "condition": { "functionBody": "return model.devices[arrayIndices[0]].gridProductionQualitySensors[arrayIndices[1]].displayType > 0;" } }, "namePrefix": { "title": "Prefix", "type": "boolean", "description": "Use the accessory name as a prefix", "condition": { "functionBody": "return model.devices[arrayIndices[0]].gridProductionQualitySensors[arrayIndices[1]].displayType > 0;" } } }, "allOf": [ { "if": { "required": [ "displayType" ], "properties": { "displayType": { "enum": [ 1, 2, 3 ] } } }, "then": { "required": [ "compareType", "compareMode", "compareLevel" ] } } ] } }, "powerConsumptionTotalLevelSensors": { "title": "Sensors", "type": "array", "items": { "type": "object", "properties": { "displayType": { "title": "Accessory type", "type": "integer", "minimum": 0, "maximum": 3, "description": "Accessory type for Home app", "anyOf": [ { "title": "Disabled", "enum": [ 0 ] }, { "title": "Motion Sensor", "enum": [ 1 ] }, { "title": "Occupancy Sensor", "enum": [ 2 ] }, { "title": "Contact Sensor", "enum": [ 3 ] } ] }, "name": { "title": "Accessory name", "type": "string", "placeholder": "Sensor name", "description": "Name for the sensor accessory in the Home app" }, "compareMode": { "title": "Comparison mode", "type": "integer", "minimum": 0, "maximum": 5, "description": "Comparison mode", "anyOf": [ { "title": ">", "enum": [ 0 ] }, { "title": ">=", "enum": [ 1 ] }, { "title": "==", "enum": [ 2 ] }, { "title": "<", "enum": [ 3 ] }, { "title": "<=", "enum": [ 4 ] }, { "title": "!=", "enum": [ 5 ] } ], "condition": { "functionBody": "return model.devices[arrayIndices[0]].powerConsumptionTotalLevelSensors[arrayIndices[1]].displayType > 0;" } }, "powerLevel": { "title": "Power Level", "type": "integer", "minimum": 0, "description": "Power level in (W) for comparison to sensor that was triggered", "condition": { "functionBody": "return model.devices[arrayIndices[0]].powerConsumptionTotalLevelSensors[arrayIndices[1]].displayType > 0;" } }, "namePrefix": { "title": "Prefix", "type": "boolean", "description": "Use the accessory name as a prefix", "condition": { "functionBody": "return model.devices[arrayIndices[0]].powerConsumptionTotalLevelSensors[arrayIndices[1]].displayType > 0;" } } }, "allOf": [ { "if": { "required": [ "displayType" ], "properties": { "displayType": { "enum": [ 1, 2, 3 ] } } }, "then": { "required": [ "compareMode", "powerLevel" ] } } ] } }, "energyConsumptionTotalLifetimeOffset": { "title": "Energy Lifetime Offset", "type": "integer", "description": "Offset in (Wh) for energy consumption total (if needed)" }, "energyConsumptionTotalLevelSensors": { "title": "Sensors", "type": "array", "items": { "type": "object", "properties": { "displayType": { "title": "Accessory type", "type": "integer", "minimum": 0, "maximum": 3, "description": "Accessory type for Home app", "anyOf": [ { "title": "Disabled", "enum": [ 0 ] }, { "title": "Motion Sensor", "enum": [ 1 ] }, { "title": "Occupancy Sensor", "enum": [ 2 ] }, { "title": "Contact Sensor", "enum": [ 3 ] } ] }, "name": { "title": "Accessory name", "type": "string", "placeholder": "Sensor name", "description": "Name for the sensor accessory in the Home app" }, "compareMode": { "title": "Comparison mode", "type": "integer", "minimum": 0, "maximum": 5, "description": "Comparison mode", "anyOf": [ { "title": ">", "enum": [ 0 ] }, { "title": ">=", "enum": [ 1 ] }, { "title": "==", "enum": [ 2 ] }, { "title": "<", "enum": [ 3 ] }, { "title": "<=", "enum": [ 4 ] }, { "title": "!=", "enum": [ 5 ] } ], "condition": { "functionBody": "return model.devices[arrayIndices[0]].energyConsumptionTotalLevelSensors[arrayIndices[1]].displayType > 0;" } }, "energyLevel": { "title": "Enargy Level", "type": "integer", "minimum": 0, "description": "Energy level in (Wh) to compare to sensor that was triggered", "condition": { "functionBody": "return model.devices[arrayIndices[0]].energyConsumptionTotalLevelSensors[arrayIndices[1]].displayType > 0;" } }, "namePrefix": { "title": "Prefix", "type": "boolean", "description": "Use the accessory name as a prefix", "condition": { "functionBody": "return model.devices[arrayIndices[0]].energyConsumptionTotalLevelSensors[arrayIndices[1]].displayType > 0;" } } }, "allOf": [ { "if": { "required": [ "displayType" ], "properties": { "displayType": { "enum": [ 1, 2, 3 ] } } }, "then": { "required": [ "compareMode", "energyLevel" ] } } ] } }, "gridConsumptionTotalQualitySensors": { "title": "Sensors", "type": "array", "items": { "type": "object", "properties": { "displayType": { "title": "Accessory type", "type": "integer", "minimum": 0, "maximum": 3, "description": "Accessory type for Home app", "anyOf": [ { "title": "Disabled", "enum": [ 0 ] }, { "title": "Motion Sensor", "enum": [ 1 ] }, { "title": "Occupancy Sensor", "enum": [ 2 ] }, { "title": "Contact Sensor", "enum": [ 3 ] } ] }, "name": { "title": "Accessory name", "type": "string", "placeholder": "Sensor name", "description": "Name for the sensor accessory in the Home app" }, "compareType": { "title": "Comparison type", "type": "integer", "minimum": 0, "maximum": 3, "description": "Comparison type", "anyOf": [ { "title": "Current (A)", "enum": [ 0 ] }, { "title": "Voltage (V)", "enum": [ 1 ] }, { "title": "Frequency (Hz)", "enum": [ 2 ] }, { "title": "Power Factor (cos φ)", "enum": [ 3 ] } ], "condition": { "functionBody": "return model.devices[arrayIndices[0]].gridConsumptionTotalQualitySensors[arrayIndices[1]].displayType > 0;" } }, "compareMode": { "title": "Comparison mode", "type": "integer", "minimum": 0, "maximum": 5, "description": "Comparison mode", "anyOf": [ { "title": ">", "enum": [ 0 ] }, { "title": ">=", "enum": [ 1 ] }, { "title": "==", "enum": [ 2 ] }, { "title": "<", "enum": [ 3 ] }, { "title": "<=", "enum": [ 4 ] }, { "title": "!=", "enum": [ 5 ] } ], "condition": { "functionBody": "return model.devices[arrayIndices[0]].gridConsumptionTotalQualitySensors[arrayIndices[1]].displayType > 0;" } }, "compareLevel": { "title": "Comparison level", "type": "number", "description": "Here set level to compare at which the sensor fired.", "condition": { "functionBody": "return model.devices[arrayIndices[0]].gridConsumptionTotalQualitySensors[arrayIndices[1]].displayType > 0;" } }, "namePrefix": { "title": "Prefix", "type": "boolean", "description": "Use the accessory name as a prefix", "condition": { "functionBody": "return model.devices[arrayIndices[0]].gridConsumptionTotalQualitySensors[arrayIndices[1]].displayType > 0;" } } }, "allOf": [ { "if": { "required": [ "displayType" ], "properties": { "displayType": { "enum": [ 1, 2, 3 ] } } }, "then": { "required": [ "compareType", "compareMode", "compareLevel" ] } } ] } }, "powerConsumptionNetLevelSensors": { "title": "Sensors", "type": "array", "items": { "type": "object", "properties": { "displayType": { "title": "Accessory type", "type": "integer", "minimum": 0, "maximum": 3, "description": "Accessory type for Home app", "anyOf": [ { "title": "Disabled", "enum": [ 0 ] }, { "title": "Motion Sensor", "enum": [ 1 ] }, { "title": "Occupancy Sensor", "enum": [ 2 ] }, { "title": "Contact Sensor", "enum": [ 3 ] } ] }, "name": { "title": "Accessory name", "type": "string", "placeholder": "Sensor name", "description": "Name for the sensor accessory in the Home app" }, "compareMode": { "title": "Comparison mode", "type": "integer", "minimum": 0, "maximum": 5, "description": "Comparison mode", "anyOf": [ { "title": ">", "enum": [ 0 ] }, { "title": ">=", "enum": [ 1 ] }, { "title": "==", "enum": [ 2 ] }, { "title": "<", "enum": [ 3 ] }, { "title": "<=", "enum": [ 4 ] }, { "title": "!=", "enum": [ 5 ] } ], "condition": { "functionBody": "return model.devices[arrayIndices[0]].powerConsumptionNetLevelSensors[arrayIndices[1]].displayType > 0;" } }, "powerLevel": { "title": "Power Level", "type": "integer", "description": "Here set power level in (W) to compare at which the sensor fired, negative value (-) mean exporting energy to the grid.", "condition": { "functionBody": "return model.devices[arrayIndices[0]].powerConsumptionNetLevelSensors[arrayIndices[1]].displayType > 0;" } }, "namePrefix": { "title": "Prefix", "type": "boolean", "description": "Use the accessory name as a prefix", "condition": { "functionBody": "return model.devices[arrayIndices[0]].powerConsumptionNetLevelSensors[arrayIndices[1]].displayType > 0;" } } }, "allOf": [ { "if": { "required": [ "displayType" ], "properties": { "displayType": { "enum": [ 1, 2, 3 ] } } }, "then": { "required": [ "compareMode", "powerLevel" ] } } ] } }, "energyConsumptionNetLifetimeOffset": { "title": "Energy Lifetime Offset", "type": "integer", "description": "Offset in (Wh) for net energy consumption (if needed)" }, "energyConsumptionNetLevelSensors": { "title": "Sensors", "type": "array", "items": { "type": "object", "properties": { "displayType": { "title": "Accessory type", "type": "integer", "minimum": 0, "maximum": 3, "description": "Accessory type for Home app", "anyOf": [ { "title": "Disabled", "enum": [ 0 ] }, { "title": "Motion Sensor", "enum": [ 1 ] }, { "title": "Occupancy Sensor", "enum": [ 2 ] }, { "title": "Contact Sensor", "enum": [ 3 ] } ] },