There is a weird bug present in multiple generated clusters with request/response commands. At least Groups and Scenes.
When building a StoreScene request command, it looks like the library is trying to build a response instead of a request. I can imagine where the error comes from since both request and response share the same command ID (0x04) and the library might be mixing them up somewhere.
This line:
local request = clusters.Scenes.server.commands.StoreScene(device, endpoint_id, 0, 1)
Results in this error:
“[string “st/matter/generated/zap_clusters/Scenes/clien…”]:74: Expecting Uint8 (0x04) for “Uint8” received Uint16: \x00\x00”
The first param is the group ID, which is indeed a Uint16, yet it is trying to validate it as a Uint8 (like if it was the first param of the StoreSceneResponse which is a Uint8).
In fact, if you build that param and force it as Uint8 creating the data type, it will validate. Then, if you send that request… it actually recognises it as a StoreSceneResponse instead of the expected StoreScene command:
sending InteractionRequest: <InteractionRequest || type: INVOKE, info_blocks: [<InteractionInfoBlock || endpoint: 0x01, cluster: Scenes, command: StoreSceneResponse, data: Structure: {groupid: \x00, sceneid: \x01, }>]>
Edit: The same happens with Groups commands like RemoveGroup, it will complain about the group ID data type because it does not match the RemoveGroupResponse fields.
By the way, given the API now supports scenes and groups, what is the correct way to send a groupcast message to, let’s say, recall a group scene? I believe that’s not implemented at the moment, right?