diff --git a/docs/integrating-with-homeassistant.md b/docs/integrating-with-homeassistant.md index d5b8fafd..68ec4fe6 100644 --- a/docs/integrating-with-homeassistant.md +++ b/docs/integrating-with-homeassistant.md @@ -1426,6 +1426,8 @@ light: command_topic: "zigbee2mqtt//set" ``` +### AC01353010G +```yaml ### HALIGHTDIMWWE27 ```yaml light: @@ -1976,6 +1978,42 @@ switch: command_topic: "zigbee2mqtt//set" ``` +### 3326-L +```yaml +binary_sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.occupancy }}" + device_class: "motion" + +sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + unit_of_measurement: "°C" + device_class: "temperature" + value_template: "{{ value_json.temperature }}" + json_attributes: + - "linkquality" + - "battery" + - "voltage" +``` + +### 3320-L +```yaml +binary_sensor: + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: false + payload_off: true + value_template: "{{ value_json.contact }}" + device_class: "door" +``` + ### KS-SM001 ```yaml switch: diff --git a/docs/supported-devices.md b/docs/supported-devices.md index ff4cb9e5..61e38401 100644 --- a/docs/supported-devices.md +++ b/docs/supported-devices.md @@ -1,6 +1,6 @@ *NOTE: This file has been generated, do not edit this file manually!* -Currently **134** devices are supported from **29** different vendors. +Currently **137** devices are supported from **29** different vendors. In case you own a Zigbee device which is **NOT** listed here, please see [How to support new devices](https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices). @@ -130,6 +130,8 @@ In case you own a Zigbee device which is **NOT** listed here, please see | Model | Description | Picture | | ------------- | ------------- | -------------------------- | | 3210-L | Iris Smart plug (on/off) | ![https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/3210-L.jpg](https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/3210-L.jpg) | +| 3326-L | Iris Motion sensor (occupancy and temperature) | ![https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/3326-L.jpg](https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/3326-L.jpg) | +| 3320-L | Iris Contact sensor (contact) | ![https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/3320-L.jpg](https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/3320-L.jpg) | ### JIAWEN @@ -183,6 +185,7 @@ In case you own a Zigbee device which is **NOT** listed here, please see | 4058075036147 | OSRAM Smart+ Gardenpole RGBW (on/off, brightness, color temperature, color xy) | ![https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/4058075036147.jpg](https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/4058075036147.jpg) | | AB35996 | OSRAM Smart+ Spot GU10 Multicolor (on/off, brightness, color temperature, color xy) | ![https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/AB35996.jpg](https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/AB35996.jpg) | | AC08562 | OSRAM SMART+ Candle E14 Dimmable White (on/off, brightness) | ![https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/AC08562.jpg](https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/AC08562.jpg) | +| AC01353010G | OSRAM SMART+ Motion Sensor (occupancy and temperature) | ![https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/AC01353010G.jpg](https://github.com/Koenkk/zigbee2mqtt/raw/dev/images/devices/AC01353010G.jpg) | ### Paulmann diff --git a/images/devices/3320-L.jpg b/images/devices/3320-L.jpg new file mode 100644 index 00000000..7b6e0849 Binary files /dev/null and b/images/devices/3320-L.jpg differ diff --git a/images/devices/3326-L.jpg b/images/devices/3326-L.jpg new file mode 100644 index 00000000..955c1fa9 Binary files /dev/null and b/images/devices/3326-L.jpg differ diff --git a/images/devices/AC01353010G.jpg b/images/devices/AC01353010G.jpg new file mode 100644 index 00000000..2b51e4e1 Binary files /dev/null and b/images/devices/AC01353010G.jpg differ diff --git a/lib/extension/devicePublish.js b/lib/extension/devicePublish.js index 2907c1cf..30c19614 100644 --- a/lib/extension/devicePublish.js +++ b/lib/extension/devicePublish.js @@ -115,14 +115,14 @@ class DevicePublish { // For each key in the JSON message find the matching converter. Object.keys(json).forEach((key) => { - const converter = model.toZigbee.find((c) => c.key === key); + const converter = model.toZigbee.find((c) => c.key.includes(key)); if (!converter) { logger.error(`No converter available for '${key}' (${json[key]})`); return; } // Converter didn't return a result, skip - const converted = converter.convert(json[key], json, topic.type); + const converted = converter.convert(key, json[key], json, topic.type); if (!converted) { return; } diff --git a/lib/extension/homeassistant.js b/lib/extension/homeassistant.js index 813d7ec2..faab5d6a 100644 --- a/lib/extension/homeassistant.js +++ b/lib/extension/homeassistant.js @@ -403,6 +403,7 @@ const mapping = { 'PSS-23ZBS': [configurations.switch], 'HS1SA': [configurations.binary_sensor_smoke], 'Z01-A19NAE26': [configurations.light_brightness_colortemp], + 'AC01353010G': [configurations.binary_sensor_occupancy, configurations.sensor_temperature], }; /** diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0e4d85d8..bf586f50 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -14,12 +14,12 @@ } }, "@babel/generator": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.1.6.tgz", - "integrity": "sha512-brwPBtVvdYdGxtenbQgfCdDPmtkmUBZPjUoK5SXJEBuHaA5BCubh9ly65fzXz7R6o5rA76Rs22ES8Z+HCc0YIQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.2.0.tgz", + "integrity": "sha512-BA75MVfRlFQG2EZgFYIwyT1r6xSkwfP2bdkY/kLZusEYWiJs4xCowab/alaEaT0wSvmVuXGqiefeBlP+7V1yKg==", "dev": true, "requires": { - "@babel/types": "^7.1.6", + "@babel/types": "^7.2.0", "jsesc": "^2.5.1", "lodash": "^4.17.10", "source-map": "^0.5.0", @@ -67,9 +67,9 @@ } }, "@babel/parser": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.1.6.tgz", - "integrity": "sha512-dWP6LJm9nKT6ALaa+bnL247GHHMWir3vSlZ2+IHgHgktZQx0L3Uvq2uAWcuzIe+fujRsYWBW2q622C5UvGK9iQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.2.0.tgz", + "integrity": "sha512-M74+GvK4hn1eejD9lZ7967qAwvqTZayQa3g10ag4s9uewgR7TKjeaT0YMyoq+gVfKYABiWZ4MQD701/t5e1Jhg==", "dev": true }, "@babel/template": { @@ -118,9 +118,9 @@ } }, "@babel/types": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.1.6.tgz", - "integrity": "sha512-DMiUzlY9DSjVsOylJssxLHSgj6tWM9PRFJOGW/RaOglVOK9nzTxoOMfTfRQXGUCUQ/HmlG2efwC+XqUEJ5ay4w==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.2.0.tgz", + "integrity": "sha512-b4v7dyfApuKDvmPb+O488UlGuR1WbwMXFsO/cyqMrnfvRAChZKJAYeeglWTjUO1b9UghKKgepAQM5tsvBJca6A==", "dev": true, "requires": { "esutils": "^2.0.2", @@ -1887,7 +1887,7 @@ }, "json2yaml": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/json2yaml/-/json2yaml-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/json2yaml/-/json2yaml-1.1.0.tgz", "integrity": "sha1-VBTZB/mBZYa4DFE+wuOusquBmmw=", "requires": { "remedial": "1.x" @@ -3650,9 +3650,9 @@ "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, "progress": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", - "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, "promirepl": { @@ -4621,7 +4621,7 @@ }, "underscore": { "version": "1.4.4", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", + "resolved": "http://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", "integrity": "sha1-YaajIBBiKvoHljvzJSA88SI51gQ=" }, "unique-stream": { @@ -4821,9 +4821,9 @@ } }, "zigbee-shepherd-converters": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/zigbee-shepherd-converters/-/zigbee-shepherd-converters-6.0.7.tgz", - "integrity": "sha512-/LudDhZMQHG1XByAIX+y/BtJI/W2C02cnTMmqm0Sq8Oy3swQnVuy1ETdwMEqGINWbWhcLmKXne0PN1ywnzELxw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/zigbee-shepherd-converters/-/zigbee-shepherd-converters-7.0.1.tgz", + "integrity": "sha512-VQfwtzfIrwzYbuU1oSpsBpx6bp6qshSPZO+Z9jTIGYu/xzjMStv93JeMk2n26cQvrhmh2fx8NH9+D+dFVaxqzA==", "requires": { "debounce": "*", "debug": "3.2.6", diff --git a/package.json b/package.json index 0b81d3a1..d6608a46 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "rimraf": "*", "winston": "2.4.2", "zigbee-shepherd": "git+https://github.com/Koenkk/zigbee-shepherd.git#ce52ac4131e2a505af6197b4a26d2b5360e4eb80", - "zigbee-shepherd-converters": "6.0.7", + "zigbee-shepherd-converters": "7.0.1", "ziee": "*", "zive": "*" }, diff --git a/test/devicePublish.test.js b/test/devicePublish.test.js index 80713169..7549844c 100644 --- a/test/devicePublish.test.js +++ b/test/devicePublish.test.js @@ -53,7 +53,7 @@ describe('DevicePublish', () => { it('Should publish messages to zigbee devices when brightness is in %', () => { zigbee.publish.resetHistory(); zigbee.getDevice = sinon.fake.returns({modelId: 'TRADFRI bulb E27 CWS opal 600lm'}); - devicePublish.onMQTTMessage('zigbee2mqtt/0x12345678/set', JSON.stringify({brightness: '92%'})); + devicePublish.onMQTTMessage('zigbee2mqtt/0x12345678/set', JSON.stringify({brightness_percent: '92'})); chai.assert.isTrue(zigbee.publish.calledOnce); chai.assert.strictEqual(zigbee.publish.getCall(0).args[0], '0x12345678'); chai.assert.strictEqual(zigbee.publish.getCall(0).args[1], 'genLevelCtrl'); @@ -95,7 +95,7 @@ describe('DevicePublish', () => { it('Should publish messages to zigbee devices with color_temp in %', () => { zigbee.publish.resetHistory(); zigbee.getDevice = sinon.fake.returns({modelId: 'TRADFRI bulb E27 CWS opal 600lm'}); - devicePublish.onMQTTMessage('zigbee2mqtt/0x12345678/set', JSON.stringify({color_temp: '100%'})); + devicePublish.onMQTTMessage('zigbee2mqtt/0x12345678/set', JSON.stringify({color_temp_percent: '100'})); chai.assert.isTrue(zigbee.publish.calledOnce); chai.assert.strictEqual(zigbee.publish.getCall(0).args[0], '0x12345678'); chai.assert.strictEqual(zigbee.publish.getCall(0).args[1], 'lightingColorCtrl');