Generic Scene Switch

Matter gateway, Matter bridge, Matter over Wi-Fi, and Matter over thread development.


fangping.guo
Posts: 242

Yes, I used your PID virtual device to conduct a simulation and capture the reported messages. On the Apple Home platform, I verified that single clicks, double clicks, and long presses could all be recognized.

Single Click

Code: Select all

ReportDataMessage =
{
       SubscriptionId = 0xb37d7a9c,
       EventReportIBs =
       [
               EventReportIB =
               {
                       EventDataIB =
                       {
                               EventPath =
                               {
                                       Endpoint = 0x10,
                                       Cluster = 0x3b,
                                       Event = 0x1,
                               },

                           EventNumber = 0x00000000001D000E,
                           PriorityLevel = 0x0000000000000001,
                           SystemTimestamp = 0x00000000000189B3,
                           EventData = 
                           {
                                   0x0 = 0 (signed), 
                           },
                   },

           },

           EventReportIB =
           {
                   EventDataIB =
                   {
                           EventPath =
                           {
                                   Endpoint = 0x10,
                                   Cluster = 0x3b,
                                   Event = 0x3,
                           },

                           EventNumber = 0x00000000001D000F,
                           PriorityLevel = 0x0000000000000001,
                           DeltaSystemTimestamp = 0x0000000000000001,
                           EventData = 
                           {
                                   0x0 = 0 (signed), 
                           },
                   },

           },

           EventReportIB =
           {
                   EventDataIB =
                   {
                           EventPath =
                           {
                                   Endpoint = 0x10,
                                   Cluster = 0x3b,
                                   Event = 0x6,
                           },

                           EventNumber = 0x00000000001D0010,
                           PriorityLevel = 0x0000000000000001,
                           DeltaSystemTimestamp = 0x0000000000000001,
                           EventData = 
                           {
                                   0x0 = 0 (signed), 
                                   0x1 = 1 (signed), 
                           },
                   },

           },

   ],

   InteractionModelRevision = 11
}

Double Click

Code: Select all

ReportDataMessage =
{
       SubscriptionId = 0xb37d7a9c,
       EventReportIBs =
       [
               EventReportIB =
               {
                       EventDataIB =
                       {
                               EventPath =
                               {
                                       Endpoint = 0x10,
                                       Cluster = 0x3b,
                                       Event = 0x1,
                               },

                           EventNumber = 0x00000000001D0011,
                           PriorityLevel = 0x0000000000000001,
                           SystemTimestamp = 0x0000000000031D9B,
                           EventData = 
                           {
                                   0x0 = 0 (signed), 
                           },
                   },

           },

           EventReportIB =
           {
                   EventDataIB =
                   {
                           EventPath =
                           {
                                   Endpoint = 0x10,
                                   Cluster = 0x3b,
                                   Event = 0x3,
                           },

                           EventNumber = 0x00000000001D0012,
                           PriorityLevel = 0x0000000000000001,
                           DeltaSystemTimestamp = 0x0000000000000002,
                           EventData = 
                           {
                                   0x0 = 0 (signed), 
                           },
                   },

           },

           EventReportIB =
           {
                   EventDataIB =
                   {
                           EventPath =
                           {
                                   Endpoint = 0x10,
                                   Cluster = 0x3b,
                                   Event = 0x5,
                           },

                           EventNumber = 0x00000000001D0013,
                           PriorityLevel = 0x0000000000000001,
                           DeltaSystemTimestamp = 0x0000000000000001,
                           EventData = 
                           {
                                   0x0 = 0 (signed), 
                                   0x1 = 2 (signed), 
                           },
                   },

           },

           EventReportIB =
           {
                   EventDataIB =
                   {
                           EventPath =
                           {
                                   Endpoint = 0x10,
                                   Cluster = 0x3b,
                                   Event = 0x3,
                           },

                           EventNumber = 0x00000000001D0014,
                           PriorityLevel = 0x0000000000000001,
                           DeltaSystemTimestamp = 0x0000000000000001,
                           EventData = 
                           {
                                   0x0 = 0 (signed), 
                           },
                   },

           },

           EventReportIB =
           {
                   EventDataIB =
                   {
                           EventPath =
                           {
                                   Endpoint = 0x10,
                                   Cluster = 0x3b,
                                   Event = 0x6,
                           },

                           EventNumber = 0x00000000001D0015,
                           PriorityLevel = 0x0000000000000001,
                           DeltaSystemTimestamp = 0x0000000000000001,
                           EventData = 
                           {
                                   0x0 = 0 (signed), 
                                   0x1 = 2 (signed), 
                           },
                   },

           },

   ],

   InteractionModelRevision = 11
}

Long Press

Code: Select all

ReportDataMessage =
{
       SubscriptionId = 0xb37d7a9c,
       EventReportIBs =
       [
               EventReportIB =
               {
                       EventDataIB =
                       {
                               EventPath =
                               {
                                       Endpoint = 0x10,
                                       Cluster = 0x3b,
                                       Event = 0x2,
                               },

                           EventNumber = 0x00000000001D0016,
                           PriorityLevel = 0x0000000000000001,
                           SystemTimestamp = 0x000000000003D740,
                           EventData = 
                           {
                                   0x0 = 0 (signed), 
                           },
                   },

           },

           EventReportIB =
           {
                   EventDataIB =
                   {
                           EventPath =
                           {
                                   Endpoint = 0x10,
                                   Cluster = 0x3b,
                                   Event = 0x4,
                           },

                           EventNumber = 0x00000000001D0017,
                           PriorityLevel = 0x0000000000000001,
                           DeltaSystemTimestamp = 0x0000000000000002,
                           EventData = 
                           {
                                   0x0 = 0 (signed), 
                           },
                   },

           },

   ],

   InteractionModelRevision = 11
}

Sugar
Posts: 58

Re: Generic Scene Switch

Opera Zrzut ekranu_2026-02-09_104251_mail.google.com.png

Thank you for being so helpful. I appreciate it.
I will share further updates when Aqara responds.

fangping.guo
Posts: 242

Re: Generic Scene Switch

Thank you for your email. I have understood the difference between TUYA and Aqara when sending events.

I will try to modify the code to make it work properly.

But there is a question: if the value of the event is correct but only the type is wrong (reported as signed), will Aqara accept it?

Sugar
Posts: 58

Re: Generic Scene Switch

fangping.guo 2026年 Feb 11日 14:36

Thank you for your email. I have understood the difference between TUYA and Aqara when sending events.

I will try to modify the code to make it work properly.

But there is a question: if the value of the event is correct but only the type is wrong (reported as signed), will Aqara accept it?

Hello :)

Long press is working with reported as signed, but they can't guarantee it will work with single or double press. They follow the matter documentation with their controllers, and in my opinion its not worth trying to make it work, because in future it could cause problems, for example, with Google, or any other matter platforms which will strictly follow matter documentation. It's better to make it as it should be and use it for all of the Tuya momentary switches, than later trying to fix it again, and change so much code for every single switch if it suddenly stops working somewhere due to a mismatch with Matter documentation.

Thank you.

Sugar
Posts: 58

Re: Generic Scene Switch

extra information:

Screenshot_20260216-100402.png
Screenshot_20260216-100445.png

GenericSwitchMultiPressComplete, PreviousPosition=0

Change that 0 to 1 and let's see if single press is working with reported as signed.

Post Reply