diff --git a/lib/extension/homeassistant.js b/lib/extension/homeassistant.js index c319966b..c6b82993 100644 --- a/lib/extension/homeassistant.js +++ b/lib/extension/homeassistant.js @@ -311,6 +311,15 @@ const cfg = { value_template: '{{ value_json.temperature }}', }, }, + 'sensor_soil_moisture': { + type: 'sensor', + object_id: 'soil_moisture', + discovery_payload: { + unit_of_measurement: '%', + icon: 'mdi:water-percent', + value_template: '{{ value_json.soil_moisture }}', + }, + }, 'sensor_device_temperature': { type: 'sensor', object_id: 'device_temperature', @@ -1434,6 +1443,11 @@ const manualMaping = { 'ZG2835': [cfg.sensor_action], 'CTR.UBX': [cfg.sensor_action], '4655BC0-R': [cfg.binary_sensor_contact, cfg.binary_sensor_battery_low], + 'STSS-IRM-001': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low], + 'DIYRuZ_Flower': [ + cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_illuminance, cfg.sensor_pressure, + cfg.sensor_battery, cfg.sensor_soil_moisture, + ], }; const defaultStatusTopic = 'homeassistant/status'; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 1f70c0fa..d0567098 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -15837,9 +15837,9 @@ } }, "zigbee-herdsman-converters": { - "version": "12.0.197", - "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-12.0.197.tgz", - "integrity": "sha512-Pjnrg2e0/tHYrryE2EPm+ZDL8IF/j7T6eCvHAgOzNuMoBqXweC86HUY3sb9LtKuXl5zZEHspFAQbh42YCo8jWg==", + "version": "12.0.198", + "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-12.0.198.tgz", + "integrity": "sha512-5ezoCfnJ0vVWukQvBrlk1zzj89bzMIIYq2iVULxKXQVFo1BiREcXPaoBgDJATpPo8VmxKQKIWvUFUwbOYLFybg==", "requires": { "axios": "^0.20.0", "https-proxy-agent": "^5.0.0", diff --git a/package.json b/package.json index 3a0006e1..5c00f210 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "winston-syslog": "^2.4.4", "ws": "^7.3.1", "zigbee-herdsman": "0.13.12", - "zigbee-herdsman-converters": "12.0.197", + "zigbee-herdsman-converters": "12.0.198", "zigbee2mqtt-frontend": "0.2.21" }, "devDependencies": { diff --git a/test/publish.test.js b/test/publish.test.js index c49c8378..5504796c 100644 --- a/test/publish.test.js +++ b/test/publish.test.js @@ -282,10 +282,10 @@ describe('Publish', () => { await MQTT.events.message('zigbee2mqtt/bulb_color/set', stringify({color: {r: 100, g: 200, b: 10}})); await flushPromises(); expect(endpoint.command).toHaveBeenCalledTimes(1); - expect(endpoint.command).toHaveBeenCalledWith("lightingColorCtrl", "moveToColor", {colorx: 16764, colory: 40979, transtime: 0}, {}); + expect(endpoint.command).toHaveBeenCalledWith("lightingColorCtrl", "moveToColor", {colorx: 17721, colory: 43148, transtime: 0}, {}); expect(MQTT.publish).toHaveBeenCalledTimes(1); expect(MQTT.publish.mock.calls[0][0]).toStrictEqual('zigbee2mqtt/bulb_color'); - expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({color_temp: 162, color: {x: 0.2558, y: 0.6253}}); + expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({color_temp: 157, color: {x: 0.2704, y: 0.6584}}); }); it('Should publish messages to zigbee devices with color rgb', async () => { @@ -294,10 +294,10 @@ describe('Publish', () => { await MQTT.events.message('zigbee2mqtt/bulb_color/set', stringify({color: {rgb: '100,200,10'}})); await flushPromises(); expect(endpoint.command).toHaveBeenCalledTimes(1); - expect(endpoint.command).toHaveBeenCalledWith("lightingColorCtrl", "moveToColor", {colorx: 16764, colory: 40979, transtime: 0}, {}); + expect(endpoint.command).toHaveBeenCalledWith("lightingColorCtrl", "moveToColor", {colorx: 17721, colory: 43148, transtime: 0}, {}); expect(MQTT.publish).toHaveBeenCalledTimes(1); expect(MQTT.publish.mock.calls[0][0]).toStrictEqual('zigbee2mqtt/bulb_color'); - expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({color_temp: 162, color: {x: 0.2558, y: 0.6253}}); + expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({color_temp: 157, color: {x: 0.2704, y: 0.6584}}); }); it('Should publish messages to zigbee devices with color rgb', async () => { @@ -524,10 +524,10 @@ describe('Publish', () => { await MQTT.events.message('zigbee2mqtt/bulb_color/set/color', '#64C80A'); await flushPromises(); expect(endpoint.command).toHaveBeenCalledTimes(1); - expect(endpoint.command).toHaveBeenCalledWith("lightingColorCtrl", "moveToColor", {colorx: 16764, colory: 40979, transtime: 0}, {}); + expect(endpoint.command).toHaveBeenCalledWith("lightingColorCtrl", "moveToColor", {colorx: 17721, colory: 43148, transtime: 0}, {}); expect(MQTT.publish).toHaveBeenCalledTimes(1); expect(MQTT.publish.mock.calls[0][0]).toStrictEqual('zigbee2mqtt/bulb_color'); - expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({color_temp: 162, color: {x: 0.2558, y: 0.6253}}); + expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({color_temp: 157, color: {x: 0.2704, y: 0.6584}}); }); it('Should parse set with ieeeAddr topic', async () => {