We implement most of that, and there is no 'release' event. I think you have two options really:
don't use events - for example you can just tell BTHome to advertise {type:"locked", v:true} - and then I think you can just detect when that value changes in Home Assistant, and fire something off based on that?
Have two events - a 'door locked' event and a 'door opened' event
... or you could ask the BTHome devs if they want to add a new event type, but that could take a while!
Just a note but Puck.js (Lite or Normal) has a bunch of spare GPIOs pins on it that are easily accessible - so there's no need to replace the button, you just wire things up to the other pins that are already there
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi - so you're asking specifically about the BTHome being able to send a 'release' event to Home Assistant with https://www.espruino.com/BTHome ?
Because to detect a button release, you just use
setWatch
withedge:"falling"
instead ofedge:"rising"
For BTHome, what's supported is just what's shown on: https://bthome.io/format/
We implement most of that, and there is no 'release' event. I think you have two options really:
{type:"locked", v:true}
- and then I think you can just detect when that value changes in Home Assistant, and fire something off based on that?... or you could ask the BTHome devs if they want to add a new event type, but that could take a while!
Just a note but Puck.js (Lite or Normal) has a bunch of spare GPIOs pins on it that are easily accessible - so there's no need to replace the button, you just wire things up to the other pins that are already there