You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • 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 with edge:"falling" instead of edge:"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:

    • 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

About

Avatar for Gordon @Gordon started