From f19f28fd8abd78b9e03fb1deb593119daabbd3ab Mon Sep 17 00:00:00 2001 From: Smanar Date: Sat, 10 Jul 2021 21:15:14 +0200 Subject: [PATCH 01/12] Update de_web_plugin.cpp --- de_web_plugin.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index ad5299b8d2..7fef215924 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -1820,6 +1820,9 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) { return; } + + // display some information + DBG_Printf(DBG_ZGP, "Device commissioning : options.byte 0x%02X , extOptions.byte 0x%02X , gpdsrcid %u , command 0x%02X , Payload %s\n", options.byte, extOptions.byte, ind.gpdSrcId(), gpdDeviceId, qPrintable(ind.payload().toHex())); // create new sensor Sensor sensorNode; From 2daacef661431f3445be4e12bfe80dd7a074169e Mon Sep 17 00:00:00 2001 From: Smanar Date: Sun, 11 Jul 2021 17:13:18 +0200 Subject: [PATCH 02/12] Update de_web_plugin.cpp --- de_web_plugin.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index 7fef215924..2caadadb21 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -1470,6 +1470,7 @@ void DeRestPluginPrivate::gpProcessButtonEvent(const deCONZ::GpDataIndication &i sensor->rx(); quint32 btn = ind.gpdCommandId(); + if (sensor->modelId() == QLatin1String("FOHSWITCH")) { // Map the command to the mapped button and action. @@ -1649,6 +1650,9 @@ int DeRestPluginPrivate::taskCountForAddress(const deCONZ::Address &address) */ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) { + // display some information + DBG_Printf(DBG_ZGP, "ZGP : gpdsrcid %u , command 0x%02X , Payload %s\n", ind.gpdSrcId(), ind.gpdCommandId(), qPrintable(ind.payload().toHex())); + switch (ind.gpdCommandId()) { case deCONZ::GpCommandIdScene0: @@ -1868,6 +1872,23 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) sensorNode.setManufacturer("PhilipsFoH"); sensorNode.setSwVersion("PTM216Z"); } + else if (gpdDeviceId == GpDeviceIdGenericSwitch && options.byte == 0xC5 && extOptions.byte == 0xF2 && ind.payload().size() == 31) + { + //For the 1 button switch (0 677 23L or ZLGP17): + //Button 1: Device commissioning : options.byte 0xC5 , extOptions.byte 0xF2 , gpdsrcid 5345230 , command 0x02 , Payload 02c5f20164366c366d12f5587972fd1dae3dee65ff1de0f001000004022220 + + //For the 2 buttons switch (0 677 24L or ZLGP18): + //Button 1: Device commissioning : options.byte 0xC5 , extOptions.byte 0xF2 , gpdsrcid 5375258 , command 0x02 , Payload 02c5f29ddf38cc0baaa63c6d8c31176a7d50892a7f84e35f00000004022220 + //Button 2: Device commissioning : options.byte 0xC5 , extOptions.byte 0xF2 , gpdsrcid 5375259 , command 0x02 , Payload 02c5f2361cf5a1f812cebb4744edfec5d591f07fe3e2935800000004022220 + + // It use as command + // 0x20 GpCommandIdOff + // 0x22 GpCommandIdToggle + + sensorNode.setModelId("ZGPSWITCH"); + sensorNode.setManufacturer("Legrand"); + sensorNode.setSwVersion("1.0"); + } else { DBG_Printf(DBG_INFO, "unsupported green power device 0x%02X\n", gpdDeviceId); From 2b4c7a6b3cca5f07d149a97f8fc0dace3244065e Mon Sep 17 00:00:00 2001 From: Smanar Date: Sun, 11 Jul 2021 17:25:42 +0200 Subject: [PATCH 03/12] Update de_web_plugin.cpp --- de_web_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index 2caadadb21..32f16d63a6 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -1651,7 +1651,7 @@ int DeRestPluginPrivate::taskCountForAddress(const deCONZ::Address &address) void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) { // display some information - DBG_Printf(DBG_ZGP, "ZGP : gpdsrcid %u , command 0x%02X , Payload %s\n", ind.gpdSrcId(), ind.gpdCommandId(), qPrintable(ind.payload().toHex())); + DBG_Printf(DBG_ZGP, "Incoming ZGP Frame: gpdsrcid %u, command 0x%02X, Payload %s\n", ind.gpdSrcId(), ind.gpdCommandId(), qPrintable(ind.payload().toHex())); switch (ind.gpdCommandId()) { @@ -1826,7 +1826,7 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) } // display some information - DBG_Printf(DBG_ZGP, "Device commissioning : options.byte 0x%02X , extOptions.byte 0x%02X , gpdsrcid %u , command 0x%02X , Payload %s\n", options.byte, extOptions.byte, ind.gpdSrcId(), gpdDeviceId, qPrintable(ind.payload().toHex())); + DBG_Printf(DBG_ZGP, "Device commissioning : options.byte 0x%02X, extOptions.byte 0x%02X\n", options.byte, extOptions.byte); // create new sensor Sensor sensorNode; From 2194e7c471766c1fc79edc05ca4a8570d5020105 Mon Sep 17 00:00:00 2001 From: Smanar Date: Mon, 12 Jul 2021 16:13:07 +0200 Subject: [PATCH 04/12] Update de_web_plugin.cpp --- de_web_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index 32f16d63a6..1024bf3400 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -1872,7 +1872,7 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) sensorNode.setManufacturer("PhilipsFoH"); sensorNode.setSwVersion("PTM216Z"); } - else if (gpdDeviceId == GpDeviceIdGenericSwitch && options.byte == 0xC5 && extOptions.byte == 0xF2 && ind.payload().size() == 31) + else if (gpdDeviceId == GpDeviceIdOnOffSwitch && options.byte == 0xC5 && extOptions.byte == 0xF2 && ind.payload().size() == 31) { //For the 1 button switch (0 677 23L or ZLGP17): //Button 1: Device commissioning : options.byte 0xC5 , extOptions.byte 0xF2 , gpdsrcid 5345230 , command 0x02 , Payload 02c5f20164366c366d12f5587972fd1dae3dee65ff1de0f001000004022220 From b2c681b1243e79a257ca2477b3ad9ca542a68818 Mon Sep 17 00:00:00 2001 From: Smanar Date: Mon, 12 Jul 2021 20:34:28 +0200 Subject: [PATCH 05/12] Update de_web_plugin.cpp --- de_web_plugin.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index 1024bf3400..e46d64f7c2 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -1921,6 +1921,10 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) { sensorNode.setName(QString("FoH Switch %2").arg(sensorNode.id())); } + else if (sensorNode.Manufacturer() == QLatin1String("Legrand")) + { + sensorNode.setName(QString("Self-e switch %2").arg(sensorNode.id())); + } else { sensorNode.setName(QString("Hue Tap %2").arg(sensorNode.id())); From b192b1fbbe8d6a24ed7cc4c4153b0305cd51fce5 Mon Sep 17 00:00:00 2001 From: Smanar Date: Tue, 13 Jul 2021 17:02:34 +0200 Subject: [PATCH 06/12] Update de_web_plugin.cpp --- de_web_plugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index e46d64f7c2..b2afd04c9c 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -1885,7 +1885,7 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) // 0x20 GpCommandIdOff // 0x22 GpCommandIdToggle - sensorNode.setModelId("ZGPSWITCH"); + sensorNode.setModelId("LEGRANDZGPSWITCH"); sensorNode.setManufacturer("Legrand"); sensorNode.setSwVersion("1.0"); } @@ -1921,7 +1921,7 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) { sensorNode.setName(QString("FoH Switch %2").arg(sensorNode.id())); } - else if (sensorNode.Manufacturer() == QLatin1String("Legrand")) + else if (sensorNode.manufacturer() == QLatin1String("Legrand")) { sensorNode.setName(QString("Self-e switch %2").arg(sensorNode.id())); } From a23d7e554e0dd5092d45db9d9fb38026c29cabb8 Mon Sep 17 00:00:00 2001 From: Smanar Date: Tue, 13 Jul 2021 17:05:17 +0200 Subject: [PATCH 07/12] Update de_web_plugin.cpp --- de_web_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index b2afd04c9c..9793eea7c1 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -1921,7 +1921,7 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) { sensorNode.setName(QString("FoH Switch %2").arg(sensorNode.id())); } - else if (sensorNode.manufacturer() == QLatin1String("Legrand")) + else if (sensorNode.modelId() == QLatin1String("LEGRANDZGPSWITCH")) { sensorNode.setName(QString("Self-e switch %2").arg(sensorNode.id())); } From 406ab75e0a7b2c167765daec1a5b7ff05fd95ca7 Mon Sep 17 00:00:00 2001 From: Smanar Date: Sun, 18 Jul 2021 10:23:04 +0200 Subject: [PATCH 08/12] Update de_web_plugin.cpp --- de_web_plugin.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index 9793eea7c1..5c7858f0c7 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -1826,7 +1826,7 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) } // display some information - DBG_Printf(DBG_ZGP, "Device commissioning : options.byte 0x%02X, extOptions.byte 0x%02X\n", options.byte, extOptions.byte); + DBG_Printf(DBG_ZGP, "Device commissioning : device type 0x%02X, options.byte 0x%02X, extOptions.byte 0x%02X\n", gpdDeviceId, options.byte, extOptions.byte); // create new sensor Sensor sensorNode; @@ -1875,17 +1875,32 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) else if (gpdDeviceId == GpDeviceIdOnOffSwitch && options.byte == 0xC5 && extOptions.byte == 0xF2 && ind.payload().size() == 31) { //For the 1 button switch (0 677 23L or ZLGP17): - //Button 1: Device commissioning : options.byte 0xC5 , extOptions.byte 0xF2 , gpdsrcid 5345230 , command 0x02 , Payload 02c5f20164366c366d12f5587972fd1dae3dee65ff1de0f001000004022220 + //Button 1: Device commissioning : options.byte 0xC5 , extOptions.byte 0xF2 , gpdsrcid 5345230 , gpdDeviceId 0x02 , Payload 02c5f20164366c366d12f5587972fd1dae3dee65ff1de0f001000004022220 //For the 2 buttons switch (0 677 24L or ZLGP18): - //Button 1: Device commissioning : options.byte 0xC5 , extOptions.byte 0xF2 , gpdsrcid 5375258 , command 0x02 , Payload 02c5f29ddf38cc0baaa63c6d8c31176a7d50892a7f84e35f00000004022220 - //Button 2: Device commissioning : options.byte 0xC5 , extOptions.byte 0xF2 , gpdsrcid 5375259 , command 0x02 , Payload 02c5f2361cf5a1f812cebb4744edfec5d591f07fe3e2935800000004022220 + //Button 1: Device commissioning : options.byte 0xC5 , extOptions.byte 0xF2 , gpdsrcid 5375258 , gpdDeviceId 0x02 , Payload 02c5f29ddf38cc0baaa63c6d8c31176a7d50892a7f84e35f00000004022220 + //Button 2: Device commissioning : options.byte 0xC5 , extOptions.byte 0xF2 , gpdsrcid 5375259 , gpdDeviceId 0x02 , Payload 02c5f2361cf5a1f812cebb4744edfec5d591f07fe3e2935800000004022220 - // It use as command + // they use as command // 0x20 GpCommandIdOff // 0x22 GpCommandIdToggle - sensorNode.setModelId("LEGRANDZGPSWITCH"); + sensorNode.setModelId("LEGRANDZGPTOGGLESWITCH"); + sensorNode.setManufacturer("Legrand"); + sensorNode.setSwVersion("1.0"); + } + else if (gpdDeviceId == 0xfe && options.byte == 0xC5 && extOptions.byte == 0xF2 && ind.payload().size() == 37) //0xfe is for scene switch ? + { + //For the 4 buttons switch (0 677 55L or ZLGP15): + // Device commissioning : options.byte 0xC5 , extOptions.byte 0xF2 , gpdsrcid 5350418 , gpdDeviceId 0x02 , Payload fec5f20aed654eac2b62be20be25648b591e5097033fbf640000000408141516171c1d1e1f + + // they use as command + // 0x14 GpCommandIdScene4 + // 0x15 GpCommandIdScene5 + // 0x16 GpCommandIdScene6 + // 0x17 GpCommandIdScene7 + + sensorNode.setModelId("LEGRANDZGPSCENESWITCH"); sensorNode.setManufacturer("Legrand"); sensorNode.setSwVersion("1.0"); } From 11ec0472c454624926fcb08f88f1bdbae7165659 Mon Sep 17 00:00:00 2001 From: Smanar Date: Sun, 18 Jul 2021 10:26:49 +0200 Subject: [PATCH 09/12] mistake --- de_web_plugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index 5c7858f0c7..4b7c4c78a3 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -1936,7 +1936,8 @@ void DeRestPluginPrivate::gpDataIndication(const deCONZ::GpDataIndication &ind) { sensorNode.setName(QString("FoH Switch %2").arg(sensorNode.id())); } - else if (sensorNode.modelId() == QLatin1String("LEGRANDZGPSWITCH")) + else if (sensorNode.modelId() == QLatin1String("LEGRANDZGPTOGGLESWITCH") || + sensorNode.modelId() == QLatin1String("LEGRANDZGPSCENESWITCH")) { sensorNode.setName(QString("Self-e switch %2").arg(sensorNode.id())); } From 33db0cf91389f1227c6c53f6ef3c8afdb63c0edf Mon Sep 17 00:00:00 2001 From: Smanar Date: Sat, 24 Jul 2021 12:57:23 +0200 Subject: [PATCH 10/12] Update de_web_plugin.cpp --- de_web_plugin.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index 4b7c4c78a3..80cd4a24c2 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -1597,6 +1597,36 @@ void DeRestPluginPrivate::gpProcessButtonEvent(const deCONZ::GpDataIndication &i btn = btnMapped + S_BUTTON_ACTION_LONG_RELEASED; } } + else if (sensor->modelId() == QLatin1String("LEGRANDZGPTOGGLESWITCH")) + { + if (btn == GpCommandIdToggle) + { + btn = S_BUTTON_1 + S_BUTTON_ACTION_SHORT_RELEASED; + } + else //Will be GpCommandIdOff + { + btn = S_BUTTON_1 + S_BUTTON_ACTION_DOUBLE_PRESS; + } + } + else if sensor->modelId() == QLatin1String("LEGRANDZGPSCENESWITCH")) + { + if (btn == GpCommandIdScene4) + { + btn = S_BUTTON_1 + S_BUTTON_ACTION_SHORT_RELEASED; + } + else if (btn == GpCommandIdScene5) + { + btn = S_BUTTON_2 + S_BUTTON_ACTION_SHORT_RELEASED; + } + else if (btn == GpCommandIdScene6) + { + btn = S_BUTTON_3 + S_BUTTON_ACTION_SHORT_RELEASED; + } + else //Will be GpCommandIdScene7 + { + btn = S_BUTTON_4 + S_BUTTON_ACTION_SHORT_RELEASED; + } + } updateSensorEtag(sensor); sensor->updateStateTimestamp(); From d9f3aea7b6ae3308dea05ca9ee3d05fff5181c3c Mon Sep 17 00:00:00 2001 From: Smanar Date: Sat, 24 Jul 2021 13:00:19 +0200 Subject: [PATCH 11/12] Update de_web_plugin.cpp --- de_web_plugin.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index 80cd4a24c2..fb7d4de1b6 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -1599,30 +1599,30 @@ void DeRestPluginPrivate::gpProcessButtonEvent(const deCONZ::GpDataIndication &i } else if (sensor->modelId() == QLatin1String("LEGRANDZGPTOGGLESWITCH")) { - if (btn == GpCommandIdToggle) + if (btn == deCONZ::GpCommandIdToggle) { btn = S_BUTTON_1 + S_BUTTON_ACTION_SHORT_RELEASED; } - else //Will be GpCommandIdOff + else //Will be deCONZ::GpCommandIdOff { btn = S_BUTTON_1 + S_BUTTON_ACTION_DOUBLE_PRESS; } } else if sensor->modelId() == QLatin1String("LEGRANDZGPSCENESWITCH")) { - if (btn == GpCommandIdScene4) + if (btn == deCONZ::GpCommandIdScene4) { btn = S_BUTTON_1 + S_BUTTON_ACTION_SHORT_RELEASED; } - else if (btn == GpCommandIdScene5) + else if (btn == deCONZ::GpCommandIdScene5) { btn = S_BUTTON_2 + S_BUTTON_ACTION_SHORT_RELEASED; } - else if (btn == GpCommandIdScene6) + else if (btn == deCONZ::GpCommandIdScene6) { btn = S_BUTTON_3 + S_BUTTON_ACTION_SHORT_RELEASED; } - else //Will be GpCommandIdScene7 + else //Will be deCONZ::GpCommandIdScene7 { btn = S_BUTTON_4 + S_BUTTON_ACTION_SHORT_RELEASED; } From 049eaeb7f4e04592b2dc8ba98b790f7df0c9adc5 Mon Sep 17 00:00:00 2001 From: Smanar Date: Sat, 24 Jul 2021 13:01:10 +0200 Subject: [PATCH 12/12] typo --- de_web_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/de_web_plugin.cpp b/de_web_plugin.cpp index fb7d4de1b6..09b26311ec 100644 --- a/de_web_plugin.cpp +++ b/de_web_plugin.cpp @@ -1608,7 +1608,7 @@ void DeRestPluginPrivate::gpProcessButtonEvent(const deCONZ::GpDataIndication &i btn = S_BUTTON_1 + S_BUTTON_ACTION_DOUBLE_PRESS; } } - else if sensor->modelId() == QLatin1String("LEGRANDZGPSCENESWITCH")) + else if (sensor->modelId() == QLatin1String("LEGRANDZGPSCENESWITCH")) { if (btn == deCONZ::GpCommandIdScene4) {