node-red-contrib-knx-ultimate 4.1.7 → 4.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/nodes/commonFunctions.js +37 -0
- package/nodes/hue-config.js +32 -1
- package/nodes/knxUltimateHueAreaMotion.html +600 -0
- package/nodes/knxUltimateHueAreaMotion.js +212 -0
- package/nodes/knxUltimateLogger.html +42 -16
- package/nodes/locales/de/common.json +1 -2
- package/nodes/locales/de/hue-config.html +3 -2
- package/nodes/locales/de/knxUltimate-config.html +35 -35
- package/nodes/locales/de/knxUltimate-config.json +17 -17
- package/nodes/locales/de/knxUltimate.html +28 -28
- package/nodes/locales/de/knxUltimateAlerter.html +3 -3
- package/nodes/locales/de/knxUltimateGlobalContext.html +11 -11
- package/nodes/locales/de/knxUltimateHueAreaMotion.html +36 -0
- package/nodes/locales/de/knxUltimateHueAreaMotion.json +31 -0
- package/nodes/locales/de/knxUltimateHueBattery.html +3 -3
- package/nodes/locales/de/knxUltimateHueBattery.json +1 -1
- package/nodes/locales/de/knxUltimateHueButton.html +1 -1
- package/nodes/locales/de/knxUltimateHueButton.json +1 -1
- package/nodes/locales/de/knxUltimateHueCameraMotion.html +3 -3
- package/nodes/locales/de/knxUltimateHueCameraMotion.json +1 -1
- package/nodes/locales/de/knxUltimateHueContactSensor.html +5 -5
- package/nodes/locales/de/knxUltimateHueContactSensor.json +1 -1
- package/nodes/locales/de/knxUltimateHueHumiditySensor.html +1 -1
- package/nodes/locales/de/knxUltimateHueHumiditySensor.json +1 -1
- package/nodes/locales/de/knxUltimateHueLight.html +27 -27
- package/nodes/locales/de/knxUltimateHueLight.json +1 -1
- package/nodes/locales/de/knxUltimateHueLightSensor.html +8 -8
- package/nodes/locales/de/knxUltimateHueLightSensor.json +1 -1
- package/nodes/locales/de/knxUltimateHueMotion.html +3 -3
- package/nodes/locales/de/knxUltimateHueMotion.json +1 -1
- package/nodes/locales/de/knxUltimateHuePlug.html +2 -2
- package/nodes/locales/de/knxUltimateHuePlug.json +1 -1
- package/nodes/locales/de/knxUltimateHueScene.html +3 -3
- package/nodes/locales/de/knxUltimateHueScene.json +1 -1
- package/nodes/locales/de/knxUltimateHueTapDial.html +2 -2
- package/nodes/locales/de/knxUltimateHueTapDial.json +1 -1
- package/nodes/locales/de/knxUltimateHueTemperatureSensor.html +7 -7
- package/nodes/locales/de/knxUltimateHueTemperatureSensor.json +1 -1
- package/nodes/locales/de/knxUltimateHueZigbeeConnectivity.html +6 -6
- package/nodes/locales/de/knxUltimateHueZigbeeConnectivity.json +1 -1
- package/nodes/locales/de/knxUltimateHuedevice_software_update.html +6 -6
- package/nodes/locales/de/knxUltimateHuedevice_software_update.json +1 -1
- package/nodes/locales/de/knxUltimateLoadControl.html +9 -9
- package/nodes/locales/de/knxUltimateLogger.html +18 -18
- package/nodes/locales/de/knxUltimateLogger.json +2 -2
- package/nodes/locales/de/knxUltimateSceneController.html +12 -12
- package/nodes/locales/de/knxUltimateViewer.html +10 -10
- package/nodes/locales/de/knxUltimateWatchDog.html +28 -28
- package/nodes/locales/en/common.json +1 -2
- package/nodes/locales/en/hue-config.html +3 -2
- package/nodes/locales/en/hue-config.json +1 -1
- package/nodes/locales/en/knxUltimate.html +1 -1
- package/nodes/locales/en/knxUltimateGarage.html +7 -2
- package/nodes/locales/en/knxUltimateGlobalContext.html +1 -1
- package/nodes/locales/en/knxUltimateHueAreaMotion.html +36 -0
- package/nodes/locales/en/knxUltimateHueAreaMotion.json +31 -0
- package/nodes/locales/en/knxUltimateHueBattery.html +2 -2
- package/nodes/locales/en/knxUltimateHueBattery.json +1 -1
- package/nodes/locales/en/knxUltimateHueButton.html +2 -2
- package/nodes/locales/en/knxUltimateHueButton.json +1 -1
- package/nodes/locales/en/knxUltimateHueCameraMotion.html +2 -2
- package/nodes/locales/en/knxUltimateHueCameraMotion.json +3 -3
- package/nodes/locales/en/knxUltimateHueContactSensor.html +4 -4
- package/nodes/locales/en/knxUltimateHueContactSensor.json +1 -1
- package/nodes/locales/en/knxUltimateHueHumiditySensor.html +3 -3
- package/nodes/locales/en/knxUltimateHueHumiditySensor.json +3 -3
- package/nodes/locales/en/knxUltimateHueLight.html +15 -15
- package/nodes/locales/en/knxUltimateHueLight.json +6 -6
- package/nodes/locales/en/knxUltimateHueLightSensor.html +3 -3
- package/nodes/locales/en/knxUltimateHueLightSensor.json +2 -2
- package/nodes/locales/en/knxUltimateHueMotion.html +2 -2
- package/nodes/locales/en/knxUltimateHueMotion.json +1 -1
- package/nodes/locales/en/knxUltimateHuePlug.html +2 -2
- package/nodes/locales/en/knxUltimateHuePlug.json +2 -2
- package/nodes/locales/en/knxUltimateHueScene.html +3 -3
- package/nodes/locales/en/knxUltimateHueScene.json +3 -3
- package/nodes/locales/en/knxUltimateHueTapDial.html +2 -2
- package/nodes/locales/en/knxUltimateHueTapDial.json +2 -2
- package/nodes/locales/en/knxUltimateHueTemperatureSensor.html +3 -3
- package/nodes/locales/en/knxUltimateHueTemperatureSensor.json +1 -1
- package/nodes/locales/en/knxUltimateHueZigbeeConnectivity.html +3 -3
- package/nodes/locales/en/knxUltimateHueZigbeeConnectivity.json +1 -1
- package/nodes/locales/en/knxUltimateHuedevice_software_update.html +3 -3
- package/nodes/locales/en/knxUltimateHuedevice_software_update.json +1 -1
- package/nodes/locales/en/knxUltimateLoadControl.html +2 -2
- package/nodes/locales/en/knxUltimateLogger.html +3 -3
- package/nodes/locales/en/knxUltimateLogger.json +2 -2
- package/nodes/locales/en/knxUltimateWatchDog.html +2 -2
- package/nodes/locales/es/common.json +1 -1
- package/nodes/locales/es/hue-config.html +3 -2
- package/nodes/locales/es/knxUltimate-config.html +8 -7
- package/nodes/locales/es/knxUltimate.html +2 -2
- package/nodes/locales/es/knxUltimateGarage.html +9 -4
- package/nodes/locales/es/knxUltimateGlobalContext.html +7 -4
- package/nodes/locales/es/knxUltimateHueAreaMotion.html +36 -0
- package/nodes/locales/es/knxUltimateHueAreaMotion.json +31 -0
- package/nodes/locales/es/knxUltimateHueBattery.html +2 -2
- package/nodes/locales/es/knxUltimateHueBattery.json +1 -1
- package/nodes/locales/es/knxUltimateHueButton.html +1 -1
- package/nodes/locales/es/knxUltimateHueButton.json +1 -1
- package/nodes/locales/es/knxUltimateHueCameraMotion.html +2 -2
- package/nodes/locales/es/knxUltimateHueCameraMotion.json +1 -1
- package/nodes/locales/es/knxUltimateHueContactSensor.html +2 -2
- package/nodes/locales/es/knxUltimateHueContactSensor.json +1 -1
- package/nodes/locales/es/knxUltimateHueHumiditySensor.html +1 -1
- package/nodes/locales/es/knxUltimateHueHumiditySensor.json +1 -1
- package/nodes/locales/es/knxUltimateHueLight.html +1 -1
- package/nodes/locales/es/knxUltimateHueLight.json +1 -1
- package/nodes/locales/es/knxUltimateHueLightSensor.html +2 -2
- package/nodes/locales/es/knxUltimateHueLightSensor.json +1 -1
- package/nodes/locales/es/knxUltimateHueMotion.html +2 -2
- package/nodes/locales/es/knxUltimateHueMotion.json +1 -1
- package/nodes/locales/es/knxUltimateHuePlug.html +1 -1
- package/nodes/locales/es/knxUltimateHuePlug.json +1 -1
- package/nodes/locales/es/knxUltimateHueScene.html +3 -3
- package/nodes/locales/es/knxUltimateHueScene.json +1 -1
- package/nodes/locales/es/knxUltimateHueTapDial.html +2 -2
- package/nodes/locales/es/knxUltimateHueTapDial.json +1 -1
- package/nodes/locales/es/knxUltimateHueTemperatureSensor.html +2 -2
- package/nodes/locales/es/knxUltimateHueTemperatureSensor.json +1 -1
- package/nodes/locales/es/knxUltimateHueZigbeeConnectivity.html +2 -2
- package/nodes/locales/es/knxUltimateHueZigbeeConnectivity.json +1 -1
- package/nodes/locales/es/knxUltimateHuedevice_software_update.html +2 -2
- package/nodes/locales/es/knxUltimateHuedevice_software_update.json +1 -1
- package/nodes/locales/es/knxUltimateLoadControl.html +4 -4
- package/nodes/locales/es/knxUltimateLogger.html +9 -10
- package/nodes/locales/es/knxUltimateLogger.json +2 -2
- package/nodes/locales/es/knxUltimateWatchDog.html +6 -6
- package/nodes/locales/fr/common.json +1 -1
- package/nodes/locales/fr/hue-config.html +3 -2
- package/nodes/locales/fr/knxUltimate-config.html +10 -10
- package/nodes/locales/fr/knxUltimate.html +2 -2
- package/nodes/locales/fr/knxUltimateGarage.html +9 -4
- package/nodes/locales/fr/knxUltimateGlobalContext.html +2 -2
- package/nodes/locales/fr/knxUltimateHueAreaMotion.html +36 -0
- package/nodes/locales/fr/knxUltimateHueAreaMotion.json +31 -0
- package/nodes/locales/fr/knxUltimateHueBattery.html +1 -1
- package/nodes/locales/fr/knxUltimateHueBattery.json +1 -1
- package/nodes/locales/fr/knxUltimateHueButton.html +2 -2
- package/nodes/locales/fr/knxUltimateHueButton.json +1 -1
- package/nodes/locales/fr/knxUltimateHueCameraMotion.html +2 -2
- package/nodes/locales/fr/knxUltimateHueCameraMotion.json +1 -1
- package/nodes/locales/fr/knxUltimateHueContactSensor.html +2 -2
- package/nodes/locales/fr/knxUltimateHueContactSensor.json +1 -1
- package/nodes/locales/fr/knxUltimateHueHumiditySensor.html +1 -1
- package/nodes/locales/fr/knxUltimateHueHumiditySensor.json +1 -1
- package/nodes/locales/fr/knxUltimateHueLight.html +1 -1
- package/nodes/locales/fr/knxUltimateHueLight.json +1 -1
- package/nodes/locales/fr/knxUltimateHueLightSensor.html +2 -2
- package/nodes/locales/fr/knxUltimateHueLightSensor.json +1 -1
- package/nodes/locales/fr/knxUltimateHueMotion.html +2 -2
- package/nodes/locales/fr/knxUltimateHueMotion.json +1 -1
- package/nodes/locales/fr/knxUltimateHuePlug.html +1 -1
- package/nodes/locales/fr/knxUltimateHuePlug.json +1 -1
- package/nodes/locales/fr/knxUltimateHueScene.html +3 -3
- package/nodes/locales/fr/knxUltimateHueScene.json +1 -1
- package/nodes/locales/fr/knxUltimateHueTapDial.json +1 -1
- package/nodes/locales/fr/knxUltimateHueTemperatureSensor.html +2 -2
- package/nodes/locales/fr/knxUltimateHueTemperatureSensor.json +1 -1
- package/nodes/locales/fr/knxUltimateHueZigbeeConnectivity.html +2 -2
- package/nodes/locales/fr/knxUltimateHueZigbeeConnectivity.json +1 -1
- package/nodes/locales/fr/knxUltimateHuedevice_software_update.html +2 -2
- package/nodes/locales/fr/knxUltimateHuedevice_software_update.json +1 -1
- package/nodes/locales/fr/knxUltimateLoadControl.html +4 -4
- package/nodes/locales/fr/knxUltimateLogger.html +9 -10
- package/nodes/locales/fr/knxUltimateLogger.json +2 -2
- package/nodes/locales/fr/knxUltimateWatchDog.html +6 -6
- package/nodes/locales/it/common.json +1 -2
- package/nodes/locales/it/hue-config.html +4 -3
- package/nodes/locales/it/hue-config.json +1 -1
- package/nodes/locales/it/knxUltimate-config.html +9 -9
- package/nodes/locales/it/knxUltimate.html +8 -8
- package/nodes/locales/it/knxUltimateGarage.html +9 -4
- package/nodes/locales/it/knxUltimateGlobalContext.html +3 -3
- package/nodes/locales/it/knxUltimateHueAreaMotion.html +36 -0
- package/nodes/locales/it/knxUltimateHueAreaMotion.json +31 -0
- package/nodes/locales/it/knxUltimateHueBattery.html +3 -3
- package/nodes/locales/it/knxUltimateHueBattery.json +1 -1
- package/nodes/locales/it/knxUltimateHueButton.html +1 -1
- package/nodes/locales/it/knxUltimateHueButton.json +1 -1
- package/nodes/locales/it/knxUltimateHueCameraMotion.html +2 -2
- package/nodes/locales/it/knxUltimateHueCameraMotion.json +1 -1
- package/nodes/locales/it/knxUltimateHueContactSensor.html +3 -3
- package/nodes/locales/it/knxUltimateHueContactSensor.json +1 -1
- package/nodes/locales/it/knxUltimateHueHumiditySensor 2.html +1 -1
- package/nodes/locales/it/knxUltimateHueHumiditySensor.html +1 -1
- package/nodes/locales/it/knxUltimateHueHumiditySensor.json +1 -1
- package/nodes/locales/it/knxUltimateHueLight.html +2 -2
- package/nodes/locales/it/knxUltimateHueLight.json +1 -1
- package/nodes/locales/it/knxUltimateHueLightSensor.html +3 -3
- package/nodes/locales/it/knxUltimateHueLightSensor.json +1 -1
- package/nodes/locales/it/knxUltimateHueMotion.html +3 -3
- package/nodes/locales/it/knxUltimateHueMotion.json +1 -1
- package/nodes/locales/it/knxUltimateHuePlug.html +2 -2
- package/nodes/locales/it/knxUltimateHuePlug.json +1 -1
- package/nodes/locales/it/knxUltimateHueScene.html +6 -6
- package/nodes/locales/it/knxUltimateHueScene.json +1 -1
- package/nodes/locales/it/knxUltimateHueTapDial.html +3 -3
- package/nodes/locales/it/knxUltimateHueTapDial.json +1 -1
- package/nodes/locales/it/knxUltimateHueTemperatureSensor.html +3 -3
- package/nodes/locales/it/knxUltimateHueTemperatureSensor.json +1 -1
- package/nodes/locales/it/knxUltimateHueZigbeeConnectivity.html +3 -3
- package/nodes/locales/it/knxUltimateHueZigbeeConnectivity.json +1 -1
- package/nodes/locales/it/knxUltimateHuedevice_software_update.html +3 -3
- package/nodes/locales/it/knxUltimateHuedevice_software_update.json +1 -1
- package/nodes/locales/it/knxUltimateLoadControl.html +5 -5
- package/nodes/locales/it/knxUltimateLogger.html +5 -5
- package/nodes/locales/it/knxUltimateLogger.json +2 -2
- package/nodes/locales/it/knxUltimateViewer.html +2 -2
- package/nodes/locales/it/knxUltimateWatchDog.html +16 -16
- package/nodes/locales/zh-CN/common.json +1 -2
- package/nodes/locales/zh-CN/hue-config.html +3 -2
- package/nodes/locales/zh-CN/hue-config.json +1 -1
- package/nodes/locales/zh-CN/knxUltimate-config.html +10 -10
- package/nodes/locales/zh-CN/knxUltimate.html +4 -4
- package/nodes/locales/zh-CN/knxUltimateGlobalContext.html +4 -4
- package/nodes/locales/zh-CN/knxUltimateHueAreaMotion.html +36 -0
- package/nodes/locales/zh-CN/knxUltimateHueAreaMotion.json +31 -0
- package/nodes/locales/zh-CN/knxUltimateHueBattery.html +3 -3
- package/nodes/locales/zh-CN/knxUltimateHueBattery.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueButton.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueButton.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueCameraMotion.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueCameraMotion.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueContactSensor.html +3 -3
- package/nodes/locales/zh-CN/knxUltimateHueContactSensor.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueHumiditySensor.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueLight.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueLight.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueLightSensor.html +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueMotion.html +3 -3
- package/nodes/locales/zh-CN/knxUltimateHueMotion.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateHuePlug.html +2 -2
- package/nodes/locales/zh-CN/knxUltimateHuePlug.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueScene.html +6 -6
- package/nodes/locales/zh-CN/knxUltimateHueScene.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueTapDial.html +2 -2
- package/nodes/locales/zh-CN/knxUltimateHueTapDial.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueTemperatureSensor.html +3 -3
- package/nodes/locales/zh-CN/knxUltimateHueTemperatureSensor.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateHueZigbeeConnectivity.html +3 -3
- package/nodes/locales/zh-CN/knxUltimateHueZigbeeConnectivity.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateHuedevice_software_update.html +2 -2
- package/nodes/locales/zh-CN/knxUltimateHuedevice_software_update.json +1 -1
- package/nodes/locales/zh-CN/knxUltimateLogger.html +8 -8
- package/nodes/locales/zh-CN/knxUltimateLogger.json +2 -2
- package/nodes/locales/zh-CN/knxUltimateViewer.html +2 -2
- package/nodes/locales/zh-CN/knxUltimateWatchDog.html +15 -15
- package/package.json +3 -2
- package/scripts/inject-wiki-header.js +13 -13
- package/scripts/wiki-menu.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,17 @@
|
|
|
6
6
|
|
|
7
7
|
# CHANGELOG
|
|
8
8
|
|
|
9
|
+
**Version 4.1.9** - December 2025<br/>
|
|
10
|
+
- NEW: added **Hue Motion Area** node for Philips Hue Bridge Pro MotionAware areas, exposing aggregated motion state from Hue `convenience_area_motion` and `security_area_motion` services to KNX or Node-RED flows.<br/>
|
|
11
|
+
- Hue config: extended the internal resource browser to resolve MotionAware area services against their `motion_area_configuration`, showing friendly area names and linked rooms/zones in the editor device picker.<br/>
|
|
12
|
+
<br/>
|
|
13
|
+
|
|
14
|
+
**Version 4.1.8** - December 2025<br/>
|
|
15
|
+
- Logger node editor: when **Action** is set to `Emit payload only`, the file path row is now completely hidden (instead of just disabled), using a dedicated row id for better future Node-RED compatibility.<br/>
|
|
16
|
+
- Logger node editor: added a **Download** button next to the file path.<br/>
|
|
17
|
+
- Logger node: updated labels, help and wiki pages in all languages to explain both the **payload interval** and **Max rows** behaviour, including how the XML/file is **rotated** when the configured row limit is reached.<br/>
|
|
18
|
+
<br/>
|
|
19
|
+
|
|
9
20
|
**Version 4.1.7** - December 2025<br/>
|
|
10
21
|
- Logger node: replaced the checkbox with an explicit **Action** selector (`Emit payload only` / `Emit payload and save to file`), keeping backward compatibility with existing flows.<br/>
|
|
11
22
|
- Logger node: file saving now appends and enforces **Max rows** by trimming oldest lines in both buffer and file; removed the folder picker/listDirs endpoint in favour of a single full-path field.<br/>
|
package/nodes/commonFunctions.js
CHANGED
|
@@ -327,6 +327,43 @@ module.exports = (RED) => {
|
|
|
327
327
|
}
|
|
328
328
|
})
|
|
329
329
|
|
|
330
|
+
// 2025-12 Download logger XML file configured in a knxUltimateLogger node
|
|
331
|
+
RED.httpAdmin.get('/knxUltimateLoggerDownload', RED.auth.needsPermission('knxUltimate-config.read'), (req, res) => {
|
|
332
|
+
try {
|
|
333
|
+
const nodeId = (req.query.nodeId || req.query.id || '').toString()
|
|
334
|
+
if (!nodeId) {
|
|
335
|
+
res.status(400).json({ error: 'NO_NODE_ID' })
|
|
336
|
+
return
|
|
337
|
+
}
|
|
338
|
+
const loggerNode = RED.nodes.getNode(nodeId)
|
|
339
|
+
if (!loggerNode || loggerNode.isLogger !== true) {
|
|
340
|
+
res.status(404).json({ error: 'LOGGER_NOT_FOUND' })
|
|
341
|
+
return
|
|
342
|
+
}
|
|
343
|
+
const filePath = (loggerNode.filePath || '').toString()
|
|
344
|
+
if (!filePath) {
|
|
345
|
+
res.status(404).json({ error: 'NO_FILE_PATH' })
|
|
346
|
+
return
|
|
347
|
+
}
|
|
348
|
+
if (!fs.existsSync(filePath)) {
|
|
349
|
+
res.status(404).json({ error: 'FILE_NOT_FOUND' })
|
|
350
|
+
return
|
|
351
|
+
}
|
|
352
|
+
const safeName = path.basename(filePath) || 'knx-logger.xml'
|
|
353
|
+
res.setHeader('Content-Type', 'application/xml; charset=utf-8')
|
|
354
|
+
res.setHeader('Content-Disposition', `attachment; filename="${safeName}"`)
|
|
355
|
+
const stream = fs.createReadStream(filePath)
|
|
356
|
+
stream.on('error', (err) => {
|
|
357
|
+
try { RED.log.error(`KNXUltimateLoggerDownload error reading file ${filePath}: ${err.message}`) } catch (e) {}
|
|
358
|
+
if (!res.headersSent) res.status(500).json({ error: 'READ_ERROR' })
|
|
359
|
+
})
|
|
360
|
+
stream.pipe(res)
|
|
361
|
+
} catch (error) {
|
|
362
|
+
try { RED.log.error(`KNXUltimateLoggerDownload error: ${error.message}`) } catch (e) {}
|
|
363
|
+
if (!res.headersSent) res.status(500).json({ error: 'UNEXPECTED_ERROR' })
|
|
364
|
+
}
|
|
365
|
+
})
|
|
366
|
+
|
|
330
367
|
// 2025-09 List interfaces (IA) from KNX Secure keyring
|
|
331
368
|
RED.httpAdmin.get('/knxUltimateKeyringInterfaces', RED.auth.needsPermission('knxUltimate-config.read'), async (req, res) => {
|
|
332
369
|
try {
|
package/nodes/hue-config.js
CHANGED
|
@@ -347,7 +347,8 @@ module.exports = (RED) => {
|
|
|
347
347
|
allResources = node.hueAllResources.filter((a) => a.type === 'light' || a.type === 'grouped_light')
|
|
348
348
|
} else if (_rtype === 'plug') {
|
|
349
349
|
allResources = node.hueAllResources.filter((a) => a.type === 'plug' || a.type === 'smartplug' || a.type === 'smart_plug')
|
|
350
|
-
|
|
350
|
+
} else if (_rtype === 'area_motion') {
|
|
351
|
+
allResources = node.hueAllResources.filter((a) => a.type === 'convenience_area_motion' || a.type === 'security_area_motion')
|
|
351
352
|
} else {
|
|
352
353
|
allResources = node.hueAllResources.filter((a) => a.type === _rtype)
|
|
353
354
|
}
|
|
@@ -411,6 +412,36 @@ module.exports = (RED) => {
|
|
|
411
412
|
id: resource.id
|
|
412
413
|
})
|
|
413
414
|
}
|
|
415
|
+
if (_rtype === 'convenience_area_motion' || _rtype === 'security_area_motion' || (_rtype === 'area_motion' && (resource.type === 'convenience_area_motion' || resource.type === 'security_area_motion'))) {
|
|
416
|
+
let areaName = ''
|
|
417
|
+
let areaGroupLabel = ''
|
|
418
|
+
const isConvenience = resource.type === 'convenience_area_motion'
|
|
419
|
+
const areaTypeLabel = isConvenience ? 'Convenience area' : 'Security area'
|
|
420
|
+
let configuration = node.hueAllResources.find((res) => {
|
|
421
|
+
if (res.type !== 'motion_area_configuration' || !Array.isArray(res.services)) return false
|
|
422
|
+
return res.services.some((svc) => svc.rid === resource.id)
|
|
423
|
+
})
|
|
424
|
+
if (!configuration && resource.owner && resource.owner.rid) {
|
|
425
|
+
const candidate = node.hueAllResources.find((res) => res.id === resource.owner.rid)
|
|
426
|
+
if (candidate && candidate.type === 'motion_area_configuration') configuration = candidate
|
|
427
|
+
}
|
|
428
|
+
if (configuration && typeof configuration.name === 'string' && configuration.name.trim() !== '') {
|
|
429
|
+
areaName = configuration.name.trim()
|
|
430
|
+
} else {
|
|
431
|
+
areaName = resource.id
|
|
432
|
+
}
|
|
433
|
+
if (configuration && configuration.group && configuration.group.rid) {
|
|
434
|
+
const groupRes = node.hueAllResources.find((res) => res.id === configuration.group.rid)
|
|
435
|
+
if (groupRes && groupRes.metadata && typeof groupRes.metadata.name === 'string') {
|
|
436
|
+
const groupType = configuration.group.rtype ? capStr(configuration.group.rtype) : 'Group'
|
|
437
|
+
areaGroupLabel = `, ${groupType} ${groupRes.metadata.name}`
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
retArray.push({
|
|
441
|
+
name: `${areaTypeLabel}: ${areaName}${areaGroupLabel}`,
|
|
442
|
+
id: resource.id
|
|
443
|
+
})
|
|
444
|
+
}
|
|
414
445
|
if (_rtype === 'relative_rotary') {
|
|
415
446
|
const linkedDevName = node.hueAllResources.find((dev) => dev.type === 'device' && dev.services.find((serv) => serv.rid === resource.id)).metadata.name || ''
|
|
416
447
|
retArray.push({
|