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
206 stars 79 forks source link

[New Feature] Sonoff SNZB-01P #209

Closed harvindhillon closed 4 months ago

harvindhillon commented 6 months ago

Support for the newer ZNZB-01P Sonoff button

harvindhillon commented 6 months ago

zha-sonoff-snzb-01p

name: Sonoff SNZB 01P
service: ZHA
event_type: zha_event
identifier_key: device_id
buttons:
  - actions:
      - title: press
        conditions:
          - key: command
            value: "toggle"
      - title: press 2x
        conditions:
          - key: command
            value: "on"
      - title: hold
        conditions:
          - key: command
            value: "off"
name: Sonoff SNZB 01P
service: Zigbee2MQTT
event_type: mqtt
mqtt_topic_format: zigbee2mqtt/+/action
buttons:
  - actions:
      - title: press
        conditions:
          - key: payload
            value: single
      - title: press 2x
        conditions:
          - key: payload
            value: double
      - title: hold
        conditions:
          - key: payload
            value: long
harvindhillon commented 6 months ago

Not sure how to create a pull request, but I guess it could help others. Have a picture, the code is pretty much the same as the older Sonoff Button

D3SL commented 6 months ago

Not sure how to create a pull request,

The official guide is a bit unclear imho. The gist is you fork the repo, make whatever additions/changes you want, commit them to your fork, and then when viewing your fork's main page here on github you'll see a button labelled "Contribute" with the option to open a pull request. Here's a screenshot of how it would look to make a pull request of your changes.

image

github-actions[bot] commented 5 months ago

This issue is stale because it has been open for 30 days with no activity.

harvindhillon commented 5 months ago

Apologies, got distracted, I created the pull, and corrected a Z2M Tuya TS004 button order as well that I found when testing image Not sure why it was in reverse order, the commenter in the file didnt know why as well :)