From 4ee34fd637e85528b06f1b513221066cb1dfec75 Mon Sep 17 00:00:00 2001 From: Jevgeni Kiski Date: Wed, 8 Jan 2020 18:57:40 +0200 Subject: [PATCH] LLKZMK11LM Supports power, temperature and consumption (#2657) * LLKZMK11LM Supports power, temperature and consumption LLKZMK11LM already sends power, temperature and consumption in mqtt json. ``` info 2020-01-02 20:06:20: MQTT publish: topic 'zigbee2mqtt/front_outdoor_lights', payload '{"state_l1":"ON","linkquality":54,"state_l2":"OFF","power":35.1,"consumption":2.89,"temperature":33}' ``` Not sure in which units `consumption` is. Not adding right now. * LLKZMK11LM power consumption * Linter * mdi-flash --- lib/extension/homeassistant.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/extension/homeassistant.js b/lib/extension/homeassistant.js index 7a5c7f118..eeb2f34e2 100644 --- a/lib/extension/homeassistant.js +++ b/lib/extension/homeassistant.js @@ -273,6 +273,15 @@ const cfg = { icon: 'mdi:view-array', }, }, + 'sensor_consumption': { + type: 'sensor', + object_id: 'consumption', + discovery_payload: { + unit_of_measurement: 'kWh', + value_template: '{{ value_json.consumption }}', + icon: 'mdi:flash', + }, + }, 'sensor_sensitivity': { type: 'sensor', object_id: 'sensitivity', @@ -815,7 +824,10 @@ const mapping = { 'BY 285 C': [cfg.light_brightness_colortemp_colorxy], 'HS1RC-M': [cfg.sensor_action, cfg.sensor_battery], 'SWO-WDS1PA': [cfg.binary_sensor_contact], - 'LLKZMK11LM': [switchWithPostfix('l1'), switchWithPostfix('l2')], + 'LLKZMK11LM': [ + switchWithPostfix('l1'), switchWithPostfix('l2'), + cfg.sensor_power, cfg.sensor_temperature, cfg.sensor_consumption, + ], 'LVS-SM10ZW': [cfg.binary_sensor_contact, cfg.binary_sensor_battery_low], 'HS2SK': [cfg.switch, cfg.sensor_power], '45853GE': [cfg.switch, cfg.sensor_power],