Matter Custom cluster Build error ValueError: Unhandled server cluster:

I am trying to Build a modified version of the Matter weather station with additional endpoints

I have created a custom Cluster and Custom Device type via Matter Cluster editor
I cant find specific guidance on this process

I have tried adding these using both  

west zap-gui --clusters ./src/default_zap/scene_sequence.xml


and (am using -o so doesn't overwrite external/modules/lib/matter/src/app/zap-templates/zcl/zcl.json)
west zap-append -o ./src/default_zap/zcl-ammended.json ./src/default_zap/scene_sequence.xml
west zap-gui -j ./src/default_zap/zcl-ammended.json

Both seem to work (no errors)

then run 

west zap-generate


have also tried
west zap-generate -j



but when i try to build i get 

CMake Error at /home/fireblade/test2/matter_weather_station/external/modules/lib/matter/src/app/chip_data_model.cmake:56 (message):
  Failed to execute zap_cluster_list.py: Traceback (most recent call last):

    File "/home/fireblade/test2/matter_weather_station/external/modules/lib/matter/src/app/zap_cluster_list.py", line 113, in <module>
      main()
    File "/home/fireblade/test2/matter_weather_station/external/modules/lib/matter/src/app/zap_cluster_list.py", line 107, in main
      dump_zapfile_clusters(args.zap_file, args.cluster_implementation_data, args.external_clusters)
    File "/home/fireblade/test2/matter_weather_station/external/modules/lib/matter/src/app/zap_cluster_list.py", line 77, in dump_zapfile_clusters
      get_cluster_sources(server_clusters, SERVER_CLUSTERS, 'server'))
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/fireblade/test2/matter_weather_station/external/modules/lib/matter/src/app/zap_cluster_list.py", line 25, in get_cluster_sources
      raise ValueError("Unhandled %s cluster: %s"

  ValueError: Unhandled server cluster: scene_sequence (hint: add to
  src/app/zap_cluster_list.json)

Call Stack (most recent call first):
  /home/fireblade/test2/matter_weather_station/external/modules/lib/matter/src/app/chip_data_model.cmake:106 (chip_configure_zap_file)
  /home/fireblade/test2/matter_weather_station/external/nrf/samples/matter/common/cmake/data_model.cmake:20 (chip_configure_data_model)
  CMakeLists.txt:48 (ncs_configure_data_model)


I think im missing something but not sure what,

I could manually alter  "src/app/zap_cluster_list.json" but that's in the external matter repo (external/modules/lib/matter/) so i'd rather avoid that if possible

could anyone point me to the correct sequence to do this or tell me the missing step(s)

thanks 






  • Hi,

    Do you get an error if you generate the files using --full?

    west zap-generate --full

    We have a guide for creating and adding a custom cluster to your application: Creating manufacturer-specific clusters in Matter application.

    Best regards,
    Marte

  • hello

    ive tried with 

    west zap-generate --full


    and get 

    Files generated in: /home/fireblade/test2/matter_weather_station/application/src/default_zap/zap-generated
    Error: /home/fireblade/test2/matter_weather_station/external/modules/lib/matter/True does not exists or is not a file.
    FATAL ERROR: command exited with status 1: ./scripts/tools/zap/generate.py -z True -t src/app/common/templates/templates.json -o /home/fireblade/test2/matter_weather_station/application/src/default_zap/zap-generated/app-common/zap-generated



  • Ok after renaming the ./src/default_zap/zcl-ammended.json to ./src/default_zap/zcl.json

    west zap-generate --full
    
    


    now works

    but im still getting

      ValueError: Unhandled server cluster: scene_sequence (hint: add to
      src/app/zap_cluster_list.json)

    on build


  • Hi,

    Can you share your XML file with the custom cluster and device type so I can test it on my end? If you do not want to share the file in a public ticket, let me know and I can make the ticket private.

    Best regards,
    Marte

  • hello

    here is cluster file

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <configurator>
    
      <struct name="SequenceSceneStruct" isFabricScoped="true">
        <cluster code="0xff1fc00"/>
        <item fieldId="0" name="SceneID" type="int8u" default="0"/>
        <item fieldId="1" name="TimeOffset" type="int32u" isFabricSensitive="true"/>
      </struct>
      <struct name="SequenceInfoStuct" isFabricScoped="true">
        <cluster code="0xff1fc00"/>
        <item fieldId="0" name="SequenceCount" type="int16u" default="0"/>
        <item fieldId="1" name="CurrentSequence" type="int16u" isFabricSensitive="true"/>
        <item fieldId="2" name="RemainingCapacity" type="int16u" isFabricSensitive="true"/>
      </struct>
    
    
    
      <domain name="CHIP"/>
      <cluster>
        <domain>General</domain>
        <name>Scene Sequence</name>
        <code>0xff1fc00</code>
        <define>scene_sequence</define>
        <attribute name="Sequence table size" side="server" code="0x1" define="SEQUENCE_TABLE_SIZE" type="int16u" default="16" apiMaturity="provisional">
          <description>Sequence table size</description>
          Sequence table size
        </attribute>
        <attribute name="FabricSequenceInfo" side="server" code="0x0000" define="FABRIC_SEQUENCE_INFO" type="SequenceInfoStuct" apiMaturity="provisional">
          <description>FabricSequenceInfo</description>
          FabricSequenceInfo
        </attribute>
        <command name="AddSequence" code="0xfff10000" source="client" response="AddSequenceResponse">
          <description/>
          <arg name="GroupID" type="group_id"/>
          <arg name="SequenceID" type="int16u"/>
          <arg name="SequenceName" type="char_string"/>
          <arg name="SceneSequence" type="SequenceSceneStruct" array="true" />
          <access op="invoke" role="manage"/>
        </command>
        <command name="RemoveSequence" code="0xfff10003" source="client" response="RemoveSequenceResponse">
          <description/>
          <arg name="GroupID" type="group_id"/>
          <arg name="SequenceID" type="int16u"/>
          <access op="invoke" role="manage"/>
        </command>
        <command name="PlaySequence" code="0xfff10002" source="client" response="PlaySequenceResponse">
          <description/>
          <arg name="GroupID" type="group_id"/>
          <arg name="SequenceID" type="int16u"/>
        </command>
        <command name="StopSequence" code="0xfff10004" source="client" response="StopSequenceResponse">
          <description/>
          <arg name="GroupID" type="group_id"/>
          <arg name="SequenceID" type="int16u"/>
        </command>
        <command name="ViewSequene" code="0xfff10005" source="client" response="ViewSequeneResponse">
          <description/>
          <arg name="GroupID" type="group_id"/>
          <arg name="SequenceID" type="int16u"/>
        </command>
        <command name="AddSequenceResponse" code="0xfff10000" source="server">
          <description/>
          <arg name="GroupID" type="group_id"/>
          <arg name="SequenceID" type="int16u"/>
          <arg name="Status" type="status"/>
        </command>
        <command name="RemoveSequenceResponse" code="0xfff10003" source="server">
          <description/>
          <arg name="GroupID" type="group_id"/>
          <arg name="SequenceID" type="int16u"/>
          <arg name="Status" type="status"/>
        </command>
        <command name="PlaySequenceResponse" code="0xfff10002" source="server">
          <description/>
          <arg name="GroupID" type="group_id"/>
          <arg name="SequenceID" type="int16u"/>
          <arg name="Status" type="status"/>
        </command>
        <command name="StopSequenceResponse" code="0xfff10004" source="server">
          <description/>
          <arg name="GroupID" type="group_id"/>
          <arg name="SequenceID" type="int16u"/>
          <arg name="Status" type="status"/>
        </command>
      </cluster>
      <deviceType>
        <name>signal-lights</name>
        <domain>Lighting</domain>
        <typeName>Signal Lights</typeName>
        <profileId>0x104</profileId>
        <deviceId>0xfff100f1</deviceId>
        <clusters lockOthers="false">
          <include cluster="Scene Sequence" server="true"/>
          <include cluster="Scenes Management" client="true"/>
        </clusters>
      </deviceType>
    </configurator>


    is basically facility to allow a device to switch between a set of scenes over a period of time without interaction with a controller

    I'm not yet that familiar with matter, so only a rough outline to test what is required.  

    is create using a combination of matter cluster editor 0.1 and a few manual edits, due to bugs/missing features in the editor



    I'm building on top of  matter weather station as have that correctly building with additional drivers for i2c GPIO expanders (mcp23017 and pca9538) and shells






Related