I thought I could share an example of how to use the Nexa MEBT-1706 buttons (also known as HubQuiz buzzers).
These buttons have only one big surface for pushing and when you push it, it will send an ON signal and after a few seconds it will send an OFF signal. This can cause problems if you wish to make the button to turn on a light on the first button press and then turn off on the second button press. Here is one solution for this.
Involved physical devices:
- The button - “HubQuiz knappen”
- The light - “Diamantlampan”
Create a virtual On/Off device. This device will be our condition which will help us know when to actually turn off the light. Let’s call it “V.L. Status”
Create the first Automation - "Turn On"
:: WHEN the button is pressed ON, AND “V.L. Status” is OFF, THEN it’s a go to turn “Diamantlampan” ON. Easy so far. However, now we need to block this state so that the off-signal that is about to come from the button won’t trigger our “Turn Off”-automation. The trick here is to wait out the OFF signal. So we continue by adding a pause of around 5 seconds (3s should work as well) and then switch the virtual device state to ON again. (You will see in step 3 why all this)
Create the second Automation - "Turn OFF"
Remember the OFF-signal is always sent after an ON-signal from this smart button. So we actually Always begin to trigger our ON and OFF automations (both). The V.L. Status decides which one goes through all the way.
:: WHEN the button sends OFF, AND “V.L Status” is set to ON, THEN it’s ok to switch the light to OFF. Then we need to “put back” the state of the “V.L Status” to Off, so that the On-automation will trigger next time we push the button. And so it goes on forever and ever…
There might be other, and maybe better, alternatives. This is one I came up with and tested. It works just fine.