# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default

name: 74.3.2. [TC-SWTCH-3.2] Primary functionality with client as DUT

PICS:
    - SWTCH.C
    - MCORE.IDM.C.SubscribeEvent

config:
    nodeId: 0x12344321
    cluster: "Basic Information"
    endpoint: 0

tests:
    - label: "Note"
      verification: |
          For DUT as client test cases, Chip-tool command used below are an example to verify the functionality. For certification test, we expect DUT should have a capability or way to run the equivalent command.

          Execute the below mentioned command to put TH(Reference app) into a commissionable state in RPI platform, Pls use equivalent command on the respective platform
          ./chip-all-clusters-app --trace_decode 1

          Once TH reach the  commissionable state pls send below mentioned command on DUT(chip-tool) in RPI platform. Pls use equivalent command on the respective platform

          ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1

          Verify the commissioning completed with success on DUT(Chip-tool)

          [1650455358.501816][4366:4371] CHIP:TOO: Device commissioning completed with success
      disabled: true

    - label: "Note"
      verification: |
          NOTE: https://github.com/project-chip/connectedhomeip/tree/master/examples/all-clusters-app/linux#readme
          Events to be executed as following
          1. Compile app using below command in connectedhomeip folder
          a. ./scripts/run_in_build_env.sh ./scripts/build/build_examples.py --target linux-arm64-all-clusters-no-ble-asan-clang build
          2. Build respective app (all-clusters-app)
          3. Commission DUT to TH
          4. Open 2nd terminal of DUT and provide the below command to obtain PID of DUT
          ps  -aef|grep all-clusters-app
          5. Follow the Verification step below to generate the event in 2nd terminal of DUT
      disabled: true

    - label:
          "Step 0a: FAIL the test - at least one of SWTCH.C.F00(LS) and
          SWTCH.C.F01(MS) has to be supported"
      PICS: "!SWTCH.C.F00 && !SWTCH.C.F01"
      verification: |
          no messages needed, TH checks consistency of PICS flags
      disabled: true

    - label:
          "Step 0b: FAIL the test - when supporting SWTCH.C.F02(MSR) also
          SWTCH.C.F01(MS) must be supported"
      PICS: SWTCH.C.F02 && !SWTCH.C.F01
      verification: |
          no messages needed, TH checks consistency of PICS flags
      disabled: true

    - label:
          "Step 0c: FAIL the test - when supporting SWTCH.C.F03(MSL) also
          SWTCH.C.F01(MS) must be supported"
      PICS: SWTCH.C.F03 && !SWTCH.C.F01
      verification: |
          no messages needed, TH checks consistency of PICS flags
      disabled: true

    - label:
          "Step 0d: FAIL the test - when supporting SWTCH.C.F03(MSL) also
          SWTCH.C.F02(MSR) must be supported"
      PICS: SWTCH.C.F03 && !SWTCH.C.F02
      verification: |
          no messages needed, TH checks consistency of PICS flags
      disabled: true

    - label:
          "Step 0e: FAIL the test - when supporting SWTCH.C.F04(MSM) also
          SWTCH.C.F01(MS) must be supported"
      PICS: SWTCH.C.F04 && !SWTCH.C.F01
      verification: |
          no messages needed, TH checks consistency of PICS flags
      disabled: true

    - label:
          "Step 0f: FAIL the test - when supporting SWTCH.C.F04(MSM) also
          SWTCH.C.F02(MSR) must be supported"
      PICS: SWTCH.C.F04 && !SWTCH.C.F02
      verification: |
          no messages needed, TH checks consistency of PICS flags
      disabled: true

    - label:
          "Step 0g: FAIL the test - at least one of SWTCH.C.M.SwitchStatePolling
          and SWTCH.C.M.SwitchStateEventing must be supported"
      PICS: "!SWTCH.C.M.SwitchStatePolling && !SWTCH.C.M.SwitchStateEventing"
      verification: |
          no messages needed, TH checks consistency of PICS flags
      disabled: true

    - label:
          "Step 0h: FAIL the test - when supporting SWTCH.C.F02(MSR) the
          SWTCH.C.F05(AS) must not be supported"
      PICS: SWTCH.C.F02 && SWTCH.C.F05
      verification: |
          no messages needed, TH checks consistency of PICS flags
      disabled: true

    - label:
          "Step 1a: Commission DUT to TH. Use client mechanism to set it up so
          switch state can be observed (e.g. UI shows state of switch) and/or
          other device is controlled (e.g. light on same fabric gets controlled
          by the switch  TH has to simulate that light). While commissioning and
          configuring, TH records and reacts to the messages relating to the
          switch functionality detailed in the steps below. The order of the
          messages received may be different from the order of the sub-steps
          1b..1d below."
      PICS: SWTCH.C.F00
      verification: |

      disabled: true

    - label: "Step 1b: DUT reads global attribute FeatureMap."
      PICS: SWTCH.C.F00
      verification: |
          ./chip-tool switch read feature-map 1 1

          Verify  FeatureMap value is 1 On TH (all-clusters-app) log and below is the sample log provided for the raspi platform:

          ReportDataMessage =
          [1671450600.457719][8426:8426] CHIP:DMG: {
          [1671450600.457728][8426:8426] CHIP:DMG:         AttributeReportIBs =
          [1671450600.457747][8426:8426] CHIP:DMG:         [
          [1671450600.457756][8426:8426] CHIP:DMG:                 AttributeReportIB =
          [1671450600.457954][8426:8426] CHIP:DMG:                 {
          [1671450600.457976][8426:8426] CHIP:DMG:                         AttributeDataIB =
          [1671450600.457991][8426:8426] CHIP:DMG:                         {
          [1671450600.458015][8426:8426] CHIP:DMG:                                 DataVersion = 0xcfe432fa,
          [1671450600.458038][8426:8426] CHIP:DMG:                                 AttributePathIB =
          [1671450600.458057][8426:8426] CHIP:DMG:                                 {
          [1671450600.458075][8426:8426] CHIP:DMG:                                         Endpoint = 0x1,
          [1671450600.458088][8426:8426] CHIP:DMG:                                         Cluster = 0x3b,
          [1671450600.458108][8426:8426] CHIP:DMG:                                         Attribute = 0x0000_FFFC,
          [1671450600.458122][8426:8426] CHIP:DMG:                                 }
          [1671450600.458137][8426:8426] CHIP:DMG:
          [1671450600.458151][8426:8426] CHIP:DMG:                                 Data = 1,
          [1671450600.458161][8426:8426] CHIP:DMG:                         },
          [1671450600.458179][8426:8426] CHIP:DMG:
          [1671450600.458188][8426:8426] CHIP:DMG:                 },
          [1671450600.458207][8426:8426] CHIP:DMG:
          [1671450600.458216][8426:8426] CHIP:DMG:         ],
          [1671450600.458242][8426:8426] CHIP:DMG:
          [1671450600.458255][8426:8426] CHIP:DMG:         SuppressResponse = true,
          [1671450600.458273][8426:8426] CHIP:DMG:         InteractionModelRevision = 1
          [1671450600.458286][8426:8426] CHIP:DMG: }
      disabled: true

    - label: "Step 1c: DUT reads attribute NumberOfPositions."
      PICS: SWTCH.C.F00
      verification: |
          ./chip-tool switch read number-of-positions 1 1

          Verify  NumberOfPositions value is 2 On TH (all-clusters-app) log and below is the sample log provided for the raspi platform:

          ReportDataMessage =
          [1671450651.817816][8426:8426] CHIP:DMG: {
          [1671450651.817819][8426:8426] CHIP:DMG:         AttributeReportIBs =
          [1671450651.817825][8426:8426] CHIP:DMG:         [
          [1671450651.817828][8426:8426] CHIP:DMG:                 AttributeReportIB =
          [1671450651.817849][8426:8426] CHIP:DMG:                 {
          [1671450651.817853][8426:8426] CHIP:DMG:                         AttributeDataIB =
          [1671450651.817858][8426:8426] CHIP:DMG:                         {
          [1671450651.817862][8426:8426] CHIP:DMG:                                 DataVersion = 0xcfe432fa,
          [1671450651.817864][8426:8426] CHIP:DMG:                                 AttributePathIB =
          [1671450651.817868][8426:8426] CHIP:DMG:                                 {
          [1671450651.817872][8426:8426] CHIP:DMG:                                         Endpoint = 0x1,
          [1671450651.817876][8426:8426] CHIP:DMG:                                         Cluster = 0x3b,
          [1671450651.817879][8426:8426] CHIP:DMG:                                         Attribute = 0x0000_0000,
          [1671450651.817882][8426:8426] CHIP:DMG:                                 }
          [1671450651.817888][8426:8426] CHIP:DMG:
          [1671450651.817892][8426:8426] CHIP:DMG:                                 Data = 2,
          [1671450651.817895][8426:8426] CHIP:DMG:                         },
          [1671450651.817901][8426:8426] CHIP:DMG:
          [1671450651.817905][8426:8426] CHIP:DMG:                 },
          [1671450651.817910][8426:8426] CHIP:DMG:
          [1671450651.817913][8426:8426] CHIP:DMG:         ],
          [1671450651.817918][8426:8426] CHIP:DMG:
          [1671450651.817921][8426:8426] CHIP:DMG:         SuppressResponse = true,
          [1671450651.817925][8426:8426] CHIP:DMG:         InteractionModelRevision = 1
          [1671450651.817928][8426:8426] CHIP:DMG: }
      disabled: true

    - label:
          "Step 1d: DUT sets up eventing (SwitchLatched) so it will receive
          events when the switch is operated."
      PICS: SWTCH.C.F00 && SWTCH.C.M.SwitchStateEventing
      verification: |
          On Raspi platform to trigger the event give the below command by opening an another terminal in DUT (Below is the example command developed in all-clusters-app to generate the event, Vendor DUT should have capability to generate this event)

          echo '{"Name":"SwitchLatched","NewPosition":0}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify SwitchLatched event with NewPosition set to 0 on TH(all-cluster-app) log and below is the sample log provided for the raspi platform:

          [1659679728.732056][2530:2538] CHIP:-: Received payload: "{"Name":"SwitchLatched","NewPosition":0}"
          [1659679728.732389][2530:2530] CHIP:DMG: Endpoint 1, Cluster 0x0000_003B update version to ee5e7706
          [1659679728.732429][2530:2530] CHIP:-: The latching switch is moved to a new position:0
          [1659679728.732454][2530:2530] CHIP:ZCL: SwitchServer: OnSwitchLatch

          ./chip-tool switch read-event switch-latched  1 1

          Verify switch latched event has newposition set to 0 on DUT (chip-tool) logs and below is the sample log provided for the raspi platform:

          [1659679766.774013][2535:2540] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0000
          [1659679766.774035][2535:2540] CHIP:TOO:          Event number: 3
          [1659679766.774055][2535:2540] CHIP:TOO:          Priority: Info
          [1659679766.774074][2535:2540] CHIP:TOO:          Timestamp: 2181028
          [1659679766.774157][2535:2540] CHIP:TOO:   SwitchLatched: {
          [1659679766.774197][2535:2540] CHIP:TOO:     NewPosition: 0
          [1659679766.774214][2535:2540] CHIP:TOO:    }
      disabled: true

    - label:
          "Step 2a: TH simulates operation of the switch by changing state
          (attribute CurrentPosition) from 0 to 1 and back every 10 seconds
          (over a 1 minute period) DUT reads attribute CurrentPosition regularly"
      PICS: SWTCH.C.F00 && SWTCH.C.M.SwitchStatePolling
      verification: |
          On Raspi platform to trigger the event give the below command by opening an another terminal in DUT (Below is the example command developed in all-clusters-app to generate the event, Vendor DUT should have capability to generate this event)

          echo '{"Name":"SwitchLatched","NewPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify SwitchLatched event with NewPosition set to 1 on TH(all-cluster-app) log:

          [1659621148.831745][8590:8596] CHIP:-: Received payload: "{"Name":"SwitchLatched","NewPosition":1}"
          [1659621148.832236][8590:8590] CHIP:DMG: Endpoint 1, Cluster 0x0000_003B update version to 4be58f54
          [1659621148.832320][8590:8590] CHIP:-: The latching switch is moved to a new position:1
          [1659621148.832380][8590:8590] CHIP:ZCL: SwitchServer: OnSwitchLatch
          [1659621148.832494][8590:8590] CHIP:EVL: LogEvent event number: 0x0000000000000007 priority: 1, endpoint id:  0x1 cluster id: 0x0000_003B event id: 0x0 Sys timestamp: 0x00000000022D0CBB

          DUT Reads the CurrentPosition value.

          ./chip-tool switch read current-position 1 1

          Verify CurrentPosition value is 1 on DUT (chip-tool) :

          [1722927679.396] [30503:30505] [DMG] }
          [1722927679.396] [30503:30505] [TOO] Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0001 DataVersion: 1761848624
          [1722927679.397] [30503:30505] [TOO]   CurrentPosition: 1


          TH simulates operation of the switch by changing state (attribute CurrentPosition) from 1 to 0 and DUT  reads  the CurrentPosition attribute

          After 10 seconds, repeat the command with /tmp/chip_all_clusters_fifo using with value 0 as position

          echo '{"Name":"SwitchLatched","NewPosition":0}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify SwitchLatched event with NewPosition set to 0 on TH(all-cluster-app) log:

          [1686292713.872327][30986:30989] CHIP:-: Received payload: "{"Name":"SwitchLatched","NewPosition":0}"
          [1686292713.872583][30986:30986] CHIP:DMG: Endpoint 1, Cluster 0x0000_003B update version to bae40566
          [1686292713.872617][30986:30986] CHIP:-: The latching switch is moved to a new position:0
          [1686292713.872629][30986:30986] CHIP:ZCL: SwitchServer: OnSwitchLatch

          DUT Reads the CurrentPosition value.

          ./chip-tool switch read current-position 1 1

          Verify CurrentPosition value is 0 on DUT (chip-tool) :

          [1722927891.728] [30554:30556] [DMG] }
          [1722927891.728] [30554:30556] [TOO] Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0001 DataVersion: 1761848625
          [1722927891.729] [30554:30556] [TOO]   CurrentPosition: 0


          Repeat the above Steps over 1 minute period of time by changing the New Position 1 to 0 and 0 to 1. AND DUT reads Current position value regularly.
      disabled: true

    - label:
          "Step 2b: TH simulates operation of the switch by changing state
          (attribute CurrentPosition) from 0 to 1 and back every 10 seconds
          (over a 1 minute period), and sending the event SwitchLatched (with
          field NewPosition reflecting the new state) on every change"
      PICS: SWTCH.C.F00 && SWTCH.C.M.SwitchStateEventing
      verification: |
          On Raspi platform to trigger the event give the below command by opening an another terminal in DUT (Below is the example command developed in all-clusters-app to generate the event, Vendor DUT should have capability to generate this event)

          echo '{"Name":"SwitchLatched","NewPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify SwitchLatched event with NewPosition set to 1 on TH(all-cluster-app) log:

          [1659621148.831745][8590:8596] CHIP:-: Received payload: "{"Name":"SwitchLatched","NewPosition":1}"
          [1659621148.832236][8590:8590] CHIP:DMG: Endpoint 1, Cluster 0x0000_003B update version to 4be58f54
          [1659621148.832320][8590:8590] CHIP:-: The latching switch is moved to a new position:1
          [1659621148.832380][8590:8590] CHIP:ZCL: SwitchServer: OnSwitchLatch
          [1659621148.832494][8590:8590] CHIP:EVL: LogEvent event number: 0x0000000000000007 priority: 1, endpoint id:  0x1 cluster id: 0x0000_003B event id: 0x0 Sys timestamp: 0x00000000022D0CBB

          Send the SwitchLatched event on every change of position

          ./chip-tool switch read-event switch-latched  1 1

          Verify SwitchLatched event with NewPosition is changing for 0 to 1 on DUT(chip-tool) Log:

          [1722928087.971] [30606:30608] [DMG]         SuppressResponse = true,
          [1722928087.971] [30606:30608] [DMG]         InteractionModelRevision = 11
          [1722928087.972] [30606:30608] [DMG] }
          [1722928087.972] [30606:30608] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0000
          [1722928087.972] [30606:30608] [TOO]   Event number: 65540
          [1722928087.973] [30606:30608] [TOO]   Priority: Info
          [1722928087.973] [30606:30608] [TOO]   Timestamp: 1722927614282
          [1722928087.973] [30606:30608] [TOO]   SwitchLatched: {
          [1722928087.973] [30606:30608] [TOO]     NewPosition: 0
          [1722928087.973] [30606:30608] [TOO]    }
          [1722928087.973] [30606:30608] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0000
          [1722928087.974] [30606:30608] [TOO]   Event number: 65541
          [1722928087.974] [30606:30608] [TOO]   Priority: Info
          [1722928087.974] [30606:30608] [TOO]   Timestamp: 1722927671837
          [1722928087.974] [30606:30608] [TOO]   SwitchLatched: {
          [1722928087.974] [30606:30608] [TOO]     NewPosition: 1
          [1722928087.974] [30606:30608] [TOO]    }
          [1722928087.974] [30606:30608] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0000
          [1722928087.974] [30606:30608] [TOO]   Event number: 65542
          [1722928087.974] [30606:30608] [TOO]   Priority: Info
          [1722928087.975] [30606:30608] [TOO]   Timestamp: 1722927866804
          [1722928087.975] [30606:30608] [TOO]   SwitchLatched: {
          [1722928087.975] [30606:30608] [TOO]     NewPosition: 0
          [1722928087.975] [30606:30608] [TOO]    }
          [1722928087.975] [30606:30608] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0000
          [1722928087.975] [30606:30608] [TOO]   Event number: 65543
          [1722928087.975] [30606:30608] [TOO]   Priority: Info
          [1722928087.975] [30606:30608] [TOO]   Timestamp: 1722928067383
          [1722928087.975] [30606:30608] [TOO]   SwitchLatched: {
          [1722928087.976] [30606:30608] [TOO]     NewPosition: 1
          [1722928087.976] [30606:30608] [TOO]    }


          After 10 seconds, Send the above commands with NewPosition set to 0

          echo '{"Name":"SwitchLatched","NewPosition":0}' > /tmp/chip_all_clusters_fifo_<PID>

          Verify SwitchLatched event with NewPosition set to 0 on TH(all-cluster-app) log:

          [1722602668.258] [211132:211134] [-] Received payload: "{"Name":"SwitchLatched","NewPosition":0}"
          [1722602668.258] [211132:211132] [-] The latching switch is moved to a new position:0
          [1722602668.258] [211132:211132] [ZCL] SwitchServer: OnSwitchLatch

          ./chip-tool switch read-event switch-latched  1 1

          Verify SwitchLatched event with NewPosition is changing for 1 to 0 on DUT(chip-tool) Log:

          [1722928245.303] [30654:30656] [DMG]         SuppressResponse = true,
          [1722928245.303] [30654:30656] [DMG]         InteractionModelRevision = 11
          [1722928245.303] [30654:30656] [DMG] }
          [1722928245.304] [30654:30656] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0000
          [1722928245.304] [30654:30656] [TOO]   Event number: 65540
          [1722928245.304] [30654:30656] [TOO]   Priority: Info
          [1722928245.304] [30654:30656] [TOO]   Timestamp: 1722927614282
          [1722928245.305] [30654:30656] [TOO]   SwitchLatched: {
          [1722928245.305] [30654:30656] [TOO]     NewPosition: 0
          [1722928245.305] [30654:30656] [TOO]    }
          [1722928245.305] [30654:30656] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0000
          [1722928245.305] [30654:30656] [TOO]   Event number: 65541
          [1722928245.305] [30654:30656] [TOO]   Priority: Info
          [1722928245.305] [30654:30656] [TOO]   Timestamp: 1722927671837
          [1722928245.306] [30654:30656] [TOO]   SwitchLatched: {
          [1722928245.306] [30654:30656] [TOO]     NewPosition: 1
          [1722928245.306] [30654:30656] [TOO]    }
          [1722928245.306] [30654:30656] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0000
          [1722928245.306] [30654:30656] [TOO]   Event number: 65542
          [1722928245.306] [30654:30656] [TOO]   Priority: Info
          [1722928245.306] [30654:30656] [TOO]   Timestamp: 1722927866804
          [1722928245.306] [30654:30656] [TOO]   SwitchLatched: {
          [1722928245.307] [30654:30656] [TOO]     NewPosition: 0
          [1722928245.307] [30654:30656] [TOO]    }
          [1722928245.307] [30654:30656] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0000
          [1722928245.307] [30654:30656] [TOO]   Event number: 65543
          [1722928245.307] [30654:30656] [TOO]   Priority: Info
          [1722928245.307] [30654:30656] [TOO]   Timestamp: 1722928067383
          [1722928245.307] [30654:30656] [TOO]   SwitchLatched: {
          [1722928245.307] [30654:30656] [TOO]     NewPosition: 1
          [1722928245.307] [30654:30656] [TOO]    }
          [1722928245.308] [30654:30656] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0000
          [1722928245.308] [30654:30656] [TOO]   Event number: 65544
          [1722928245.308] [30654:30656] [TOO]   Priority: Info
          [1722928245.308] [30654:30656] [TOO]   Timestamp: 1722928209578
          [1722928245.308] [30654:30656] [TOO]   SwitchLatched: {
          [1722928245.308] [30654:30656] [TOO]     NewPosition: 0
          [1722928245.308] [30654:30656] [TOO]    }



          Repeat above Steps back every 10 seconds (over a 1 minute period) by changing the New Position 1 to 0 and 0 to 1
      disabled: true

    - label:
          "Step 3a: Commission DUT to TH. Use client mechanism to set it up so
          switch state can be observed (e.g. UI shows state of switch) and/or
          other device is controlled (e.g. light on same fabric gets controlled
          by the switch  TH has to simulate that light). While commissioning and
          configuring, TH records and reacts to the messages relating to the
          switch functionality detailed in the steps below. The order of the
          messages received may be different from the order of the sub-steps
          3b..3d below."
      PICS: SWTCH.C.F01
      verification: |

      disabled: true

    - label: "Step 3b: DUT reads global attribute FeatureMap"
      PICS: SWTCH.C.F01
      verification: |
          Note : Please skip this step if LATCH SWITCH feature is implemented, because a device can support either a latching switch(LS) or MS, MSR, MSL, MSM or MS, MSL, MSM, AS

          ./chip-tool switch read feature-map 1 1

          Verify  FeatureMap value is 30 If  (MS, MSR, MSL, MSM) features are supported or
            Value is 58 If (MS, MSL, MSM, AS) feature are supported On TH (all-clusters-app) log

          CHIP:DMG: ReportDataMessage =
          [1671450600.457719][8426:8426] CHIP:DMG: {
          [1671450600.457728][8426:8426] CHIP:DMG:         AttributeReportIBs =
          [1671450600.457747][8426:8426] CHIP:DMG:         [
          [1671450600.457756][8426:8426] CHIP:DMG:                 AttributeReportIB =
          [1671450600.457954][8426:8426] CHIP:DMG:                 {
          [1671450600.457976][8426:8426] CHIP:DMG:                         AttributeDataIB =
          [1671450600.457991][8426:8426] CHIP:DMG:                         {
          [1671450600.458015][8426:8426] CHIP:DMG:                                 DataVersion = 0xcfe432fa,
          [1671450600.458038][8426:8426] CHIP:DMG:                                 AttributePathIB =
          [1671450600.458057][8426:8426] CHIP:DMG:                                 {
          [1671450600.458075][8426:8426] CHIP:DMG:                                         Endpoint = 0x1,
          [1671450600.458088][8426:8426] CHIP:DMG:                                         Cluster = 0x3b,
          [1671450600.458108][8426:8426] CHIP:DMG:                                         Attribute = 0x0000_FFFC,
          [1671450600.458122][8426:8426] CHIP:DMG:                                 }
          [1671450600.458137][8426:8426] CHIP:DMG:
          [1671450600.458151][8426:8426] CHIP:DMG:                                 Data = 58,
          [1671450600.458161][8426:8426] CHIP:DMG:                         },
          [1671450600.458179][8426:8426] CHIP:DMG:
          [1671450600.458188][8426:8426] CHIP:DMG:                 },
          [1671450600.458207][8426:8426] CHIP:DMG:
          [1671450600.458216][8426:8426] CHIP:DMG:         ],
          [1671450600.458242][8426:8426] CHIP:DMG:
          [1671450600.458255][8426:8426] CHIP:DMG:         SuppressResponse = true,
          [1671450600.458273][8426:8426] CHIP:DMG:         InteractionModelRevision = 1
          [1671450600.458286][8426:8426] CHIP:DMG: }
      disabled: true

    - label: "Step 3c: DUT reads attribute NumberOfPositions"
      PICS: SWTCH.C.F01
      verification: |
          ./chip-tool switch read number-of-positions 1 1

          Verify NumberOfPositions value is 2 On TH (all-clusters-app) log

          DMG: ReportDataMessage =
          [1671450651.817816][8426:8426] CHIP:DMG: {
          [1671450651.817819][8426:8426] CHIP:DMG:         AttributeReportIBs =
          [1671450651.817825][8426:8426] CHIP:DMG:         [
          [1671450651.817828][8426:8426] CHIP:DMG:                 AttributeReportIB =
          [1671450651.817849][8426:8426] CHIP:DMG:                 {
          [1671450651.817853][8426:8426] CHIP:DMG:                         AttributeDataIB =
          [1671450651.817858][8426:8426] CHIP:DMG:                         {
          [1671450651.817862][8426:8426] CHIP:DMG:                                 DataVersion = 0xcfe432fa,
          [1671450651.817864][8426:8426] CHIP:DMG:                                 AttributePathIB =
          [1671450651.817868][8426:8426] CHIP:DMG:                                 {
          [1671450651.817872][8426:8426] CHIP:DMG:                                         Endpoint = 0x1,
          [1671450651.817876][8426:8426] CHIP:DMG:                                         Cluster = 0x3b,
          [1671450651.817879][8426:8426] CHIP:DMG:                                         Attribute = 0x0000_0000,
          [1671450651.817882][8426:8426] CHIP:DMG:                                 }
          [1671450651.817888][8426:8426] CHIP:DMG:
          [1671450651.817892][8426:8426] CHIP:DMG:                                 Data = 2,
          [1671450651.817895][8426:8426] CHIP:DMG:                         },
          [1671450651.817901][8426:8426] CHIP:DMG:
          [1671450651.817905][8426:8426] CHIP:DMG:                 },
          [1671450651.817910][8426:8426] CHIP:DMG:
          [1671450651.817913][8426:8426] CHIP:DMG:         ],
          [1671450651.817918][8426:8426] CHIP:DMG:
          [1671450651.817921][8426:8426] CHIP:DMG:         SuppressResponse = true,
          [1671450651.817925][8426:8426] CHIP:DMG:         InteractionModelRevision = 1
          [1671450651.817928][8426:8426] CHIP:DMG: }
      disabled: true

    - label:
          "Step 3d: DUT subscribes to all switch events on the endpoint, so it
          will receive events when the switch is operated"
      PICS: SWTCH.C.F01 && SWTCH.C.M.SwitchStateEventing
      verification: |
          Note : Please skip this step if LATCH SWITCH feature is implemented, because a device can support either a latching switch or a momentary switch.

          On Raspi platform to trigger the event give the below command by opening an another terminal in DUT (Below is the example command developed in all-clusters-app to generate the event, Vendor DUT should have capability to generate this event)

          echo '{"Name":"InitialPress","NewPosition":0}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify InitialPress event with NewPosition set to 0 on TH(all-cluster-app) log:

          [1659624126.646996][8590:8596] CHIP:-: Received payload: "{"Name":"InitialPress","NewPosition":0}"
          [1659624126.647380][8590:8590] CHIP:DMG: Endpoint 1, Cluster 0x0000_003B update version to 4be58f55
          [1659624126.647438][8590:8590] CHIP:-: The new position when the momentary switch starts to be pressed:1
          [1659624126.647480][8590:8590] CHIP:ZCL: SwitchServer: OnInitialPress

          ./chip-tool switch read-event initial-press  1 1

          Verify InitialPress event with NewPosition set to 0 on DUT(chip-tool) log:

          [1722928508.108] [30722:30724] [DMG]         SuppressResponse = true,
          [1722928508.108] [30722:30724] [DMG]         InteractionModelRevision = 11
          [1722928508.108] [30722:30724] [DMG] }
          [1722928508.109] [30722:30724] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0001
          [1722928508.109] [30722:30724] [TOO]   Event number: 65545
          [1722928508.109] [30722:30724] [TOO]   Priority: Info
          [1722928508.109] [30722:30724] [TOO]   Timestamp: 1722928471541
          [1722928508.110] [30722:30724] [TOO]   InitialPress: {
          [1722928508.110] [30722:30724] [TOO]     NewPosition: 0
          [1722928508.110] [30722:30724] [TOO]    }

          echo '{"Name":"ShortRelease","PreviousPosition":0}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify ShortRelease event with PreviousPosition set to 0 on TH(all-cluster-app) log:

          [1722928571.190] [29970:29972] [-] Received payload: "{"Name":"ShortRelease","PreviousPosition":0}"
          [1722928571.191] [29970:29970] [-] The the previous value of the CurrentPosition when the momentary switch has been released:0
          [1722928571.191] [29970:29970] [ZCL] SwitchServer: OnShortRelease

          ./chip-tool switch read-event short-release  1 1

          Verify ShortRelease event with PreviousPosition set to 0 on DUT(chip-tool) log:

          [1722928663.399] [30761:30763] [DMG]         SuppressResponse = true,
          [1722928663.399] [30761:30763] [DMG]         InteractionModelRevision = 11
          [1722928663.399] [30761:30763] [DMG] }
          [1722928663.400] [30761:30763] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0003
          [1722928663.400] [30761:30763] [TOO]   Event number: 65546
          [1722928663.400] [30761:30763] [TOO]   Priority: Info
          [1722928663.400] [30761:30763] [TOO]   Timestamp: 1722928571191
          [1722928663.400] [30761:30763] [TOO]   ShortRelease: {
          [1722928663.400] [30761:30763] [TOO]     PreviousPosition: 0
          [1722928663.400] [30761:30763] [TOO]    }


          echo '{"Name":"LongPress","NewPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify LongPress event with NewPosition set to 1 on TH(all-cluster-app) log:

          [1722928724.336] [29970:29972] [-] Received payload: "{"Name":"LongPress","NewPosition":1}"
          [1722928724.336] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad34
          [1722928724.337] [29970:29970] [-] The new position when the momentary switch has been pressed for a long time:1
          [1722928724.337] [29970:29970] [ZCL] SwitchServer: OnLongPress

          ./chip-tool switch read-event long-press  1 1

          Verify LongPress event with NewPosition set to 1 on DUT(chip-tool) log:

          [1722928792.354] [30803:30805] [DMG]         SuppressResponse = true,
          [1722928792.354] [30803:30805] [DMG]         InteractionModelRevision = 11
          [1722928792.354] [30803:30805] [DMG] }
          [1722928792.354] [30803:30805] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0002
          [1722928792.354] [30803:30805] [TOO]   Event number: 65547
          [1722928792.355] [30803:30805] [TOO]   Priority: Info
          [1722928792.355] [30803:30805] [TOO]   Timestamp: 1722928724337
          [1722928792.355] [30803:30805] [TOO]   LongPress: {
          [1722928792.355] [30803:30805] [TOO]     NewPosition: 1
          [1722928792.355] [30803:30805] [TOO]    }

          echo '{"Name":"LongRelease","PreviousPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify LongRelease event with PreviousPosition set to 1 on TH(all-cluster-app) log:

          [1722928835.353] [29970:29972] [-] Received payload: "{"Name":"LongRelease","PreviousPosition":1}"
          [1722928835.354] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad35
          [1722928835.354] [29970:29970] [-] The the previous value of the CurrentPosition when the momentary switch has been released after having been pressed for a long time:1
          [1722928835.354] [29970:29970] [ZCL] SwitchServer: OnLongRelease


          ./chip-tool switch read-event long-release  1 1

          Verify LongRelease event with PreviousPosition set to 1 on DUT(chip-tool) log:

          [1722928919.331] [30840:30842] [DMG]         SuppressResponse = true,
          [1722928919.331] [30840:30842] [DMG]         InteractionModelRevision = 11
          [1722928919.331] [30840:30842] [DMG] }
          [1722928919.332] [30840:30842] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0004
          [1722928919.332] [30840:30842] [TOO]   Event number: 65550
          [1722928919.332] [30840:30842] [TOO]   Priority: Info
          [1722928919.332] [30840:30842] [TOO]   Timestamp: 1722928835354
          [1722928919.332] [30840:30842] [TOO]   LongRelease: {
          [1722928919.332] [30840:30842] [TOO]     PreviousPosition: 1
          [1722928919.332] [30840:30842] [TOO]    }
      disabled: true

    - label:
          "Step 4a: TH simulates operation of the switch by repeating these
          steps (over a 1 minute period) change state (attribute
          CurrentPosition) from 0 to 1 wait 0.2 seconds change state (attribute
          CurrentPosition) from 1 to 0 wait 10 seconds DUT reads attribute
          CurrentPosition regularly"
      PICS: SWTCH.C.F01 && SWTCH.C.M.SwitchStatePolling
      verification: |
          Note : Please skip this step if LATCH SWITCH feature is implemented, because a device can support either a latching switch or a momentary switch.

          On Raspi platform to trigger the event give the below command by opening an another terminal in DUT (Below is the example command developed in all-clusters-app to generate the event, Vendor DUT should have capability to generate this event)

          Change the Current Position from 0 to 1

          echo '{"Name":"InitialPress","NewPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify InitialPress event with NewPosition set to 1 on TH(all-cluster-app) log:

          [1722929050.475] [29970:29972] [-] Received payload: "{"Name":"InitialPress","NewPosition":1}"
          [1722929050.476] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad36
          [1722929050.476] [29970:29970] [-] The new position when the momentary switch starts to be pressed:1
          [1722929050.476] [29970:29970] [ZCL] SwitchServer: OnInitialPress

          DUT Reads the CurrentPosition attribute

          ./chip-tool switch read current-position 1 1

          Verify CurrentPosition value is 1 On DUT(Chip-tool) log

          [1722929078.688] [30886:30888] [DMG] }
          [1722929078.688] [30886:30888] [TOO] Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0001 DataVersion: 1761848630
          [1722929078.689] [30886:30888] [TOO]   CurrentPosition: 1

          Wait 0.2 seconds, send this command

          echo '{"Name":"InitialPress","NewPosition":0}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify InitialPress event with NewPosition set to 0 on TH(all-cluster-app) log:

          [1722929478.278] [29970:29972] [-] Received payload: "{"Name":"InitialPress","NewPosition":0}"
          [1722929478.279] [29970:29970] [-] The new position when the momentary switch starts to be pressed:0
          [1722929478.279] [29970:29970] [ZCL] SwitchServer: OnInitialPress

          DUT Reads the CurrentPosition attribute

          ./chip-tool switch read current-position 1 1

          Verify CurrentPosition value is 0 On DUT(Chip-tool) log

          [1722929193.246] [30917:30919] [DMG] }
          [1722929193.247] [30917:30919] [TOO] Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0001 DataVersion: 1761848631
          [1722929193.247] [30917:30919] [TOO]   CurrentPosition: 0


          Wait 10 seconds

          Repeat above steps over 1 minute period of time and DUT reads attribute CurrentPosition regularly.
      disabled: true

    - label:
          "Step 4b: TH simulates operation of the switch by repeating these
          steps (over a 1 minute period) change state (attribute
          CurrentPosition) from 0 to 1, and send the event InitialPress (with
          field NewPosition=1) wait 0.2 seconds change state (attribute
          CurrentPosition) from 1 to 0, and send the event ShortRelease (with
          field PreviousPosition=1) wait 10 seconds"
      PICS: SWTCH.C.F01 && SWTCH.C.M.SwitchStateEventing
      verification: |
          Note : Please skip this step if LATCH SWITCH feature is implemented, because a device can support either a latching switch or a momentary switch.

          On Raspi platform to trigger the event give the below command by opening an another terminal in DUT (Below is the example command developed in all-clusters-app to generate the event, Vendor DUT should have capability to generate this event)

          echo '{"Name":"InitialPress","NewPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify InitialPress event with NewPosition set to 1 on TH(all-cluster-app) log:

          [1722929575.814] [29970:29972] [-] Received payload: "{"Name":"InitialPress","NewPosition":1}"
          [1722929575.815] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad38
          [1722929575.815] [29970:29970] [-] The new position when the momentary switch starts to be pressed:1
          [1722929575.815] [29970:29970] [ZCL] SwitchServer: OnInitialPress

          ./chip-tool switch read-event initial-press  1 1

          Verify InitialPress event with NewPosition set to 1 on DUT(chip-tool) log:

          [1722929640.653] [31031:31033] [DMG]         SuppressResponse = true,
          [1722929640.653] [31031:31033] [DMG]         InteractionModelRevision = 11
          [1722929640.653] [31031:31033] [DMG] }
          [1722929640.655] [31031:31033] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0001
          [1722929640.655] [31031:31033] [TOO]   Event number: 65553
          [1722929640.655] [31031:31033] [TOO]   Priority: Info
          [1722929640.655] [31031:31033] [TOO]   Timestamp: 1722929478279
          [1722929640.655] [31031:31033] [TOO]   InitialPress: {
          [1722929640.655] [31031:31033] [TOO]     NewPosition: 0
          [1722929640.655] [31031:31033] [TOO]    }
          [1722929640.655] [31031:31033] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0001
          [1722929640.655] [31031:31033] [TOO]   Event number: 65554
          [1722929640.655] [31031:31033] [TOO]   Priority: Info
          [1722929640.655] [31031:31033] [TOO]   Timestamp: 1722929575815
          [1722929640.655] [31031:31033] [TOO]   InitialPress: {
          [1722929640.656] [31031:31033] [TOO]     NewPosition: 1
          [1722929640.656] [31031:31033] [TOO]    }

          After 0.2 seconds, send this command

          echo '{"Name":"ShortRelease","PreviousPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify ShortRelease event with PreviousPosition set to 1 on TH(all-cluster-app) log:

          [1722929693.191] [29970:29972] [-] Received payload: "{"Name":"ShortRelease","PreviousPosition":1}"
          [1722929693.192] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad39
          [1722929693.192] [29970:29970] [-] The the previous value of the CurrentPosition when the momentary switch has been released:1
          [1722929693.192] [29970:29970] [ZCL] SwitchServer: OnShortRelease


          ./chip-tool switch read-event short-release  1 1

          Verify ShortRelease event with PreviousPosition set to 1 on DUT(chip-tool) log:

          [1722929736.542] [31062:31064] [DMG]         SuppressResponse = true,
          [1722929736.542] [31062:31064] [DMG]         InteractionModelRevision = 11
          [1722929736.542] [31062:31064] [DMG] }
          [1722929736.542] [31062:31064] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0003
          [1722929736.542] [31062:31064] [TOO]   Event number: 65546
          [1722929736.542] [31062:31064] [TOO]   Priority: Info
          [1722929736.542] [31062:31064] [TOO]   Timestamp: 1722928571191
          [1722929736.543] [31062:31064] [TOO]   ShortRelease: {
          [1722929736.543] [31062:31064] [TOO]     PreviousPosition: 0
          [1722929736.543] [31062:31064] [TOO]    }
          [1722929736.543] [31062:31064] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0003
          [1722929736.543] [31062:31064] [TOO]   Event number: 65552
          [1722929736.543] [31062:31064] [TOO]   Priority: Info
          [1722929736.543] [31062:31064] [TOO]   Timestamp: 1722929159932
          [1722929736.543] [31062:31064] [TOO]   ShortRelease: {
          [1722929736.543] [31062:31064] [TOO]     PreviousPosition: 1
          [1722929736.543] [31062:31064] [TOO]    }
          [1722929736.544] [31062:31064] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0003
          [1722929736.544] [31062:31064] [TOO]   Event number: 65555
          [1722929736.544] [31062:31064] [TOO]   Priority: Info
          [1722929736.544] [31062:31064] [TOO]   Timestamp: 1722929693192
          [1722929736.544] [31062:31064] [TOO]   ShortRelease: {
          [1722929736.544] [31062:31064] [TOO]     PreviousPosition: 1
          [1722929736.544] [31062:31064] [TOO]    }


          Wait 10 Seconds

          Repeat above steps over a 1 minute period of time.
      disabled: true

    - label:
          "Step 4c: TH simulates operation of the switch by repeating these
          steps (over a 1 minute period) change state (field CurrentPosition)
          from 0 to 1, and send the event InitialPress (with field
          NewPosition=1) wait 0.75 seconds send the event LongPress (field
          NewPosition=1) wait 2 seconds change state (field CurrentPosition)
          from 1 to 0, and send the event LongRelease (with field
          PreviousPosition=1) wait 8 seconds"
      PICS: SWTCH.C.F01 && SWTCH.C.F03 && SWTCH.C.M.SwitchStateEventing
      verification: |
          Note : Please skip this step if LATCH SWITCH feature is implemented, because a device can support either a latching switch or a momentary switch.

          On Raspi platform to trigger the event give the below command by opening an another terminal in DUT (Below is the example command developed in all-clusters-app to generate the event, Vendor DUT should have capability to generate this event)

          echo '{"Name":"InitialPress","NewPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify InitialPress event with NewPosition set to 1 on TH(all-cluster-app) log:

          [1722929829.295] [29970:29972] [-] Received payload: "{"Name":"InitialPress","NewPosition":1}"
          [1722929829.296] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad3a
          [1722929829.296] [29970:29970] [-] The new position when the momentary switch starts to be pressed:1
          [1722929829.296] [29970:29970] [ZCL] SwitchServer: OnInitialPress

          ./chip-tool switch read-event initial-press   1 1

          Verify InitialPress event with NewPosition set to 1 on DUT(chip-tool) log:

          [1722929860.240] [31102:31104] [DMG]         SuppressResponse = true,
          [1722929860.240] [31102:31104] [DMG]         InteractionModelRevision = 11
          [1722929860.240] [31102:31104] [DMG] }
          [1722929860.242] [31102:31104] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0001
          [1722929860.242] [31102:31104] [TOO]   Event number: 65553
          [1722929860.242] [31102:31104] [TOO]   Priority: Info
          [1722929860.242] [31102:31104] [TOO]   Timestamp: 1722929478279
          [1722929860.242] [31102:31104] [TOO]   InitialPress: {
          [1722929860.242] [31102:31104] [TOO]     NewPosition: 0
          [1722929860.242] [31102:31104] [TOO]    }
          [1722929860.243] [31102:31104] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0001
          [1722929860.243] [31102:31104] [TOO]   Event number: 65554
          [1722929860.243] [31102:31104] [TOO]   Priority: Info
          [1722929860.243] [31102:31104] [TOO]   Timestamp: 1722929575815
          [1722929860.243] [31102:31104] [TOO]   InitialPress: {
          [1722929860.243] [31102:31104] [TOO]     NewPosition: 1
          [1722929860.243] [31102:31104] [TOO]    }
          [1722929860.243] [31102:31104] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0001
          [1722929860.243] [31102:31104] [TOO]   Event number: 65557
          [1722929860.243] [31102:31104] [TOO]   Priority: Info
          [1722929860.243] [31102:31104] [TOO]   Timestamp: 1722929829296
          [1722929860.243] [31102:31104] [TOO]   InitialPress: {
          [1722929860.243] [31102:31104] [TOO]     NewPosition: 1
          [1722929860.243] [31102:31104] [TOO]    }

          After 0.75 seconds, send below command

          echo '{"Name":"LongPress","NewPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify LongPress event with NewPosition set to 1 on TH(all-cluster-app) log:

          [1722929918.639] [29970:29972] [-] Received payload: "{"Name":"LongPress","NewPosition":1}"
          [1722929918.640] [29970:29970] [-] The new position when the momentary switch has been pressed for a long time:1
          [1722929918.640] [29970:29970] [ZCL] SwitchServer: OnLongPress


          ./chip-tool switch read-event long-press 1 1

          Verify LongPress event with NewPosition set to 1 on DUT(chip-tool) log:

          [1722929958.750] [31129:31132] [DMG]         SuppressResponse = true,
          [1722929958.750] [31129:31132] [DMG]         InteractionModelRevision = 11
          [1722929958.750] [31129:31132] [DMG] }
          [1722929958.751] [31129:31132] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0002
          [1722929958.751] [31129:31132] [TOO]   Event number: 65547
          [1722929958.751] [31129:31132] [TOO]   Priority: Info
          [1722929958.751] [31129:31132] [TOO]   Timestamp: 1722928724337
          [1722929958.751] [31129:31132] [TOO]   LongPress: {
          [1722929958.751] [31129:31132] [TOO]     NewPosition: 1
          [1722929958.751] [31129:31132] [TOO]    }
          [1722929958.751] [31129:31132] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0002
          [1722929958.752] [31129:31132] [TOO]   Event number: 65558
          [1722929958.752] [31129:31132] [TOO]   Priority: Info
          [1722929958.752] [31129:31132] [TOO]   Timestamp: 1722929918640
          [1722929958.752] [31129:31132] [TOO]   LongPress: {
          [1722929958.752] [31129:31132] [TOO]     NewPosition: 1
          [1722929958.752] [31129:31132] [TOO]    }

          After 2 seconds, send below command

          echo '{"Name":"LongRelease","PreviousPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify LonglRelease event with PreviousPosition set to 1 on TH(all-cluster-app) log:

          [1722930012.664] [29970:29972] [-] Received payload: "{"Name":"LongRelease","PreviousPosition":1}"
          [1722930012.664] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad3b
          [1722930012.664] [29970:29970] [-] The the previous value of the CurrentPosition when the momentary switch has been released after having been pressed for a long time:1
          [1722930012.664] [29970:29970] [ZCL] SwitchServer: OnLongRelease


          ./chip-tool  switch read-event long-release 1 1

          Verify LonglRelease event with PreviousPosition set to 1 on DUT(chip-tool) log:

          [1722930054.350] [31160:31162] [DMG]         SuppressResponse = true,
          [1722930054.351] [31160:31162] [DMG]         InteractionModelRevision = 11
          [1722930054.351] [31160:31162] [DMG] }
          [1722930054.351] [31160:31162] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0004
          [1722930054.351] [31160:31162] [TOO]   Event number: 65550
          [1722930054.351] [31160:31162] [TOO]   Priority: Info
          [1722930054.351] [31160:31162] [TOO]   Timestamp: 1722928835354
          [1722930054.352] [31160:31162] [TOO]   LongRelease: {
          [1722930054.352] [31160:31162] [TOO]     PreviousPosition: 1
          [1722930054.352] [31160:31162] [TOO]    }
          [1722930054.352] [31160:31162] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0004
          [1722930054.352] [31160:31162] [TOO]   Event number: 65561
          [1722930054.352] [31160:31162] [TOO]   Priority: Info
          [1722930054.352] [31160:31162] [TOO]   Timestamp: 1722930012664
          [1722930054.352] [31160:31162] [TOO]   LongRelease: {
          [1722930054.352] [31160:31162] [TOO]     PreviousPosition: 1
          [1722930054.352] [31160:31162] [TOO]    }


          Wait 8 seconds

          Repeat above steps Over a 1 minute period of time
      disabled: true

    - label:
          "Step 4d: TH simulates operation of the switch by repeating these
          steps (over a 1 minute period) change state (field CurrentPosition)
          from 0 to 1, and send the event InitialPress (with field
          NewPosition=1) wait 0.2 seconds change state (attribute
          CurrentPosition) from 1 to 0, and send the event ShortRelease (with
          field PreviousPosition=1) wait 0.2 seconds change state (field
          CurrentPosition) from 0 to 1, and send the event InitialPress (with
          field NewPosition=1) and event MultiPressOngoing(with field
          NewPosition=1 and CurrentNumberOfPressesCounted=2) wait 0.2 seconds
          change state (field CurrentPosition) from 1 to 0, and send the event
          ShortRelease (with field PreviousPosition=1) wait 2 seconds send the
          event MultiPressComplete (with field PreviousPosition=1 and
          TotalNumberOfPressesCounted=2)"
      PICS:
          " SWTCH.C.F01 && SWTCH.C.F04 && !SWTCH.C.F05 &&
          SWTCH.C.M.SwitchStateEventing "
      verification: |
          On Raspi platform to trigger the event give the below command by opening an another terminal in DUT (Below is the example command developed in all-clusters-app to generate the event, Vendor DUT should have capability to generate this event)

          echo '{"Name":"InitialPress","NewPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify InitialPress event with NewPosition set to 1 on TH(all-cluster-app) log:

          [1686295316.319181][30986:30989] CHIP:-: Received payload: "{"Name":"InitialPress","NewPosition":1}"
          [1686295316.319478][30986:30986] CHIP:DMG: Endpoint 1, Cluster 0x0000_003B update version to bae4056b
          [1686295316.319509][30986:30986] CHIP:-: The new position when the momentary switch starts to be pressed:1
          [1686295316.319518][30986:30986] CHIP:ZCL: SwitchServer: OnInitialPress

          ./chip-tool switch read-event initial-press   1 1

          Verify InitialPress event with NewPosition set to 1 on DUT(chip-tool) log:

          [1722930199.094] [31214:31216] [DMG]         SuppressResponse = true,
          [1722930199.094] [31214:31216] [DMG]         InteractionModelRevision = 11
          [1722930199.094] [31214:31216] [DMG] }
          [1722930199.098] [31214:31216] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0001
          [1722930199.098] [31214:31216] [TOO]   Event number: 65562
          [1722930199.098] [31214:31216] [TOO]   Priority: Info
          [1722930199.098] [31214:31216] [TOO]   Timestamp: 1722930190865
          [1722930199.098] [31214:31216] [TOO]   InitialPress: {
          [1722930199.098] [31214:31216] [TOO]     NewPosition: 1
          [1722930199.098] [31214:31216] [TOO]    }


          wait 0.2 seconds

          echo '{"Name":"ShortRelease","PreviousPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>

          Verify ShortRelease event with PreviousPosition set to 1 on TH(all-cluster-app) log:

          [1722930266.048] [29970:29972] [-] Received payload: "{"Name":"ShortRelease","PreviousPosition":1}"
          [1722930266.049] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad3d
          [1722930266.049] [29970:29970] [-] The the previous value of the CurrentPosition when the momentary switch has been released:1
          [1722930266.049] [29970:29970] [ZCL] SwitchServer: OnShortRelease


          ./chip-tool switch read-event short-release  1 1

          Verify ShortRelease event with PreviousPosition set to 1 on DUT(Chip-tool) log:

          [1722930314.978] [31255:31258] [DMG]         SuppressResponse = true,
          [1722930314.978] [31255:31258] [DMG]         InteractionModelRevision = 11
          [1722930314.978] [31255:31258] [DMG] }
          [1722930314.982] [31255:31258] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0003
          [1722930314.982] [31255:31258] [TOO]   Event number: 65563
          [1722930314.982] [31255:31258] [TOO]   Priority: Info
          [1722930314.982] [31255:31258] [TOO]   Timestamp: 1722930266049
          [1722930314.982] [31255:31258] [TOO]   ShortRelease: {
          [1722930314.983] [31255:31258] [TOO]     PreviousPosition: 1
          [1722930314.983] [31255:31258] [TOO]    }


          wait 0.2 seconds

          echo '{"Name":"InitialPress","NewPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>  (PID of DUT)

          Verify InitialPress event with NewPosition set to 1 on TH(all-cluster-app) log:

          [1722930385.505] [29970:29972] [-] Received payload: "{"Name":"InitialPress","NewPosition":1}"
          [1722930385.505] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad3e
          [1722930385.505] [29970:29970] [-] The new position when the momentary switch starts to be pressed:1
          [1722930385.505] [29970:29970] [ZCL] SwitchServer: OnInitialPress

          ./chip-tool switch read-event initial-press   1 1

          Verify InitialPress event with NewPosition set to 1 on DUT(chip-tool) log:

          [1722930430.195] [31290:31292] [DMG]         SuppressResponse = true,
          [1722930430.195] [31290:31292] [DMG]         InteractionModelRevision = 11
          [1722930430.195] [31290:31292] [DMG] }
          [1722930430.200] [31290:31292] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0001
          [1722930430.200] [31290:31292] [TOO]   Event number: 65564
          [1722930430.200] [31290:31292] [TOO]   Priority: Info
          [1722930430.200] [31290:31292] [TOO]   Timestamp: 1722930385505
          [1722930430.200] [31290:31292] [TOO]   InitialPress: {
          [1722930430.200] [31290:31292] [TOO]     NewPosition: 1
          [1722930430.200] [31290:31292] [TOO]    }


          echo '{"Name":"MultiPressOngoing","NewPosition":1,"CurrentNumberOfPressesCounted":2}' > /tmp/chip_all_clusters_fifo_<PID>

          Verify MultiPressOngoing event with NewPosition set to 1 and CurrentNumberOfPressesCounted is 2 on TH(all-cluster-app) log:

          [1722930734.450] [29970:29972] [-] Received payload: "{"Name":"MultiPressOngoing","NewPosition":1,"CurrentNumberOfPressesCounted":2}"
          [1722930734.450] [29970:29970] [-] The new position when the momentary switch has been pressed in a multi-press sequence:1
          [1722930734.451] [29970:29970] [-] 2 times the momentary switch has been pressed
          [1722930734.451] [29970:29970] [ZCL] SwitchServer: OnMultiPressOngoing


          ./chip-tool switch read-event multi-press-ongoing 1 1

          Verify MultiPressOngoing event with NewPosition set to 1 and CurrentNumberOfPressesCounted is 2 on DUT(Chip-tool) log:

          [1722930652.716] [31360:31362] [DMG]         SuppressResponse = true,
          [1722930652.716] [31360:31362] [DMG]         InteractionModelRevision = 11
          [1722930652.716] [31360:31362] [DMG] }
          [1722930652.717] [31360:31362] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0005
          [1722930652.717] [31360:31362] [TOO]   Event number: 65565
          [1722930652.717] [31360:31362] [TOO]   Priority: Info
          [1722930652.717] [31360:31362] [TOO]   Timestamp: 1722930534106
          [1722930652.717] [31360:31362] [TOO]   MultiPressOngoing: {
          [1722930652.717] [31360:31362] [TOO]     NewPosition: 1
          [1722930652.717] [31360:31362] [TOO]     CurrentNumberOfPressesCounted: 2
          [1722930652.717] [31360:31362] [TOO]    }


          wait 0.2 seconds

          echo '{"Name":"ShortRelease","PreviousPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>

          Verify ShortRelease event with PreviousPosition set to 1 on TH(all-cluster-app) log:

          [1722930799.722] [29970:29972] [-] Received payload: "{"Name":"ShortRelease","PreviousPosition":1}"
          [1722930799.723] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad3f
          [1722930799.723] [29970:29970] [-] The the previous value of the CurrentPosition when the momentary switch has been released:1
          [1722930799.723] [29970:29970] [ZCL] SwitchServer: OnShortRelease


          ./chip-tool switch read-event short-release  1 1

          Verify ShortRelease event with PreviousPosition set to 1 on DUT(chip-tool) log:

          [1722930819.997] [31413:31415] [DMG]         SuppressResponse = true,
          [1722930819.997] [31413:31415] [DMG]         InteractionModelRevision = 11
          [1722930820.000] [31413:31415] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0003
          [1722930820.000] [31413:31415] [TOO]   Event number: 65567
          [1722930820.000] [31413:31415] [TOO]   Priority: Info
          [1722930820.000] [31413:31415] [TOO]   Timestamp: 1722930799723
          [1722930820.001] [31413:31415] [TOO]   ShortRelease: {
          [1722930820.001] [31413:31415] [TOO]     PreviousPosition: 1
          [1722930820.001] [31413:31415] [TOO]    }


          wait 2 seconds

          echo '{"Name":"MultiPressComplete","PreviousPosition":1,"TotalNumberOfPressesCounted":2}' > /tmp/chip_all_clusters_fifo_<PID>

          Verify MultiPressComplete event with PreviousPosition set to 1 AND TotalNumberOfPressesCounted is 2  on TH(all-cluster-app) log:

          [1722930879.026] [29970:29972] [-] Received payload: "{"Name":"MultiPressComplete","PreviousPosition":1,"TotalNumberOfPressesCounted":2}"
          [1722930879.027] [29970:29970] [-] The previous position when the momentary switch has been pressed in a multi-press sequence:1
          [1722930879.027] [29970:29970] [-] 2 times the momentary switch has been pressed
          [1722930879.027] [29970:29970] [ZCL] SwitchServer: OnMultiPressComplete


          ./chip-tool switch read-event multi-press-complete 1 1

          Verify MultiPressComplete event with PreviousPosition set to 1 AND TotalNumberOfPressesCounted is 2  on DUT(Chip-tool) log:

          [1722930909.990] [31442:31444] [DMG]         SuppressResponse = true,
          [1722930909.990] [31442:31444] [DMG]         InteractionModelRevision = 11
          [1722930909.990] [31442:31444] [DMG] }
          [1722930909.991] [31442:31444] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0006
          [1722930909.991] [31442:31444] [TOO]   Event number: 65568
          [1722930909.991] [31442:31444] [TOO]   Priority: Info
          [1722930909.991] [31442:31444] [TOO]   Timestamp: 1722930879027
          [1722930909.991] [31442:31444] [TOO]   MultiPressComplete: {
          [1722930909.991] [31442:31444] [TOO]     PreviousPosition: 1
          [1722930909.992] [31442:31444] [TOO]     TotalNumberOfPressesCounted: 2
          [1722930909.992] [31442:31444] [TOO]    }
      disabled: true

    - label:
          "Step 4f: TH simulates operation of the switch by repeating these
          steps (over a 1 minute period) change state (field CurrentPosition)
          from 0 to 1, and send the event InitialPress (with field
          NewPosition=1) wait 0.2 seconds change state (attribute
          CurrentPosition) from 1 to 0 wait 0.2 seconds change state (field
          CurrentPosition) from 0 to 1 wait 0.2 seconds change state (field
          CurrentPosition) from 1 to 0 wait 2 seconds send the event
          MultiPressComplete (with field PreviousPosition=1 and
          TotalNumberOfPressesCounted=2)"
      PICS:
          " SWTCH.C.F01 && SWTCH.C.F04 && SWTCH.C.F05 &&
          SWTCH.C.M.SwitchStateEventing "
      verification: |
          echo '{"Name":"InitialPress","NewPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>

          Verify InitialPress event with NewPosition set to 1 on TH(all-cluster-app) log:

          [1722931100.930] [29970:29972] [-] Received payload: "{"Name":"InitialPress","NewPosition":1}"
          [1722931100.931] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad40
          [1722931100.931] [29970:29970] [-] The new position when the momentary switch starts to be pressed:1
          [1722931100.931] [29970:29970] [ZCL] SwitchServer: OnInitialPress

          ./chip-tool switch read-event initial-press   1 1

          Verify InitialPress event with NewPosition set to 1 on DUT(chip-tool) log:

          [1722931135.211] [31498:31500] [DMG]         SuppressResponse = true,
          [1722931135.211] [31498:31500] [DMG]         InteractionModelRevision = 11
          [1722931135.211] [31498:31500] [DMG] }
          [1722931135.215] [31498:31500] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0001
          [1722931135.216] [31498:31500] [TOO]   Event number: 65569
          [1722931135.216] [31498:31500] [TOO]   Priority: Info
          [1722931135.216] [31498:31500] [TOO]   Timestamp: 1722931100931
          [1722931135.216] [31498:31500] [TOO]   InitialPress: {
          [1722931135.216] [31498:31500] [TOO]     NewPosition: 1
          [1722931135.216] [31498:31500] [TOO]    }

          wait 0.2 seconds

          echo '{"Name":"InitialPress","NewPosition":0}' > /tmp/chip_all_clusters_fifo_<PID>

          Verify InitialPress event with NewPosition set to 0 on TH(all-cluster-app) log:

          [1722931220.012] [29970:29972] [-] Received payload: "{"Name":"InitialPress","NewPosition":0}"
          [1722931220.013] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad41
          [1722931220.013] [29970:29970] [-] The new position when the momentary switch starts to be pressed:0
          [1722931220.013] [29970:29970] [ZCL] SwitchServer: OnInitialPress

          ./chip-tool switch read-event initial-press   1 1

          Verify InitialPress event with NewPosition set to 0 on DUT(chip-tool) log:

          [1722931271.359] [31540:31542] [DMG]         SuppressResponse = true,
          [1722931271.359] [31540:31542] [DMG]         InteractionModelRevision = 11
          [1722931271.364] [31540:31542] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0001
          [1722931271.364] [31540:31542] [TOO]   Event number: 65570
          [1722931271.364] [31540:31542] [TOO]   Priority: Info
          [1722931271.364] [31540:31542] [TOO]   Timestamp: 1722931220013
          [1722931271.364] [31540:31542] [TOO]   InitialPress: {
          [1722931271.364] [31540:31542] [TOO]     NewPosition: 0
          [1722931271.365] [31540:31542] [TOO]    }

          wait 0.2 seconds

          echo '{"Name":"InitialPress","NewPosition":1}' > /tmp/chip_all_clusters_fifo_<PID>

          Verify InitialPress event with NewPosition set to 1 on TH(all-cluster-app) log:

          [1722931350.252] [29970:29972] [-] Received payload: "{"Name":"InitialPress","NewPosition":1}"
          [1722931350.253] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad42
          [1722931350.253] [29970:29970] [-] The new position when the momentary switch starts to be pressed:1
          [1722931350.253] [29970:29970] [ZCL] SwitchServer: OnInitialPress

          ./chip-tool switch read-event initial-press   1 1

          Verify InitialPress event with NewPosition set to 1 on DUT(chip-tool) log:

          [1722931407.399] [31584:31586] [DMG]         SuppressResponse = true,
          [1722931407.399] [31584:31586] [DMG]         InteractionModelRevision = 11
          [1722931407.399] [31584:31586] [DMG] }
          [1722931407.406] [31584:31586] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0001
          [1722931407.406] [31584:31586] [TOO]   Event number: 65571
          [1722931407.406] [31584:31586] [TOO]   Priority: Info
          [1722931407.406] [31584:31586] [TOO]   Timestamp: 1722931350253
          [1722931407.407] [31584:31586] [TOO]   InitialPress: {
          [1722931407.407] [31584:31586] [TOO]     NewPosition: 1
          [1722931407.407] [31584:31586] [TOO]    }


          wait 0.2 seconds

          echo '{"Name":"InitialPress","NewPosition":0}' > /tmp/chip_all_clusters_fifo_<PID>

          Verify InitialPress event with NewPosition set to 0 on TH(all-cluster-app) log:

          [1722931466.389] [29970:29972] [-] Received payload: "{"Name":"InitialPress","NewPosition":0}"
          [1722931466.390] [29970:29970] [DMG] Endpoint 1, Cluster 0x0000_003B update version to 6903ad43
          [1722931466.390] [29970:29970] [-] The new position when the momentary switch starts to be pressed:0
          [1722931466.390] [29970:29970] [ZCL] SwitchServer: OnInitialPress


          ./chip-tool switch read-event initial-press   1 1

          Verify InitialPress event with NewPosition set to 0 on DUT(chip-tool) log:

          [1722931577.478] [31634:31636] [DMG]         SuppressResponse = true,
          [1722931577.478] [31634:31636] [DMG]         InteractionModelRevision = 11
          [1722931577.478] [31634:31636] [DMG] }
          [1722931577.486] [31634:31636] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0001
          [1722931577.486] [31634:31636] [TOO]   Event number: 65572
          [1722931577.486] [31634:31636] [TOO]   Priority: Info
          [1722931577.486] [31634:31636] [TOO]   Timestamp: 1722931466390
          [1722931577.486] [31634:31636] [TOO]   InitialPress: {
          [1722931577.486] [31634:31636] [TOO]     NewPosition: 0
          [1722931577.486] [31634:31636] [TOO]    }

          wait 2 seconds

          echo '{"Name":"MultiPressComplete","PreviousPosition":1,"TotalNumberOfPressesCounted":2}' > /tmp/chip_all_clusters_fifo_<PID>

          Verify MultiPressComplete event with PreviousPosition set to 1 AND TotalNumberOfPressesCounted is 2  on TH(all-cluster-app) log:

          [1722931627.894] [29970:29972] [-] Received payload: "{"Name":"MultiPressComplete","PreviousPosition":1,"TotalNumberOfPressesCounted":2}"
          [1722931627.894] [29970:29970] [-] The previous position when the momentary switch has been pressed in a multi-press sequence:1
          [1722931627.894] [29970:29970] [-] 2 times the momentary switch has been pressed
          [1722931627.894] [29970:29970] [ZCL] SwitchServer: OnMultiPressComplete

          ./chip-tool switch read-event multi-press-complete 1 1

          Verify MultiPressComplete event with PreviousPosition set to 1 AND TotalNumberOfPressesCounted is 2  on DUT(Chip-tool) log:

          [1722931657.607] [31658:31660] [DMG]         SuppressResponse = true,
          [1722931657.607] [31658:31660] [DMG]         InteractionModelRevision = 11
          [1722931657.607] [31658:31660] [DMG] }
          [1722931657.608] [31658:31660] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0006
          [1722931657.608] [31658:31660] [TOO]   Event number: 65568
          [1722931657.608] [31658:31660] [TOO]   Priority: Info
          [1722931657.608] [31658:31660] [TOO]   Timestamp: 1722930879027
          [1722931657.608] [31658:31660] [TOO]   MultiPressComplete: {
          [1722931657.608] [31658:31660] [TOO]     PreviousPosition: 1
          [1722931657.608] [31658:31660] [TOO]     TotalNumberOfPressesCounted: 2
          [1722931657.608] [31658:31660] [TOO]    }
          [1722931657.609] [31658:31660] [TOO] Endpoint: 1 Cluster: 0x0000_003B Event 0x0000_0006
          [1722931657.609] [31658:31660] [TOO]   Event number: 65573
          [1722931657.609] [31658:31660] [TOO]   Priority: Info
          [1722931657.609] [31658:31660] [TOO]   Timestamp: 1722931627894
          [1722931657.609] [31658:31660] [TOO]   MultiPressComplete: {
          [1722931657.609] [31658:31660] [TOO]     PreviousPosition: 1
          [1722931657.609] [31658:31660] [TOO]     TotalNumberOfPressesCounted: 2
          [1722931657.609] [31658:31660] [TOO]    }
      disabled: true
