Zigbee2MQTT - Tuya LoraTap 6-Button Scene Switch (SS9600ZB) blueprint issue

I am a newbie HA user with virtually zero coding experience. I’ve customised an existing 4-gang blueprint and added the missing details for 2 more buttons. It kinda “works” as I can select the blueprint, enter a device to be switched on/off, and save it without any errors. But an actual press on that button doesn’t do anything other than showing that HA noticed it.

LOG:
6x Switch action changed to None
12:00:57 - 7 seconds ago
6x Gang Switch TEST mqtt topic zigbee2mqtt/6x Switch/action
12:00:57 - 7 seconds ago
6x Switch action
12:00:57 - 8 seconds ago
6x Switch action changed to 1_single
12:00:57 - 8 seconds ago

Automation:

alias: 6x Gang Switch TEST
description: ""
use_blueprint:
  path: homeassistant/blueprint-6-gang-switch-LoraTap:.yaml
  input:
    switch: sensor.6x_switch_action
    button_one_short_press:
      - type: turn_on
        device_id: ac08385918b94263e4f56932189fa8d2
        entity_id: light.white_lamp_1
        domain: light
        brightness_pct: 100
      - type: turn_on
        device_id: d32d3a1ea4c9b4fe6c7970da3725bbd5
        entity_id: light.white_lamp_2
        domain: light
        brightness_pct: 100

My SONOFF ZigBee dongle has 23 directly linked devices and a few dozen more through the Tuya add-on. The LoraTap switch used to work (battery still 100%) in the SmartLife app before I removed and reset it and paired it to the SONOFF dongle.

I wonder if any of you has a working blueprint for that switch or could identify any issues in the below yaml file. I don’t have a Github account so I just pasted the blueprint below. Or do you need any further details?

blueprint:
  name: Zigbee2MQTT - Tuya LoraTap 6-Button Scene Switch (SS9600ZB)
  description: Automate your Tuya LoraTap 6-Button Scene Switch (SS9600ZB) via Zigbee2MQTT.
  domain: automation
  source_url: https://gist.github.com/edememinov/1ae89374ece50d2aa4beee4bf8f3fd76
  input:
    switch:
      name: SS9600ZB Switch
      description: Tuya LoraTap 6-Button Scene Switch to use
      selector:
        entity:
          domain: sensor
          integration: mqtt
    button_one_short_press:
      name: Single Press - Button 1
      description: Action to run on button 1 single press
      default: []
      selector:
        action: null
    button_one_hold:
      name: Hold - Button 1
      description: Action to run on button 1 long press
      default: []
      selector:
        action: null
    button_one_double_press:
      name: Double Press - Button 1
      description: Action to run on button 1 double press
      default: []
      selector:
        action: null
    button_two_short_press:
      name: Single Press - Button 2
      description: Action to run on button 2 single press
      default: []
      selector:
        action: null
    button_two_hold:
      name: Hold - Button 2
      description: Action to run on button 2 long press
      default: []
      selector:
        action: null
    button_two_double_press:
      name: Double Press - Button 2
      description: Action to run on button 2 double press
      default: []
      selector:
        action: null
    button_three_short_press:
      name: Single Press - Button 3
      description: Action to run on button 3 single press
      default: []
      selector:
        action: null
    button_three_hold:
      name: Hold - Button 3
      description: Action to run on button 3 long press
      default: []
      selector:
        action: null
    button_three_double_press:
      name: Double Press - Button 3
      description: Action to run on button 3 double press
      default: []
      selector:
        action: null
    button_four_short_press:
      name: Single Press - Button 4
      description: Action to run on button 4 single press
      default: []
      selector:
        action: null
    button_four_hold:
      name: Long Press - Button 4
      description: Action to run on button 4 long press
      default: []
      selector:
        action: null
    button_four_double_press:
      name: Double Press - Button 4
      description: Action to run on button 4 double press
      default: []
      selector:
        action: null
    button_five_short_press:
      name: Single Press - Button 5
      description: Action to run on button 5 single press
      default: []
      selector:
        action: null
    button_five_hold:
      name: Long Press - Button 5
      description: Action to run on button 5 long press
      default: []
      selector:
        action: null
    button_five_double_press:
      name: Double Press - Button 5
      description: Action to run on button 5 double press
      default: []
      selector:
        action: null
    button_six_short_press:
      name: Single Press - Button 6
      description: Action to run on button 6 single press
      default: []
      selector:
        action: null
    button_six_hold:
      name: Long Press - Button 6
      description: Action to run on button 6 long press
      default: []
      selector:
        action: null
    button_six_double_press:
      name: Double Press - Button 6
      description: Action to run on button 6 double press
      default: []
      selector:
        action: null
mode: single
max_exceeded: silent
variables:
  command: "{{ trigger.payload }}"
  topic: "{{ trigger.topic }}"
  switch_name: !input "switch"
  deviceName: "{{ state_attr(switch_name, 'friendly_name') }}"
trigger:
  - platform: mqtt
    topic: zigbee2mqtt/+/action
action:
  - choose:
      - conditions:
          - "{{ topic.split('/')[1].replace('/', '') == deviceName.split(' ')[0]
            }}"
        sequence:
          - choose:
              - conditions:
                  - "{{ command == '1_single' }}"
                sequence: !input "button_one_short_press"
              - conditions:
                  - "{{ command == '2_single' }}"
                sequence: !input "button_two_short_press"
              - conditions:
                  - "{{ command == '3_single' }}"
                sequence: !input "button_three_short_press"
              - conditions:
                  - "{{ command == '4_single' }}"
                sequence: !input "button_four_short_press"
              - conditions:
                  - "{{ command == '5_single' }}"
                sequence: !input "button_five_short_press"
              - conditions:
                  - "{{ command == '6_single' }}"
                sequence: !input "button_six_short_press"
              - conditions:
                  - "{{ command == '1_double' }}"
                sequence: !input "button_one_double_press"
              - conditions:
                  - "{{ command == '2_double' }}"
                sequence: !input "button_two_double_press"
              - conditions:
                  - "{{ command == '3_double' }}"
                sequence: !input "button_three_double_press"
              - conditions:
                  - "{{ command == '4_double' }}"
                sequence: !input "button_four_double_press"
              - conditions:
                  - "{{ command == '5_double' }}"
                sequence: !input "button_five_double_press"
              - conditions:
                  - "{{ command == '6_double' }}"
                sequence: !input "button_six_double_press"
              - conditions:
                  - "{{ command == '1_hold' }}"
                sequence: !input "button_one_hold"
              - conditions:
                  - "{{ command == '2_hold' }}"
                sequence: !input "button_two_hold"
              - conditions:
                  - "{{ command == '3_hold' }}"
                sequence: !input "button_three_hold"
              - conditions:
                  - "{{ command == '4_hold' }}"
                sequence: !input "button_four_hold"
              - conditions:
                  - "{{ command == '5_hold' }}"
                sequence: !input "button_five_hold"
              - conditions:
                  - "{{ command == '6_hold' }}"
                sequence: !input "button_six_hold"

Your trigger and variables should be something like this.

trigger:
- platform: state
  entity_id: !input 'switch'
  attribute: action
action:
- variables:
    command: '{{ trigger.to_state.state }}'
- choose:
  - conditions:
    - '{{ command == ''1_single'' }}'
    sequence: !input 'button_one_short_press'
1 Like

I have a loratap 6 button scene switch. Where can I find the blueprint for MQTT integration

2 Likes