It took me forever to figure out how to create an automation with a Sonoff Button and a smart button like the SNZB-01P. Here is what worked for me.
Option 1: Use a Device Trigger (Easiest)
Instead of choosing Entity or State as your automation trigger, choose Device:
- Go to Settings → Automations & Scenes and click Create Automation (or edit an existing one).
- Under When, click Add Trigger and select Device.
- Search for and select your Sonoff button.
- Open the Trigger dropdown—you should see options like Remote button short press, Remote button double press, and Remote button long press (alongside the battery level trigger).
(Note: If those press triggers don’t appear in the dropdown, press the physical button once to wake it up, or go to the device page in ZHA and click Reconfigure while pressing the button every couple of seconds so it stays awake.)