From a428cd59211ccd7c9c31f8c1d4907a299f388afb Mon Sep 17 00:00:00 2001 From: William Deren Date: Mon, 29 Jan 2024 13:18:19 +0100 Subject: [PATCH] Zigbee2mqtt: Add philips hue dimmer switch 324131092621 (#2009) --- front/src/config/i18n/de.json | 10 +++++++++- front/src/config/i18n/en.json | 10 +++++++++- front/src/config/i18n/fr.json | 10 +++++++++- server/services/zigbee2mqtt/exposes/enumType.js | 9 +++++++++ server/services/zigbee2mqtt/exposes/numericType.js | 7 +++++++ server/utils/constants.js | 8 ++++++++ 6 files changed, 51 insertions(+), 3 deletions(-) diff --git a/front/src/config/i18n/de.json b/front/src/config/i18n/de.json index 4b155d1ae3..dc480bc390 100644 --- a/front/src/config/i18n/de.json +++ b/front/src/config/i18n/de.json @@ -2546,7 +2546,15 @@ "35": "Notfall", "36": "Alarm ausschalten", "37": "Alarm für Tageszonen scharf schalten", - "38": "Alarm für alle Zonen scharf schalten" + "38": "Alarm für alle Zonen scharf schalten", + "39": "An-Taste gedrückt", + "40": "An-Taste gehalten", + "41": "Auf-Taste gedrückt", + "42": "Auf-Taste gehalten", + "43": "Ab-Taste gedrückt", + "44": "Ab-Taste gehalten", + "45": "Aus-Taste gedrückt", + "46": "Aus-Taste gehalten" } }, "opening-sensor": { diff --git a/front/src/config/i18n/en.json b/front/src/config/i18n/en.json index 96c4e35a22..0bb80bc914 100644 --- a/front/src/config/i18n/en.json +++ b/front/src/config/i18n/en.json @@ -2548,7 +2548,15 @@ "35": "Emergency", "36": "Disarm", "37": "Arm day zones", - "38": "Arm all zones" + "38": "Arm all zones", + "39": "On press", + "40": "On hold", + "41": "Up press", + "42": "Up hold", + "43": "Down press", + "44": "Down hold", + "45": "Off press", + "46": "Off hold" } }, "opening-sensor": { diff --git a/front/src/config/i18n/fr.json b/front/src/config/i18n/fr.json index d38a0cc868..245dd65df4 100644 --- a/front/src/config/i18n/fr.json +++ b/front/src/config/i18n/fr.json @@ -2550,7 +2550,15 @@ "35": "Urgence", "36": "Désarmer alarme", "37": "Armer zones jour", - "38": "Armer alarme" + "38": "Armer alarme", + "39": "Bouton On pressé", + "40": "Bouton On maintenu", + "41": "Bouton Plus pressé", + "42": "Bouton Plus maintenu", + "43": "Bouton Moins pressé", + "44": "Bouton Moins maintenu", + "45": "Bouton Off pressé", + "46": "Bouton Off maintenu" } }, "opening-sensor": { diff --git a/server/services/zigbee2mqtt/exposes/enumType.js b/server/services/zigbee2mqtt/exposes/enumType.js index 67456a4d0a..b4b107dcb5 100644 --- a/server/services/zigbee2mqtt/exposes/enumType.js +++ b/server/services/zigbee2mqtt/exposes/enumType.js @@ -61,6 +61,15 @@ addMapping('action', BUTTON_STATUS.DISARM, 'disarm'); addMapping('action', BUTTON_STATUS.ARM_DAY_ZONES, 'arm_day_zones'); addMapping('action', BUTTON_STATUS.ARM_ALL_ZONES, 'arm_all_zones'); +addMapping('action', BUTTON_STATUS.ON_PRESS, 'on-press'); +addMapping('action', BUTTON_STATUS.ON_HOLD, 'on-hold'); +addMapping('action', BUTTON_STATUS.UP_PRESS, 'up-press'); +addMapping('action', BUTTON_STATUS.UP_HOLD, 'up-hold'); +addMapping('action', BUTTON_STATUS.DOWN_PRESS, 'down-press'); +addMapping('action', BUTTON_STATUS.DOWN_HOLD, 'down-hold'); +addMapping('action', BUTTON_STATUS.OFF_PRESS, 'off-press'); +addMapping('action', BUTTON_STATUS.OFF_HOLD, 'off-hold'); + addMapping('state', COVER_STATE.OPEN, 'OPEN'); addMapping('state', COVER_STATE.CLOSE, 'CLOSE'); addMapping('state', COVER_STATE.STOP, 'STOP'); diff --git a/server/services/zigbee2mqtt/exposes/numericType.js b/server/services/zigbee2mqtt/exposes/numericType.js index 72dbc595fa..cdc9affaad 100644 --- a/server/services/zigbee2mqtt/exposes/numericType.js +++ b/server/services/zigbee2mqtt/exposes/numericType.js @@ -17,6 +17,13 @@ module.exports = { max: 10000, }, names: { + duration: { + feature: { + category: DEVICE_FEATURE_CATEGORIES.DURATION, + type: DEVICE_FEATURE_TYPES.DURATION.DECIMAL, + unit: DEVICE_FEATURE_UNITS.SECONDS, + }, + }, battery: { feature: { category: DEVICE_FEATURE_CATEGORIES.BATTERY, diff --git a/server/utils/constants.js b/server/utils/constants.js index 83058877b6..f61b9cea24 100644 --- a/server/utils/constants.js +++ b/server/utils/constants.js @@ -42,6 +42,14 @@ const BUTTON_STATUS = { DISARM: 36, ARM_DAY_ZONES: 37, ARM_ALL_ZONES: 38, + ON_PRESS: 39, + ON_HOLD: 40, + UP_PRESS: 41, + UP_HOLD: 42, + DOWN_PRESS: 43, + DOWN_HOLD: 44, + OFF_PRESS: 45, + OFF_HOLD: 46, }; const COVER_STATE = {