Sian-Lee-SA / Home-Assistant-Switch-Manager

Switch manager is a centralised component to handle button pushes for your wireless switches. This includes anything passed through the event bus. The component relies on switch blueprints which is easily made to allow GUI configuration of your switches and their button pushes. This helps remove clutter from the automations.
Other
269 stars 88 forks source link

New ZHA remote #92

Closed gorstj closed 1 year ago

gorstj commented 1 year ago

Hi, sorry to open an issue for this but I can't fathom GitHub yet.

I have imported the following Tuya 4 button remove from zigbee2mqtt to ZHA I have only confirmed working for the 3 button, but assume it will also work with the 4th button.

I am using the png from the zigbee2mgtt integration

name: TuYa 4 Button Scene (SS5300ZB)
service: ZHA
event_type: zha_event
identifier_key: device_id
buttons:
  - x: 66
    y: 102
    width: 32
    conditions:
      - key: endpoint_id
        value: 1
    actions:
      - title: press
        conditions:
          - key: command
            value: remote_button_short_press
      - title: press 2x
        conditions:
          - key: command
            value: remote_button_double_press
      - title: hold
        conditions:
          - key: command
            value: remote_button_long_press
  - x: 66
    y: 204
    width: 32
    conditions:
      - key: endpoint_id
        value: 2
    actions:
      - title: press
        conditions:
          - key: command
            value: remote_button_short_press
      - title: press 2x
        conditions:
          - key: command
            value: remote_button_double_press
      - title: hold
        conditions:
          - key: command
            value: remote_button_long_press
  - x: 66
    y: 302
    width: 32
    actions:
    conditions:
      - key: endpoint_id
        value: 3
    actions:
      - title: press
        conditions:
          - key: command
            value: remote_button_short_press
      - title: press 2x
        conditions:
          - key: command
            value: remote_button_double_press
      - title: hold
        conditions:
          - key: command
            value: remote_button_long_press
  - x: 66
    y: 405
    width: 32
    conditions:
      - key: endpoint_id
        value: 4
    actions:
      - title: press
        conditions:
          - key: command
            value: remote_button_short_press
      - title: press 2x
        conditions:
          - key: command
            value: remote_button_double_press
      - title: hold
        conditions:
          - key: command
            value: remote_button_long_press
Sian-Lee-SA commented 1 year ago

Double check the event data and turn on debug then make sure the conditions match. Also there's already a blueprint for ZHA

gorstj commented 1 year ago

Apologies, I am confident it will work just haven't been able to test.

The reason for opening an issues was if you wanted to add it to the GitHub for others to benefit?

Sian-Lee-SA commented 1 year ago

Sorry I don't quite understand? If there's already a ZHA blueprint in this repo for this device then it wouldn't be added to the repo because the blueprint and device already exists in this repo.

gorstj commented 1 year ago

There is a zigbee2mqtt blueprint already This is a ZHA blueprint

Sian-Lee-SA commented 1 year ago

https://github.com/Sian-Lee-SA/Home-Assistant-Switch-Manager/blob/master/custom_components/switch_manager/blueprints/zha-tuya-4-button-scene.yaml

gorstj commented 1 year ago

There are two different scene remotes (button layout very different). Look at the zigbee2mqtt list

Sian-Lee-SA commented 1 year ago

There was no results on a google search for SS5300ZB. can you link me to the zigbee2mqtt page for the device. At the end of the day, the ZHA 4 scene is pretty much identical to your blueprint so there is no indication here to assume it's a different device to the squared model

gorstj commented 1 year ago

Good point! I just copied the name from this which appears to call it a 6400 in the filename and a 5300 in the yaml

https://github.com/Sian-Lee-SA/Home-Assistant-Switch-Manager/blob/master/custom_components/switch_manager/blueprints/zigbee2mqtt-tuya-4-button-scene-ss6400zb.yaml

In my ZHA it imports in as a TS0043 (three button) or TS0044 for the four button

Sian-Lee-SA commented 1 year ago

Ok so your blueprint is pretty much the vertical switch with button numbers on it? I wanted to clarify if the name is the same as 4 button scene as it's confusing to have the same name for a device but I also think TuYa has a habit of doing this aswell which doesn't help. The TS0044 is definitely the squared model which ZHA already has... But ultimately what i'm most curious about is, what was the issue or question in general?