From d50d010b8292e557621ead4da523993af0194a35 Mon Sep 17 00:00:00 2001 From: John Doe Date: Sat, 16 Jan 2021 19:32:15 +0800 Subject: [PATCH] Publish settings json schema to bridge/info (#5754) * Publish settings json schema to bridge/info * Update frontend * Please linter * Rename configSchema -> config_schema * Fix settings schema * Update titles * Updated descriptions * Update frontend * Update json schema titles and descriptions * Update schema * Update frontend * Update npm-shrinkwrap.json * Update package.json Co-authored-by: Koen Kanters --- lib/extension/bridge.js | 1 + lib/util/settings.js | 168 +---------- lib/util/settings.schema.json | 513 ++++++++++++++++++++++++++++++++++ package.json | 4 +- test/bridge.test.js | 2 +- 5 files changed, 519 insertions(+), 169 deletions(-) create mode 100644 lib/util/settings.schema.json diff --git a/lib/extension/bridge.js b/lib/extension/bridge.js index 613fb2076..023a27a6a 100644 --- a/lib/extension/bridge.js +++ b/lib/extension/bridge.js @@ -486,6 +486,7 @@ class Bridge extends Extension { log_level: logger.getLevel(), permit_join: await this.zigbee.getPermitJoin(), config, + config_schema: settings.schema, }; await this.mqtt.publish('bridge/info', stringify(payload), {retain: true, qos: 0}); diff --git a/lib/util/settings.js b/lib/util/settings.js index 0e0491ce5..b19abd7a2 100644 --- a/lib/util/settings.js +++ b/lib/util/settings.js @@ -7,6 +7,7 @@ const path = require('path'); const yaml = require('./yaml'); const Ajv = require('ajv'); const ajv = new Ajv({allErrors: true}); +const schema = require('./settings.schema.json'); const defaults = { passlist: [], @@ -137,172 +138,6 @@ const defaults = { external_converters: [], }; -const schema = { - type: 'object', - properties: { - device_options: {type: 'object'}, - homeassistant: {type: 'boolean'}, - permit_join: {type: 'boolean'}, - mqtt: { - type: 'object', - properties: { - base_topic: {type: 'string'}, - server: {type: 'string'}, - keepalive: {type: 'number'}, - ca: {type: 'string'}, - key: {type: 'string'}, - cert: {type: 'string'}, - user: {type: 'string'}, - password: {type: 'string'}, - client_id: {type: 'string'}, - reject_unauthorized: {type: 'boolean'}, - include_device_information: {type: 'boolean'}, - version: {type: 'number'}, - force_disable_retain: {type: 'boolean'}, - }, - required: ['base_topic', 'server'], - }, - serial: { - type: 'object', - properties: { - port: {type: ['string', 'null']}, - disable_led: {type: 'boolean'}, - adapter: {type: 'string', enum: ['deconz', 'zstack', 'zigate']}, - }, - }, - blocklist: {type: 'array', items: {type: 'string'}}, - passlist: {type: 'array', items: {type: 'string'}}, - // Deprecated: use block/passlist - whitelist: {type: 'array', items: {type: 'string'}}, - ban: {type: 'array', items: {type: 'string'}}, - experimental: { - type: 'object', - properties: { - transmit_power: {type: 'number'}, - output: {type: 'string', enum: ['attribute_and_json', 'attribute', 'json']}, - }, - }, - advanced: { - type: 'object', - properties: { - legacy_api: {type: 'boolean'}, - pan_id: {type: 'number'}, - ext_pan_id: {type: 'array', items: {type: 'number'}}, - channel: {type: 'number', minimum: 11, maximum: 26}, - cache_state: {type: 'boolean'}, - cache_state_persistent: {type: 'boolean'}, - cache_state_send_on_startup: {type: 'boolean'}, - log_rotation: {type: 'boolean'}, - log_level: {type: 'string', enum: ['info', 'warn', 'error', 'debug']}, - log_output: {type: 'array', items: {type: 'string'}}, - log_directory: {type: 'string'}, - log_file: {type: 'string'}, - baudrate: {type: 'number'}, - rtscts: {type: 'boolean'}, - soft_reset_timeout: {type: 'number', minimum: 0}, - network_key: {type: ['array', 'string'], items: {type: 'number'}}, - last_seen: {type: 'string', enum: ['disable', 'ISO_8601', 'ISO_8601_local', 'epoch']}, - elapsed: {type: 'boolean'}, - availability_timeout: {type: 'number', minimum: 0}, - availability_blocklist: {type: 'array', items: {type: 'string'}}, - availability_passlist: {type: 'array', items: {type: 'string'}}, - // Deprecated, use block/passlist - availability_blacklist: {type: 'array', items: {type: 'string'}}, - availability_whitelist: {type: 'array', items: {type: 'string'}}, - report: {type: 'boolean'}, - homeassistant_discovery_topic: {type: 'string'}, - homeassistant_status_topic: {type: 'string'}, - timestamp_format: {type: 'string'}, - adapter_concurrent: {type: 'number'}, - adapter_delay: {type: 'number'}, - }, - }, - map_options: { - type: 'object', - properties: { - graphviz: { - type: 'object', - properties: { - colors: { - type: 'object', - properties: { - fill: { - type: 'object', - properties: { - enddevice: {type: 'string'}, - coordinator: {type: 'string'}, - router: {type: 'string'}, - }, - }, - font: { - type: 'object', - properties: { - enddevice: {type: 'string'}, - coordinator: {type: 'string'}, - router: {type: 'string'}, - }, - }, - line: { - type: 'object', - properties: { - active: {type: 'string'}, - inactive: {type: 'string'}, - }, - }, - }, - }, - }, - }, - }, - }, - devices: { - type: 'object', - propertyNames: { - pattern: '^0x[\\d\\w]{16}$', - }, - patternProperties: { - '^.*$': { - type: 'object', - properties: { - friendly_name: {type: 'string'}, - retain: {type: 'boolean'}, - retention: {type: 'number'}, - qos: {type: 'number'}, - filtered_attributes: {type: 'array', items: {type: 'string'}}, - }, - required: ['friendly_name'], - }, - }, - }, - groups: { - type: 'object', - propertyNames: { - pattern: '^[\\w].*$', - }, - patternProperties: { - '^.*$': { - type: 'object', - properties: { - friendly_name: {type: 'string'}, - retain: {type: 'boolean'}, - devices: {type: 'array', items: {type: 'string'}}, - optimistic: {type: 'boolean'}, - qos: {type: 'number'}, - filtered_attributes: {type: 'array', items: {type: 'string'}}, - }, - required: ['friendly_name'], - }, - }, - }, - }, - external_converters: { - type: 'array', - items: {type: 'string'}, - }, - required: ['homeassistant', 'permit_join', 'mqtt'], -}; - - let _settings; let _settingsWithDefaults; @@ -810,6 +645,7 @@ module.exports = { removeDeviceFromGroup, changeEntityOptions, changeFriendlyName, + schema, // For tests only _write: write, diff --git a/lib/util/settings.schema.json b/lib/util/settings.schema.json new file mode 100644 index 000000000..a2d53ed24 --- /dev/null +++ b/lib/util/settings.schema.json @@ -0,0 +1,513 @@ +{ + "type": "object", + "properties": { + "device_options": { + "type": "object" + }, + "homeassistant": { + "title": "Homeassistant integration", + "type": "boolean", + "description": "Home Assistant integration (MQTT discovery)", + "default": false + }, + "permit_join": { + "type": "boolean", + "default": false, + "title": "Permit join", + "description": "Allow new devices to join. WARNING: Disable this after all devices have been paired!" + }, + "external_converters": { + "type": "array", + "title": "External converters", + "items": { + "type": "string" + }, + "examples": ["DIYRuZ_FreePad.js"] + }, + "mqtt": { + "type": "object", + "title": "MQTT settings", + "properties": { + "base_topic": { + "type": "string", + "title": "Base topic", + "description": "MQTT base topic for Zigbee2MQTT MQTT messages", + "examples": ["zigbee2mqtt"] + }, + "server": { + "type": "string", + "title": "MQTT server", + "description": "MQTT server URL (use mqtts:// for SSL/TLS connection)", + "examples": ["mqtt://localhost:1883"] + }, + "keepalive": { + "type": "number", + "title": "Keepalive", + "description": "MQTT keepalive in second", + "default": 60 + }, + "ca": { + "type": "string", + "title": "Certificate authority", + "description": "Absolute path to SSL/TLS certificate of CA used to sign server and client certificates", + "examples": ["/etc/ssl/mqtt-ca.crt"] + }, + "key": { + "type": "string", + "title": "SSL/TLS key", + "description": "Absolute paths to SSL/TLS key and certificate for client-authentication", + "examples": ["/etc/ssl/mqtt-client.key"] + + }, + "cert": { + "type": "string", + "title": "SSL/TLS certificate", + "examples": ["/etc/ssl/mqtt-client.crt"] + }, + "user": { + "type": "string", + "title": "User", + "description": "MQTT server authentication user", + "examples": ["johnnysilverhand"] + }, + "password": { + "type": "string", + "title": "Password", + "description": "MQTT server authentication password", + "examples": ["ILOVEPELMENI"] + }, + "client_id": { + "type": "string", + "title": "Client ID", + "description": "MQTT client ID", + "examples": ["MY_CLIENT_ID"] + }, + "reject_unauthorized": { + "type": "boolean", + "title": "Reject unauthorized", + "description": "Disable self-signed SSL certificate", + "default": true + }, + "include_device_information": { + "type": "boolean", + "title": "Include device information", + "description": "Include device information to mqtt messages", + "default": false + }, + "version": { + "type": ["number", "null"], + "title": "Version", + "description": "MQTT protocol version", + "default": 4 + }, + "force_disable_retain": { + "type": "boolean", + "title": "Force disable retain", + "description": "Disable retain for all send messages. ONLY enable if you MQTT broker doesn't support retained message (e.g. AWS IoT core, Azure IoT Hub, Google Cloud IoT core, IBM Watson IoT Platform). Enabling will break the Home Assistant integration", + "default": false + } + }, + "required": ["base_topic", "server"] + }, + "serial": { + "type": "object", + "title": "Serial settings", + "properties": { + "port": { + "type": ["string", "null"], + "title": "Port", + "description": "Location of the adapter. To autodetect the port, set null", + "examples": ["/dev/ttyACM0"] + }, + "disable_led": { + "type": "boolean", + "title": "Disable led", + "description": "Disable LED of the adapter if supported", + "default": false + }, + "adapter": { + "type": "string", + "enum": ["deconz", "zstack", "zigate"], + "title": "Adapter", + "description": "Adapter type, not needed unless you are experiencing problems" + } + } + }, + "blocklist": { + "title": "Blocklist", + "description": "Block devices from the network (by ieeeAddr)", + "type": "array", + "items": { + "type": "string" + } + }, + "passlist": { + "title": "Passlist", + "description": "Allow only certain devices to join the network (by ieeeAddr). Note that all devices not on the passlist will be removed from the network!", + "type": "array", + "items": { + "type": "string" + } + }, + "whitelist": { + "type": "array", + "title": "Whitelist (deprecated)", + "items": { + "type": "string" + } + }, + "ban": { + "type": "array", + "title": "Ban (deprecated)", + "items": { + "type": "string" + } + }, + "experimental": { + "type": "object", + "title": "Experimental options", + "properties": { + "transmit_power": { + "type": ["number", "null"], + "title": "Transmit power" + }, + "output": { + "type": "string", + "enum": ["attribute_and_json", "attribute", "json"], + "title": "MQTT output type", + "description": "Examples when 'state' of a device is published json: topic: 'zigbee2mqtt/my_bulb' payload '{\"state\": \"ON\"}' attribute: topic 'zigbee2mqtt/my_bulb/state' payload 'ON' attribute_and_json: both json and attribute (see above)" + } + } + }, + "advanced": { + "type": "object", + "title": "Advanced settings", + "properties": { + "legacy_api": { + "type": "boolean", + "title": "Legacy API", + "description": "Disables the legacy api (false = disable)", + "default": true + }, + "pan_id": { + "type": "number", + "title": "Pan ID", + "description": "ZigBee pan ID" + }, + "ext_pan_id": { + "type": "array", + "items": { + "type": "number" + }, + "title": "Ext Pan ID", + "description": "Zigbee extended pan ID" + }, + "channel": { + "type": "number", + "minimum": 11, + "maximum": 26, + "default": 11, + "title": "ZigBee channel", + "description": "Changing requires re-pairing of all devices. (Note: use a ZLL channel: 11, 15, 20, or 25 to avoid Problems)" + }, + "cache_state": { + "type": "boolean", + "title": "Cache state", + "description": "MQTT message payload will contain all attributes, not only changed ones. Has to be true when integrating via Home Assistant", + "default": true + }, + "cache_state_persistent": { + "type": "boolean", + "title": "Chache state persistent", + "description": "Persist cached state, only used when Cache state(cache_state: true)", + "default": true + }, + "cache_state_send_on_startup": { + "type": "boolean", + "title": "Cache state send on startup", + "description": "Cache state send on startup, only used when Cache state(cache_state: true)", + "default": true + }, + "log_rotation": { + "type": "boolean", + "title": "Log rotation", + "description": "Log rotation", + "default": true + }, + "log_level": { + "type": "string", + "enum": ["info", "warn", "error", "debug"], + "title": "Log level", + "description": "Logging level", + "default": "info" + }, + "log_output": { + "type": "array", + "items": { + "type": "string", + "enum": ["console", "file", "syslog"] + }, + "title": "Log output", + "description": "Output location of the log, leave empty to supress logging" + }, + "log_directory": { + "type": "string", + "title": "Log directory", + "description": "Location of log directory", + "examples": ["data/log/%TIMESTAMP%"], + "default": "data/log/%TIMESTAMP%" + }, + "log_file": { + "type": "string", + "title": "Log file", + "description": "Log file name, can also contain timestamp", + "examples": ["zigbee2mqtt_%TIMESTAMP%.log"], + "default": "log.txt" + }, + "baudrate": { + "type": "number", + "title": "Baudrate", + "description": "Baudrate for serial port, default: 115200 for Z-Stack, 38400 for Deconz", + "examples": [38400, 115200] + }, + "rtscts": { + "type": "boolean", + "title": "RTS / CTS", + "description": "RTS / CTS Hardware Flow Control for serial port", + "default": false + }, + "soft_reset_timeout": { + "type": "number", + "minimum": 0, + "title": "Soft reset timeout (deprecated)", + "description": "Soft reset ZNP after timeout" + }, + "network_key": { + "oneOf": [{ + "type": "string", + "title": "Network key(string)" + }, + { + "type": "array", + "items": { + "type": "number" + }, + "title": "Network key(array)" + } + ], + "title": "Network key", + "description": "Network encryption key, will improve security (Note: changing requires repairing of all devices)" + }, + "last_seen": { + "type": "string", + "enum": ["disable", "ISO_8601", "ISO_8601_local", "epoch"], + "title": "Last seen", + "description": "Add a last_seen attribute to MQTT messages, contains date/time of last Zigbee message", + "default": "disable" + }, + "elapsed": { + "type": "boolean", + "title": "Elapsed", + "description": "Add an elapsed attribute to MQTT messages, contains milliseconds since the previous msg", + "default": false + }, + "availability_timeout": { + "type": "number", + "minimum": 0, + "default": 0, + "title": "Availability Timeout", + "description": "Availability timeout in seconds When enabled, devices will be checked if they are still online. Only AC powered routers are checked for availability" + }, + "availability_blocklist": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Availability Blocklist", + "description": "Prevent devices from being checked for availability" + }, + "availability_passlist": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Availability passlist", + "description": "Only enable availability check for certain devices" + }, + "availability_blacklist": { + "type": "array", + "title": "Availability blacklist (deprecated)", + "items": { + "type": "string" + } + }, + "availability_whitelist": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Availability whitelist (deprecated)" + }, + "report": { + "type": "boolean", + "title": "Reporting", + "description": "Enables report feature" + }, + "homeassistant_discovery_topic": { + "type": "string", + "title": "Homeassistant discovery topic", + "examples": ["homeassistant"], + "default": ["homeassistant"] + }, + "homeassistant_status_topic": { + "type": "string", + "title": "Home Assistant status topic", + "examples": ["homeassistant/status"], + "default": ["homeassistant/status"] + }, + "timestamp_format": { + "type": "string", + "title": "Timestamp format", + "description": "Log timestamp format", + "examples": ["YYYY-MM-DD HH:mm:ss"], + "default": ["YYYY-MM-DD HH:mm:ss"] + }, + "adapter_concurrent": { + "title": "Adapter concurrency", + "type": ["number", "null"], + "description": "Adapter concurrency (e.g. 2 for CC2531 or 16 for CC26X2R1) (default: null, uses recommended value)" + }, + "adapter_delay": { + "type": ["number", "null"], + "title": "Adapter delay" + } + } + }, + "map_options": { + "type": "object", + "title": "Networkmap options", + "properties": { + "graphviz": { + "type": "object", + "properties": { + "colors": { + "type": "object", + "properties": { + "fill": { + "type": "object", + "properties": { + "enddevice": { + "type": "string" + }, + "coordinator": { + "type": "string" + }, + "router": { + "type": "string" + } + } + }, + "font": { + "type": "object", + "properties": { + "enddevice": { + "type": "string" + }, + "coordinator": { + "type": "string" + }, + "router": { + "type": "string" + } + } + }, + "line": { + "type": "object", + "properties": { + "active": { + "type": "string" + }, + "inactive": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "devices": { + "type": "object", + "propertyNames": { + "pattern": "^0x[\\d\\w]{16}$" + }, + "patternProperties": { + "^.*$": { + "type": "object", + "properties": { + "friendly_name": { + "type": "string" + }, + "retain": { + "type": "boolean" + }, + "retention": { + "type": "number" + }, + "qos": { + "type": "number" + }, + "filtered_attributes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["friendly_name"] + } + } + }, + "groups": { + "type": "object", + "propertyNames": { + "pattern": "^[\\w].*$" + }, + "patternProperties": { + "^.*$": { + "type": "object", + "properties": { + "friendly_name": { + "type": "string" + }, + "retain": { + "type": "boolean" + }, + "devices": { + "type": "array", + "items": { + "type": "string" + } + }, + "optimistic": { + "type": "boolean" + }, + "qos": { + "type": "number" + }, + "filtered_attributes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["friendly_name"] + } + } + } + }, + "required": ["mqtt"] +} \ No newline at end of file diff --git a/package.json b/package.json index f1b03835e..17e7812c6 100644 --- a/package.json +++ b/package.json @@ -72,10 +72,10 @@ } }, "collectCoverageFrom": [ - "lib/**" + "lib/**/*.js" ] }, "bin": { - "zigbee2mqtt": "./cli.js" + "zigbee2mqtt": "cli.js" } } diff --git a/test/bridge.test.js b/test/bridge.test.js index 33e4db177..884a08f5e 100644 --- a/test/bridge.test.js +++ b/test/bridge.test.js @@ -41,7 +41,7 @@ describe('Bridge', () => { const directory = settings.get().advanced.log_directory; expect(MQTT.publish).toHaveBeenCalledWith( 'zigbee2mqtt/bridge/info', - stringify({ "commit": version.commitHash, "config": { "advanced": { "adapter_concurrent": null, "adapter_delay": null, "availability_blacklist": [], "availability_blocklist": [], "availability_passlist": [], "availability_timeout": 0, "availability_whitelist": [], "cache_state": true, "cache_state_persistent": true, "cache_state_send_on_startup": true, "channel": 11, "elapsed": false, "ext_pan_id": [221, 221, 221, 221, 221, 221, 221, 221], "homeassistant_discovery_topic": "homeassistant", "homeassistant_legacy_triggers": true, "homeassistant_status_topic": "hass/status", "last_seen": "disable", "legacy_api": false, "log_directory": directory, "log_file": "log.txt", "log_level": "info", "log_output": ["console", "file"], "log_rotation": true, "log_syslog": {}, "pan_id": 6754, "report": false, "soft_reset_timeout": 0, "timestamp_format": "YYYY-MM-DD HH:mm:ss" }, "ban": [], "blocklist": [], "device_options": {}, "devices": { "0x000b57fffec6a5b2": { "friendly_name": "bulb", "retain": true }, "0x000b57fffec6a5b3": { "friendly_name": "bulb_color", "retain": false }, "0x000b57fffec6a5b4": { "friendly_name": "bulb_color_2", "retain": false }, "0x000b57fffec6a5b7": { "friendly_name": "bulb_2", "retain": false }, "0x0017880104a44559": { "friendly_name": "J1_cover" }, "0x0017880104e43559": { "friendly_name": "U202DST600ZB" }, "0x0017880104e44559": { "friendly_name": "3157100_thermostat" }, "0x0017880104e45517": { "friendly_name": "remote", "retain": true }, "0x0017880104e45518": { "friendly_name": "0x0017880104e45518" }, "0x0017880104e45520": { "friendly_name": "button", "retain": false }, "0x0017880104e45521": { "friendly_name": "button_double_key", "retain": false }, "0x0017880104e45522": { "friendly_name": "weather_sensor", "qos": 1, "retain": false }, "0x0017880104e45523": { "friendly_name": "occupancy_sensor", "retain": false }, "0x0017880104e45524": { "friendly_name": "power_plug", "retain": false }, "0x0017880104e45526": { "friendly_name": "GL-S-007ZS" }, "0x0017880104e45529": { "friendly_name": "unsupported2", "retain": false }, "0x0017880104e45530": { "friendly_name": "button_double_key_interviewing", "retain": false }, "0x0017880104e45540": { "friendly_name": "ikea_onoff" }, "0x0017880104e45541": { "friendly_name": "wall_switch", "retain": false }, "0x0017880104e45542": { "friendly_name": "wall_switch_double", "retain": false }, "0x0017880104e45543": { "friendly_name": "led_controller_1", "retain": false }, "0x0017880104e45544": { "friendly_name": "led_controller_2", "retain": false }, "0x0017880104e45545": { "friendly_name": "dimmer_wall_switch", "retain": false }, "0x0017880104e45547": { "friendly_name": "curtain", "retain": false }, "0x0017880104e45548": { "friendly_name": "fan", "retain": false }, "0x0017880104e45549": { "friendly_name": "siren", "retain": false }, "0x0017880104e45550": { "friendly_name": "thermostat", "retain": false }, "0x0017880104e45551": { "friendly_name": "smart vent", "retain": false }, "0x0017880104e45552": { "friendly_name": "j1", "retain": false }, "0x0017880104e45553": { "friendly_name": "bulb_enddevice", "retain": false }, "0x0017880104e45559": { "friendly_name": "cc2530_router", "retain": false }, "0x0017880104e45560": { "friendly_name": "livolo", "retain": false }, "0x0017882104a44559": { "friendly_name": "TS0601_thermostat" }, "0x0017882194e45543": { "friendly_name": "QS-Zigbee-D02-TRIAC-2C-LN" }, "0x90fd9ffffe4b64aa": { "friendly_name": "SP600_OLD" }, "0x90fd9ffffe4b64ab": { "friendly_name": "SP600_NEW" }, "0x90fd9ffffe4b64ac": { "friendly_name": "MKS-CM-W5" }, "0x90fd9ffffe4b64ae": { "friendly_name": "tradfri_remote", "retain": false }, "0x90fd9ffffe4b64af": { "friendly_name": "roller_shutter" }, "0x90fd9ffffe4b64ax": { "friendly_name": "ZNLDP12LM" } }, "experimental": { "output": "json" }, "external_converters": [], "groups": { "1": { "friendly_name": "group_1", "retain": false }, "11": { "devices": ["bulb_2"], "friendly_name": "group_with_tradfri", "retain": false }, "14": { "devices": ["power_plug"], "friendly_name": "switch_group", "retain": false }, "12": { "devices": ["TS0601_thermostat"], "friendly_name": "thermostat_group", "retain": false }, "15071": { "devices": ["bulb_color_2", "bulb_2"], "friendly_name": "group_tradfri_remote", "retain": false }, "2": { "friendly_name": "group_2", "retain": false } }, "homeassistant": false, "map_options": { "graphviz": { "colors": { "fill": { "coordinator": "#e04e5d", "enddevice": "#fff8ce", "router": "#4ea3e0" }, "font": { "coordinator": "#ffffff", "enddevice": "#000000", "router": "#ffffff" }, "line": { "active": "#009900", "inactive": "#994444" } } } }, "mqtt": { "base_topic": "zigbee2mqtt", "include_device_information": false, "server": "mqtt://localhost", "force_disable_retain": false, }, "passlist": [], "permit_join": true, "serial": { "disable_led": false, "port": "/dev/dummy" }, "whitelist": [] }, "coordinator": { "meta": { "revision": 20190425, "version": 1 }, "type": "z-Stack" }, "log_level": "info", "network": { "channel": 15, "extended_pan_id": [0, 11, 22], "pan_id": 5674 }, "permit_join": false, "version": version.version }), + stringify({ "commit": version.commitHash, "config": { "advanced": { "adapter_concurrent": null, "adapter_delay": null, "availability_blacklist": [], "availability_blocklist": [], "availability_passlist": [], "availability_timeout": 0, "availability_whitelist": [], "cache_state": true, "cache_state_persistent": true, "cache_state_send_on_startup": true, "channel": 11, "elapsed": false, "ext_pan_id": [221, 221, 221, 221, 221, 221, 221, 221], "homeassistant_discovery_topic": "homeassistant", "homeassistant_legacy_triggers": true, "homeassistant_status_topic": "hass/status", "last_seen": "disable", "legacy_api": false, "log_directory": directory, "log_file": "log.txt", "log_level": "info", "log_output": ["console", "file"], "log_rotation": true, "log_syslog": {}, "pan_id": 6754, "report": false, "soft_reset_timeout": 0, "timestamp_format": "YYYY-MM-DD HH:mm:ss" }, "ban": [], "blocklist": [], "device_options": {}, "devices": { "0x000b57fffec6a5b2": { "friendly_name": "bulb", "retain": true }, "0x000b57fffec6a5b3": { "friendly_name": "bulb_color", "retain": false }, "0x000b57fffec6a5b4": { "friendly_name": "bulb_color_2", "retain": false }, "0x000b57fffec6a5b7": { "friendly_name": "bulb_2", "retain": false }, "0x0017880104a44559": { "friendly_name": "J1_cover" }, "0x0017880104e43559": { "friendly_name": "U202DST600ZB" }, "0x0017880104e44559": { "friendly_name": "3157100_thermostat" }, "0x0017880104e45517": { "friendly_name": "remote", "retain": true }, "0x0017880104e45518": { "friendly_name": "0x0017880104e45518" }, "0x0017880104e45520": { "friendly_name": "button", "retain": false }, "0x0017880104e45521": { "friendly_name": "button_double_key", "retain": false }, "0x0017880104e45522": { "friendly_name": "weather_sensor", "qos": 1, "retain": false }, "0x0017880104e45523": { "friendly_name": "occupancy_sensor", "retain": false }, "0x0017880104e45524": { "friendly_name": "power_plug", "retain": false }, "0x0017880104e45526": { "friendly_name": "GL-S-007ZS" }, "0x0017880104e45529": { "friendly_name": "unsupported2", "retain": false }, "0x0017880104e45530": { "friendly_name": "button_double_key_interviewing", "retain": false }, "0x0017880104e45540": { "friendly_name": "ikea_onoff" }, "0x0017880104e45541": { "friendly_name": "wall_switch", "retain": false }, "0x0017880104e45542": { "friendly_name": "wall_switch_double", "retain": false }, "0x0017880104e45543": { "friendly_name": "led_controller_1", "retain": false }, "0x0017880104e45544": { "friendly_name": "led_controller_2", "retain": false }, "0x0017880104e45545": { "friendly_name": "dimmer_wall_switch", "retain": false }, "0x0017880104e45547": { "friendly_name": "curtain", "retain": false }, "0x0017880104e45548": { "friendly_name": "fan", "retain": false }, "0x0017880104e45549": { "friendly_name": "siren", "retain": false }, "0x0017880104e45550": { "friendly_name": "thermostat", "retain": false }, "0x0017880104e45551": { "friendly_name": "smart vent", "retain": false }, "0x0017880104e45552": { "friendly_name": "j1", "retain": false }, "0x0017880104e45553": { "friendly_name": "bulb_enddevice", "retain": false }, "0x0017880104e45559": { "friendly_name": "cc2530_router", "retain": false }, "0x0017880104e45560": { "friendly_name": "livolo", "retain": false }, "0x0017882104a44559": { "friendly_name": "TS0601_thermostat" }, "0x0017882194e45543": { "friendly_name": "QS-Zigbee-D02-TRIAC-2C-LN" }, "0x90fd9ffffe4b64aa": { "friendly_name": "SP600_OLD" }, "0x90fd9ffffe4b64ab": { "friendly_name": "SP600_NEW" }, "0x90fd9ffffe4b64ac": { "friendly_name": "MKS-CM-W5" }, "0x90fd9ffffe4b64ae": { "friendly_name": "tradfri_remote", "retain": false }, "0x90fd9ffffe4b64af": { "friendly_name": "roller_shutter" }, "0x90fd9ffffe4b64ax": { "friendly_name": "ZNLDP12LM" } }, "experimental": { "output": "json" }, "external_converters": [], "groups": { "1": { "friendly_name": "group_1", "retain": false }, "11": { "devices": ["bulb_2"], "friendly_name": "group_with_tradfri", "retain": false }, "14": { "devices": ["power_plug"], "friendly_name": "switch_group", "retain": false }, "12": { "devices": ["TS0601_thermostat"], "friendly_name": "thermostat_group", "retain": false }, "15071": { "devices": ["bulb_color_2", "bulb_2"], "friendly_name": "group_tradfri_remote", "retain": false }, "2": { "friendly_name": "group_2", "retain": false } }, "homeassistant": false, "map_options": { "graphviz": { "colors": { "fill": { "coordinator": "#e04e5d", "enddevice": "#fff8ce", "router": "#4ea3e0" }, "font": { "coordinator": "#ffffff", "enddevice": "#000000", "router": "#ffffff" }, "line": { "active": "#009900", "inactive": "#994444" } } } }, "mqtt": { "base_topic": "zigbee2mqtt", "include_device_information": false, "server": "mqtt://localhost", "force_disable_retain": false, }, "passlist": [], "permit_join": true, "serial": { "disable_led": false, "port": "/dev/dummy" }, "whitelist": [] }, "coordinator": { "meta": { "revision": 20190425, "version": 1 }, "type": "z-Stack" }, "log_level": "info", "network": { "channel": 15, "extended_pan_id": [0, 11, 22], "pan_id": 5674 }, "permit_join": false, "version": version.version, config_schema: settings.schema }), { retain: true, qos: 0 }, expect.any(Function) );