UNPKG

@homebridge-plugins/homebridge-ewelink

Version:

Homebridge plugin to integrate eWeLink devices into HomeKit.

1,087 lines 79.4 kB
{ "pluginAlias": "eWeLink", "pluginType": "platform", "singular": true, "strictValidation": true, "customUi": true, "customUiPath": "./lib/homebridge-ui", "headerDisplay": "<p align=\"center\"><img width=\"60%\" src=\"https://user-images.githubusercontent.com/43026681/101325266-63126600-3863-11eb-9382-4a2924f0e540.png\"></p><p align=\"center\">For help and support please visit our <a href=\"https://github.com/homebridge-plugins/homebridge-ewelink/wiki\">GitHub Wiki</a>. We hope you find this plugin useful!</p>", "schema": { "type": "object", "properties": { "name": { "type": "string", "title": "Plugin Name", "default": "eWeLink" }, "username": { "type": "string", "title": "Username", "required": true, "placeholder": "Email or full phone (e.g. +8613185260282)", "description": "Your eWeLink username, please use your main eWeLink credentials (not a secondary/shared account)." }, "password": { "type": "string", "title": "Password", "required": true, "description": "Your eWeLink password, can also be a base64 encoded version of your password." }, "mode": { "type": "string", "title": "Connection Mode", "description": "This setting defines how the plugin communicates with your devices. For further guidance, please refer to <a href=\"https://github.com/homebridge-plugins/homebridge-ewelink/wiki/Connection-Methods\" target=\"_blank\">this wiki article</a>.", "default": "auto", "oneOf": [ { "title": "Hybrid (Recommended)", "enum": ["auto"] }, { "title": "Cloud Only", "enum": ["wan"] }, { "title": "LAN Only (will remove unsupported devices)", "enum": ["lan"] } ] }, "language": { "type": "string", "title": "Logging Language", "description": "Language to use for logging.", "default": "en", "oneOf": [ { "title": "English", "enum": ["en"] }, { "title": "French", "enum": ["fr"] }, { "title": "Thai", "enum": ["th"] } ] }, "disableDeviceLogging": { "type": "boolean", "title": "Disable Device Logging", "description": "Global logging setting for accessory status changes. If true then accessory status changes will not be logged. This can also be set per accessory later in the config." }, "disableNoResponse": { "type": "boolean", "title": "Disable 'No Response'", "description": "If true, devices marked as cloud-offline will not be shown as 'No Response' in HomeKit.", "condition": { "functionBody": "return (model.mode !== 'lan');" } }, "ignoredHomes": { "title": "Ignored Homes", "type": "string", "description": "A list of comma-separated eWeLink home ids to ignore.", "placeholder": "" }, "countryCode": { "title": "Country Code", "type": "string", "description": "Override the default country code, may help with login issues for users in other regions.", "placeholder": "+44" }, "appId": { "title": "App ID", "type": "string", "description": "Available if you want to override the eWeLink App ID." }, "appSecret": { "title": "App Secret", "type": "string", "description": "Available if you want to override the eWeLink App Secret." }, "httpHost": { "title": "HTTP Host", "type": "string", "description": "Available if you want to override the API host.", "placeholder": "eu-apia.coolkit.cc", "oneOf": [ { "title": "Auto (Recommended)", "enum": ["auto"] }, { "title": "eu-apia.coolkit.cc", "enum": ["eu-apia.coolkit.cc"] }, { "title": "us-apia.coolkit.cc", "enum": ["us-apia.coolkit.cc"] }, { "title": "as-apia.coolkit.cc", "enum": ["as-apia.coolkit.cc"] }, { "title": "cn-apia.coolkit.cn", "enum": ["cn-apia.coolkit.cn"] } ] }, "apiPort": { "type": "integer", "title": "Internal API Port", "description": "Port to use for the internal HTTP API. Set to 0 to disable. Set to 1 to choose a randomly available port.", "minimum": 0 }, "singleDevices": { "title": "Single Channel Devices", "description": "Optional settings for single-channel switch, outlet and light switch devices.", "type": "array", "items": { "type": "object", "properties": { "label": { "title": "Label", "type": "string", "description": "This setting has no effect except to help identify this device." }, "deviceId": { "type": "string", "title": "Device ID", "description": "Enter the 10 digit eWeLink Device ID to begin.", "minLength": 10, "maxLength": 10 }, "ignoreDevice": { "type": "boolean", "title": "Hide From HomeKit", "description": "If true, this accessory will be removed and ignored from HomeKit.", "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && model.singleDevices[arrayIndices].deviceId && model.singleDevices[arrayIndices].deviceId.length === 10);" } }, "deviceModel": { "type": "string", "title": "Device Model", "description": "This setting has no effect except showing the relevant options for this model below.", "oneOf": [ { "title": "Sonoff BASIC/MINI/RF/SV/RE5V1C", "enum": ["single"] }, { "title": "Sonoff T1/T2/T3/TX-1C/M5-1-Gang", "enum": ["t"] }, { "title": "Sonoff POW/R2", "enum": ["pow"] }, { "title": "Sonoff IW100/IW101", "enum": ["iw"] }, { "title": "Sonoff S20/S26/S31/S55", "enum": ["s"] }, { "title": "Sonoff Micro", "enum": ["micro"] }, { "title": "Sonoff SLAMPHER/R2", "enum": ["slampher"] }, { "title": "Eachen GD-DC5", "enum": ["gddc5"] }, { "title": "KingArt KING-Q1/Q4", "enum": ["king"] }, { "title": "Zigbee Single Channel (BASICZBR3/ZBMINI/S31ZB)", "enum": ["zb"] } ], "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && model.singleDevices[arrayIndices].deviceId && model.singleDevices[arrayIndices].deviceId.length === 10 && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "showAs": { "type": "string", "title": "Show As (Simulation)", "description": "Expose this device as a different HomeKit accessory type.", "oneOf": [ { "title": "1 Switch (Default)", "enum": ["default"] }, { "title": "1 Outlet", "enum": ["outlet"] }, { "title": "1 Air Purifier", "enum": ["purifier"] }, { "title": "1 Heater", "enum": ["heater"] }, { "title": "1 Cooler", "enum": ["cooler"] }, { "title": "1 Doorbell", "enum": ["doorbell"] }, { "title": "1 Garage Door", "enum": ["garage"] }, { "title": "1 Gate (As Garage Door)", "enum": ["gate"] }, { "title": "1 Irrigation Valve", "enum": ["valve"] }, { "title": "1 Lock", "enum": ["lock"] }, { "title": "1 Programmable Button", "enum": ["p_button"] }, { "title": "1 Sensor", "enum": ["sensor"] }, { "title": "1 Tap/Faucet", "enum": ["tap"] }, { "title": "1 Audio Receiver (External Accessory)", "enum": ["audio"] }, { "title": "1 Set Top Box (External Accessory)", "enum": ["box"] }, { "title": "1 Streaming Stick (External Accessory)", "enum": ["stick"] } ], "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && ['single', 't', 'pow', 'iw', 's', 'micro', 'slampher', 'zb'].includes(model.singleDevices[arrayIndices].deviceModel) && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "showAsMotor": { "type": "string", "title": "KingArt KING-Q1/Q4 Accessory Type", "description": "Select the accessory type to show in HomeKit.", "oneOf": [ { "title": "Window Blind/Covering (Default)", "enum": ["blind"] }, { "title": "Door", "enum": ["door"] }, { "title": "Garage Door", "enum": ["garage"] }, { "title": "Window", "enum": ["window"] } ], "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && model.singleDevices[arrayIndices].deviceId && ['king'].includes(model.singleDevices[arrayIndices].deviceModel) && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "showAsEachen": { "type": "string", "title": "Garage Device Accessory Type", "description": "Select the accessory type to show in HomeKit.", "oneOf": [ { "title": "Garage Door (Default)", "enum": ["garage"] }, { "title": "Lock", "enum": ["lock"] } ], "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && model.singleDevices[arrayIndices].deviceId && ['gddc5'].includes(model.singleDevices[arrayIndices].deviceModel) && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "inUsePowerThreshold": { "type": "integer", "title": "Outlet 'In Use' Threshold", "description": "HomeKit will set the 'In Use' status of outlet devices to true when the wattage is above this number. Must be 0 or more.", "placeholder": 0, "minimum": 0, "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && ['pow', 'iw'].includes(model.singleDevices[arrayIndices].deviceModel) && [undefined, 'default', 'outlet'].includes(model.singleDevices[arrayIndices].showAs) && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "disableTimer": { "type": "boolean", "title": "Disable Valve Timer", "description": "If true, the timer for the valve will be removed.", "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && ['valve'].includes(model.singleDevices[arrayIndices].showAs) && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "temperatureSource": { "type": "string", "title": "Temperature Sensor ID", "description": "Enter a eWeLink, Govee or Meross device ID which provides a current temperature reading.", "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && ['heater', 'cooler'].includes(model.singleDevices[arrayIndices].showAs) && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "isInched": { "type": "boolean", "title": "Status By Inching", "description": "If true, the plugin will show the on/off status based on inching mode.", "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && [undefined, 'default', 'outlet'].includes(model.singleDevices[arrayIndices].showAs) && !['king', 'gddc5'].includes(model.singleDevices[arrayIndices].deviceModel) && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "sensorType": { "type": "string", "title": "Sensor Type", "description": "The type of sensor to use.", "oneOf": [ { "title": "Motion (Default)", "enum": ["motion"] }, { "title": "Smoke/Fire", "enum": ["smoke"] }, { "title": "Water/Leak", "enum": ["water"] }, { "title": "Carbon Monoxide", "enum": ["co"] }, { "title": "Carbon Dioxide", "enum": ["co2"] }, { "title": "Occupancy", "enum": ["occupancy"] }, { "title": "Contact", "enum": ["contact"] } ], "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && ['sensor'].includes(model.singleDevices[arrayIndices].showAs) && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "operationTime": { "type": "integer", "title": "Operation Time (Deciseconds)", "description": "Garage doors: the time to open/close the device. Locks: the time to show as unlocked. This setting is in deciseconds - count the time in seconds and multiply by 10, for example 75 for 7.5 seconds. Must be 20 or more.", "placeholder": 100, "minimum": 20, "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && ((model.singleDevices[arrayIndices].deviceModel === 'gddc5' && model.singleDevices[arrayIndices].showAsEachen !== 'lock') || ['garage', 'lock', 'gate'].includes(model.singleDevices[arrayIndices].showAs)) && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "operationTimeDown": { "type": "integer", "title": "Operation Time Down (Deciseconds)", "description": "If your garage door has a different operation time for up and down, use this setting to specify the operation time DOWN (in deciseconds) and the other setting to specify the operation time UP. Otherwise leave blank. Must be 20 or more.", "placeholder": 100, "minimum": 20, "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && ['garage'].includes(model.singleDevices[arrayIndices].showAs) && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "sensorId": { "type": "string", "title": "Sensor", "description": "A DW2 or Zigbee contact sensor can be used for a single garage door or lock to determine the current state. Enter the 10 digit eWeLink Device ID (normally in the format 1000ab23cd). Otherwise leave blank.", "minLength": 10, "maxLength": 10, "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && ['garage', 'lock'].includes(model.singleDevices[arrayIndices].showAs) && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "hideSensor": { "type": "boolean", "title": "Hide Sensor", "description": "Hide this contact sensor accessory from HomeKit.", "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && model.singleDevices[arrayIndices].sensorId && model.singleDevices[arrayIndices].sensorId.length === 10 && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "obstructId": { "type": "string", "title": "Obstruction Switch", "description": "An optional switch that will trigger the Obstruction Detected feature depending on its value. Otherwise leave blank.", "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && ((model.singleDevices[arrayIndices].deviceModel === 'gddc5' && model.singleDevices[arrayIndices].showAsEachen !== 'lock') || ['garage'].includes(model.singleDevices[arrayIndices].showAs)) && !model.singleDevices[arrayIndices].ignoreDevice);" } }, "ipAddress": { "type": "string", "title": "IP Address", "description": "You can manually set the IP address for this device if it cannot be discovered by the plugin.", "condition": { "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && ['single', 't', 'pow', 'iw', 's', 'micro', 'slampher', 'gddc5'].includes(model.singleDevices[arrayIndices].deviceModel) && !model.singleDevices[arrayIndices].ignoreDevice);" } } } } }, "multiDevices": { "title": "Multi Channel Devices", "description": "Optional settings for multi-channel switch, outlet and light switch devices.", "type": "array", "items": { "type": "object", "properties": { "label": { "title": "Label", "type": "string", "description": "This setting has no effect except to help identify this device." }, "deviceId": { "type": "string", "title": "Device ID", "description": "Enter the 10 digit eWeLink Device ID to begin.", "minLength": 10, "maxLength": 10 }, "ignoreDevice": { "type": "boolean", "title": "Hide From HomeKit", "description": "If true, this accessory will be removed and ignored from HomeKit.", "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && model.multiDevices[arrayIndices].deviceId && model.multiDevices[arrayIndices].deviceId.length === 10);" } }, "deviceModel": { "type": "string", "title": "Device Model", "description": "This setting has no effect except showing the relevant options for this model below.", "oneOf": [ { "title": "Sonoff DUAL/R2", "enum": ["dual_dualr2"] }, { "title": "Sonoff DUALR3 (Switch Mode)", "enum": ["dualr3_switch"] }, { "title": "Sonoff DUALR3 (Motor Mode)", "enum": ["dualr3_motor"] }, { "title": "Sonoff 4CH/PRO/R2/R3", "enum": ["4ch"] }, { "title": "Sonoff T1/T2/T3/TX-2C/3C/4C/M5-2/3-Gang", "enum": ["t"] }, { "title": "Zigbee Multi Channel", "enum": ["zb"] } ], "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && model.multiDevices[arrayIndices].deviceId && model.multiDevices[arrayIndices].deviceId.length === 10 && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "showAs": { "type": "string", "title": "Show As (Simulation)", "description": "Expose this device as a different HomeKit accessory type.", "oneOf": [ { "title": "Switches (Default)", "enum": ["default"] }, { "title": "Outlets", "enum": ["outlet"] }, { "title": "1 Air Purifier", "enum": ["purifier"] }, { "title": "1 Door", "enum": ["door"] }, { "title": "1 Doorbell", "enum": ["doorbell"] }, { "title": "1 Garage Door", "enum": ["garage"] }, { "title": "2 Garage Doors", "enum": ["garage_two"] }, { "title": "4 Garage Doors", "enum": ["garage_four"] }, { "title": "1 Gate (As Garage Door)", "enum": ["gate"] }, { "title": "1 Irrigation Valve", "enum": ["valve"] }, { "title": "2 Irrigation Valves", "enum": ["valve_two"] }, { "title": "4 Irrigation Valves", "enum": ["valve_four"] }, { "title": "1 Lock", "enum": ["lock"] }, { "title": "1 Programmable Button", "enum": ["p_button"] }, { "title": "1 Sensor", "enum": ["sensor"] }, { "title": "1 Switch & 1 Valve", "enum": ["switch_valve"] }, { "title": "1 Tap/Faucet", "enum": ["tap"] }, { "title": "2 Taps/Faucets", "enum": ["tap_two"] }, { "title": "1 Window", "enum": ["window"] }, { "title": "1 Window Blind/Covering", "enum": ["blind"] }, { "title": "1 Audio Receiver (External Accessory)", "enum": ["audio"] }, { "title": "1 Set Top Box (External Accessory)", "enum": ["box"] }, { "title": "1 Streaming Stick (External Accessory)", "enum": ["stick"] } ], "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && model.multiDevices[arrayIndices].deviceId && ['dual_dualr2', 'dualr3_switch', '4ch', 't', 'zb'].includes(model.multiDevices[arrayIndices].deviceModel) && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "showAsMotor": { "type": "string", "title": "DUALR3 Accessory Type", "description": "Select the accessory type to show in HomeKit.", "oneOf": [ { "title": "Window Blind/Covering (Default)", "enum": ["blind"] }, { "title": "Door", "enum": ["door"] }, { "title": "Garage Door", "enum": ["garage"] }, { "title": "Window", "enum": ["window"] } ], "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && model.multiDevices[arrayIndices].deviceId && ['dualr3_motor'].includes(model.multiDevices[arrayIndices].deviceModel) && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "hideChannels": { "type": "string", "title": "Hide Channels", "description": "A comma separated list of channels to hide for this device. For example '0' or '0,1,2'.", "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && model.multiDevices[arrayIndices].deviceId && ['dual_dualr2', 'dualr3_switch', '4ch', 't', 'zb'].includes(model.multiDevices[arrayIndices].deviceModel) && [undefined, 'default', 'outlet'].includes(model.multiDevices[arrayIndices].showAs) && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "inUsePowerThreshold": { "type": "integer", "title": "Outlet 'In Use' Threshold", "description": "HomeKit will set the 'In Use' status of outlet devices to true when the wattage is above this number. Must be 0 or more.", "placeholder": 0, "minimum": 0, "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && model.multiDevices[arrayIndices].deviceId && [undefined, 'default', 'outlet'].includes(model.multiDevices[arrayIndices].showAs) && ['dualr3_switch'].includes(model.multiDevices[arrayIndices].deviceModel) && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "disableTimer": { "type": "boolean", "title": "Disable Valve Timer", "description": "If true, the timer for the valve will be removed.", "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && ['valve', 'valve_two', 'valve_four'].includes(model.multiDevices[arrayIndices].showAs) && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "inchChannels": { "type": "string", "title": "Status By Inching", "description": "A comma separated list of channels to show the on/off status based on inching mode. For example '1,2'.", "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && ['dual_dualr2', 'dualr3_switch', '4ch', 't', 'zb'].includes(model.multiDevices[arrayIndices].deviceModel) && [undefined, 'default', 'outlet'].includes(model.multiDevices[arrayIndices].showAs) && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "sensorType": { "type": "string", "title": "Sensor Type", "description": "The type of sensor to use.", "oneOf": [ { "title": "Motion (Default)", "enum": ["motion"] }, { "title": "Smoke/Fire", "enum": ["smoke"] }, { "title": "Water/Leak", "enum": ["water"] }, { "title": "Carbon Monoxide", "enum": ["co"] }, { "title": "Carbon Dioxide", "enum": ["co2"] }, { "title": "Occupancy", "enum": ["occupancy"] }, { "title": "Contact", "enum": ["contact"] } ], "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && ['sensor'].includes(model.multiDevices[arrayIndices].showAs) && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "operationTime": { "type": "integer", "title": "Operation Time (Deciseconds)", "description": "Blinds/garage doors: the time to open/close the device. Locks: the time to show as unlocked. This setting is in deciseconds - count the time in seconds and multiply by 10, for example 75 for 7.5 seconds. Must be 20 or more.", "placeholder": 100, "minimum": 20, "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && ['garage', 'garage_two', 'garage_four', 'blind', 'door', 'window', 'lock', 'gate'].includes(model.multiDevices[arrayIndices].showAs) && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "operationTimeDown": { "type": "integer", "title": "Operation Time Down (Deciseconds)", "description": "If your garage door or blind has a different operation time for up and down, use this setting to specify the operation time DOWN (in deciseconds) and the other setting to specify the operation time UP. Otherwise leave blank. Must be 20 or more.", "placeholder": 100, "minimum": 20, "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && ['garage', 'garage_two', 'garage_four', 'blind', 'door', 'window'].includes(model.multiDevices[arrayIndices].showAs) && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "sensorId": { "type": "string", "title": "Sensor", "description": "A DW2 or Zigbee contact sensor can be used for a single garage door or lock to determine the current state. Enter the 10 digit eWeLink Device ID (normally in the format 1000ab23cd). Otherwise leave blank.", "minLength": 10, "maxLength": 10, "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && ['garage', 'lock'].includes(model.multiDevices[arrayIndices].showAs) && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "hideSensor": { "type": "boolean", "title": "Hide Sensor", "description": "Hide this contact sensor accessory from HomeKit.", "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && model.multiDevices[arrayIndices].sensorId && model.multiDevices[arrayIndices].sensorId.length === 10 && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "obstructId": { "type": "string", "title": "Obstruction Switch", "description": "An optional switch that will trigger the Obstruction Detected feature depending on its value. Otherwise leave blank.", "condition": { "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && ['garage'].includes(model.multiDevices[arrayIndices].showAs) && !model.multiDevices[arrayIndices].ignoreDevice);" } }, "ipAddress": { "type": "string", "title": "IP Address", "description": "You can manually set the IP address for this device if it cannot be discovered by the plugin.", "condition": { "functionBody": "return (model.mode !== 'wan' && model.multiDevices && model.multiDevices[arrayIndices] && model.multiDevices[arrayIndices].deviceId && ['dual_dualr2', 'dualr3_switch', 'dualr3_motor', '4ch', 't'].includes(model.multiDevices[arrayIndices].deviceModel) && !model.multiDevices[arrayIndices].ignoreDevice);" } } } } }, "lightDevices": { "title": "Light Devices", "description": "Optional settings for dimmer, bulb and LED strip devices.", "type": "array", "items": { "type": "object", "properties": { "label": { "title": "Label", "type": "string", "description": "This setting has no effect except to help identify this device." }, "deviceId": { "type": "string", "title": "Device ID", "description": "Enter the 10 digit eWeLink Device ID to begin.", "minLength": 10, "maxLength": 10 }, "ignoreDevice": { "type": "boolean", "title": "Hide From HomeKit", "description": "If true, this accessory will be removed and ignored from HomeKit.", "condition": { "functionBody": "return (model.lightDevices && model.lightDevices[arrayIndices] && model.lightDevices[arrayIndices].deviceId && model.lightDevices[arrayIndices].deviceId.length === 10);" } }, "deviceModel": { "type": "string", "title": "Device Model", "description": "This setting has no effect except showing the relevant options for this model below.", "oneOf": [ { "title": "Sonoff D1/R2", "enum": ["d1"] }, { "title": "Sonoff B1/R2", "enum": ["b1"] }, { "title": "Sonoff L1/L2/Lite", "enum": ["l1"] }, { "title": "Sonoff B02-B-A60", "enum": ["bulbB02BA60"] }, { "title": "Sonoff B02-F-A60", "enum": ["bulbB02FA60"] }, { "title": "Sonoff B02-F-ST64", "enum": ["bulbB02FST64"] }, { "title": "Sonoff B05-B-A60", "enum": ["bulbB05BA60"] }, { "title": "Sonoff B05-BL-A19", "enum": ["bulbB05BLA19"] }, { "title": "KingArt KING-M4", "enum": ["king"] }, { "title": "Zigbee Light (Dimmer)", "enum": ["zl_d"] }, { "title": "Zigbee Light (Dimmer + CCT)", "enum": ["zl_dc"] } ], "condition": { "functionBody": "return (model.lightDevices && model.lightDevices[arrayIndices] && model.lightDevices[arrayIndices].deviceId && model.lightDevices[arrayIndices].deviceId.length === 10 && !model.lightDevices[arrayIndices].ignoreDevice);" } }, "showAs": { "type": "string", "title": "Show As (Simulation)", "description": "Expose this device as a different HomeKit accessory type.", "oneOf": [ { "title": "1 Light (Default)", "enum": ["default"] }, { "title": "1 Fan", "enum": ["fan"] } ], "condition": { "functionBody": "return (model.lightDevices && model.lightDevices[arrayIndices] && ['d1', 'king'].includes(model.lightDevices[arrayIndices].deviceModel) && !model.lightDevices[arrayIndices].ignoreDevice);" } }, "brightnessStep": { "title": "Brightness Step", "type": "integer", "description": "A minimum step for the brightness slider in the Home app. Must be 1 or more.", "placeholder": 1, "minimum": 1, "condition": { "functionBody": "return (model.lightDevices && model.lightDevices[arrayIndices] && ['d1', 'l1', 'bulbB02BA60', 'bulbB05BA60', 'bulbB02FA60', 'bulbB02FST64', 'bulbB05BLA19', 'king', 'zl_d', 'zl_dc'].includes(model.lightDevices[arrayIndices].deviceModel) && !model.lightDevices[arrayIndices].ignoreDevice);" } }, "adaptiveLightingShift": { "title": "Adaptive Lighting Shift", "type": "integer", "description": "The mired for each Adaptive Lighting update will be increased by this value, making the light appear warmer. Set to -1 to remove Adaptive Lighting feature. Must be -1 or more.", "placeholder": 0, "minimum": -1, "condition": { "functionBody": "return (model.lightDevices && model.lightDevices[arrayIndices] && ['l1', 'bulbB02BA60', 'bulbB05BA60', 'bulbB02FA60', 'bulbB02FST64', 'bulbB05BLA19', 'zl_dc'].includes(model.lightDevices[arrayIndices].deviceModel) && !model.lightDevices[arrayIndices].ignoreDevice);" } }, "offlineAsOff": { "type": "boolean", "title": "Offline As Off", "description": "If true, this accessory will show as off if reported offline.", "condition": { "functionBody": "return (model.lightDevices && model.lightDevices[arrayIndices] && model.lightDevices[arrayIndices].deviceId && model.lightDevices[arrayIndices].deviceId.length === 10 && !model.lightDevices[arrayIndices].ignoreDevice);" } }, "ipAddress": { "type": "string", "title": "IP Address", "description": "You can manually set the IP address for this device if it cannot be discovered by the plugin.", "condition": { "functionBody": "return (model.mode !== 'wan' && model.lightDevices && model.lightDevices[arrayIndices] && ['d1', 'bulbB05BLA19'].includes(model.lightDevices[arrayIndices].deviceModel) && !model.lightDevices[arrayIndices].ignoreDevice);" } } } } }, "thDevices": { "title": "Thermostat Devices", "description": "Optional settings for thermostat devices, NSPanel, TH10/16 and THR316/320.", "type": "array", "items": { "type": "object", "properties": { "label": { "title": "Label", "type": "string", "description": "This setting has no effect except to help identify this device." }, "deviceId": { "type": "string", "title": "Device ID", "description": "Enter the 10 digit eWeLink Device ID to begin.", "minLength": 10, "maxLength": 10 }, "ignoreDevice": { "type": "boolean", "title": "Hide From HomeKit", "description": "If true, this accessory will be removed and ignored from HomeKit.", "condition": { "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && model.thDevices[arrayIndices].deviceId && model.thDevices[arrayIndices].deviceId.length === 10);" } }, "deviceModel": { "type": "string", "title": "Device Model", "description": "This setting has no effect except showing the relevant options for this model below.", "oneOf": [ { "title": "Sonoff TH10/16 and THR316/320", "enum": ["th"] }, { "title": "Sonoff NSPanel", "enum": ["panel"] }, { "title": "Sonoff SC", "enum": ["sc"] }, { "title": "KKMOON HC-T010-EWF", "enum": ["hc"] } ], "condition": { "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && model.thDevices[arrayIndices].deviceId && model.thDevices[arrayIndices].deviceId.length === 10 && !model.thDevices[arrayIndices].ignoreDevice);" } }, "showAs": { "type": "string", "title": "Show As (Simulation)", "description": "Expose this device as a different HomeKit accessory type.", "oneOf": [ { "title": "1 Switch + Sensors (Default)", "enum": ["default"] }, { "title": "1 Thermostat", "enum": ["thermostat"] }, { "title": "1 Heater", "enum": ["heater"] }, { "title": "1 Cooler", "enum": ["cooler"] }, { "title": "1 Humidifier", "enum": ["humidifier"] }, { "title": "1 Dehumidifier", "enum": ["dehumidifier"] } ], "condition": { "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && ['th'].includes(model.thDevices[arrayIndices].deviceModel) && !model.thDevices[arrayIndices].ignoreDevice);" } }, "showHeatCool": { "type": "boolean", "title": "Show Heat/Cool Modes", "description": "If true, the 'Heat' and 'Cool' modes will be shown in HomeKit.", "condition": { "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && ['th'].includes(model.thDevices[arrayIndices].deviceModel) && model.thDevices[arrayIndices].showAs === 'thermostat' && !model.thDevices[arrayIndices].ignoreDevice);" } }, "hideSwitch": { "type": "boolean", "title": "Hide Switch", "description": "If true, this accessory will hide the TH10/16 switch from HomeKit.", "condition": { "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && ['th'].includes(model.thDevices[arrayIndices].deviceModel) && !['thermostat', 'heater', 'cooler', 'humidifier', 'dehumidifier'].includes(model.thDevices[arrayIndices].showAs) && !model.thDevices[arrayIndices].ignoreDevice);" } }, "offset": { "type": "number", "title": "Temperature Offset", "description": "You can offset the temperature that the sensor reads. An offset of 2 means 2 degrees will be added to the recorded temperature. Can be positive or negative and can include a decimal point '.'.", "placeholder": 0, "condition": { "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && ['th', 'sc', 'hc', 'panel'].includes(model.thDevices[arrayIndices].deviceModel) && !model.thDevices[arrayIndices].ignoreDevice);" } }, "offsetFactor": { "type": "boolean", "title": "Temperature Offset Factor", "description": "If true then the above value will be used as a factor, i.e. the recorded temperature will be multipled by this number instead.", "condition": { "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && ['th', 'sc', 'hc', 'panel'].includes(model.thDevices[arrayIndices].deviceModel) && model.thDevices[arrayIndices].offset && !model.thDevices[arrayIndices].ignoreDevice);" } }, "humidityOffset": { "type": "number", "title": "Humidity Offset", "description": "You can offset the humidity that the sensor reads. An offset of 2 means 2% will be added to the recorded relative humidity. Can be positive or negative.", "placeholder": 0, "condition": { "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && ['th', 'sc', 'hc'].includes(model.thDevices[arrayIndices].deviceModel) && !model.thDevices[arrayIndices].ignoreDevice);" } }, "humidityOffsetFactor": { "type": "boolean", "title": "Humidity Offset %", "description": "If true then the above value will be used as a factor, i.e. the recorded humidity will be multipled by this number instead.", "condition": { "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && ['th', 'sc', 'hc'].includes(model.thDevices[arrayIndices].deviceModel) && model.thDevices[arrayIndices].humidityOffset && !model.thDevices[arrayIndices].ignoreDevice);" } }, "targetTempThreshold": { "type": "number", "title": "Target Temperature Threshold", "description": "You can add a threshold so the device only switches on when the current temperature is at least the threshold away from the target temperature. This can be useful for devices that don't require an exact temperature and you want to reduce the on-off cycles. Must be positive and can include a decimal point.", "placeholder": 0, "condition": { "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && ['th', 'sc', 'hc', 'panel'].includes(model.thDevices[arrayIndices].deviceModel) && ['heater'].includes(model.thDevices[arrayIndices].showAs) && !model.thDevices[arrayIndices].ignoreDevice);" } }, "minTarget": { "type": "integer", "title": "Minimum Target Temperature", "description": "Minimum target temperature for TH10/16 thermostat/heater/cooler simulation to show in HomeKit apps. Must be 0 or more.", "placeholder": 10, "minimum": 0, "condition": { "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && ['th'].includes(model.thDevices[arrayIndices].deviceModel) && ['thermostat', 'heater', 'cooler'].includes(model.thDevices[arrayIndices].showAs) && !model.thDevices[arrayIndices].ignoreDevice);" } }, "maxTarget": { "type": "integer", "title": "Maximum Target Temperature", "description": "Maximum target temperature for TH10/16 thermostat/heater/cooler simulation to show in HomeKit apps. Must be 1 or more, and greater than the minimum value set above.", "placeholder": 30, "minimum": 1, "condition": { "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && ['th'].includes(model.thDevices[arrayIndices].deviceModel) && ['thermostat', 'heater', 'cooler'].includes(model.thDevices[arrayIndices].showAs) && !model.thDevices[arrayIndices].ignoreDevice);" } }, "ipAddress": { "type": "string", "ti