This will be brief but I want to showcase a button that has proven to be very useful in my Home Assistant based home control.

Yes I have everything controlled by my phone and/or PC. I even have an ALL-OFF onscreen button for night-time – but in reality – it’s as much use as an ashtray on a motorbike when I go to bed, almost asleep already and want to turn off all the house lights and have no will to open an app.
Of course there is always “hey Google” – but do I want to wake up my wife to hear that? Nope.
So, I use an Aqara button on the wall so that either of use as we enter the room can quickly turn off the lights. Great – but I spend more time changing batteries on these devices than I care to imagine.
Ok, so the Aqara buttons are small and reliable – but I’m sitting in front of a somewhat larger Sonoff SNZB-01P button (given to me by a friend – a box of two) which is larger as it has a large CR2477 battery in it – more expensive by some way than CR2032 but do they last? Yes… instead of months – years in fact.
The button can do single-press, double-press, long press… SO – I remove the travel tab from the SNZB-01P and pressed the small button on the side – a dim red light flashed – and in Zigbee2MQTT on my Home Assistant I selected “Permit join”.
And as if by magic – a new device appeared in the list with a horrible long ID…..
Within seconds that “unsupported” disappeared and I could rename the device to something useful like “my-bed-button”. Oh and I’ve just realised something – If I don’t do that renaming quickly – the device disappears from the list again. Ok, done – and while I was on, I ticked to update the Home Assistant entity. Done.
Untick “Permit Join”. and have a look at the device.
All ready – a quick look at the available actions – and then back out to Home Assistant.
That’s it – 3 possible actions.
The Zigbee-based SNZB-01P comes complete with a metal magnetic wall mount so you can screw or adhesive tape the mount to the wall and just drop the button in place – easy for when you DO have to replace the battery.
I already have an all-off button (Aqara) and the YAML code for that is…
alias: All lights turn off when all-off button is pressed description: >- Turn off living room lights and outside lights when the all-off button is pressed. triggers: - domain: mqtt device_id: 52fcb6a8555d657a9eeabf1023dcf9b2 type: action subtype: single trigger: device conditions: [] actions: - metadata: {} data: {} action: script.all_off mode: single
So now I have my “my-bed-button” – and I already have a script to turn everything off – and an automation for the Aqara button (above) – so (thanks ChatGPT) here’s the automation code to turn everything off using a single press of the new Sonoff button.. easy. I wonder if I really needed all that stuff in the Aqara button automation above when ChatGPT’s version for the Sonoff button is simpler… hmm. Oh I like this – the readable MQTT topic instead of that horrible device_id…. good.
alias: My Bed Button - Single Press description: >- Turn off living room lights and outside lights when the Sonoff my-bed-button is pressed. mode: single trigger: - platform: mqtt topic: zigbee2mqtt/my-bed-button/action payload: single action: - service: script.all_off
I just realised – you get a set of button stickers to go with the button. Handy. That Zzz will do for my all-off action.