Puck.js Lite button release event #4297
Replies: 1 comment
-
Posted at 2024-03-15 by @gfwilliams 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 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:
... 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 Posted at 2024-03-15 by user157746 Darn, I should have dug into the BTHome specs a bit more first. I did not expect the protocol itself actually lacking such an event. Thank you for the alternative suggestions, much appreciated. I was going to say that by looking at your BTHome implementation, it will be throwing an exception when I just introduce an unknown type/property like "locked". But you were referring to 'cheating' with the BTHome "lock" sensor property, which you actually renamed to "locked". I suppose that'll do just fine indeed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2024-03-15 by user157746
Hi,
In my quest to find a way to know if a door is locked, I stumbled on the very promising Puck.js project.
The Puck.js Lite is small (enough), simple and efficient and would be able to do all I need, except possibly one thing: fire a button release event.
The idea is to mount the Puck inside the door casing, replace the button with an external one and position the button in the strike plate hole in such a way that it is only pressed by the deadbolt when the door is locked.
As far as I can tell, by looking at the examples and Home Assistant integration, there are only pressed events available (single, double, long, etc.). For my concept to work, I'd like the Puck to fire an event when the button is pressed (door being locked), and an event when the button is being released (door being unlocked).
While it might not be the 'normal' purpose of the device, is there already a button release event available, despite it not being included in the documentation?
If not, is it possible to introduce this event?
If yes, will this still be in an energy efficient way? Not that there's some permanent activation taking place due to the way the hardware is currently set up. We are talking about presses that can take minutes/hours/days/weeks in the end.
Beta Was this translation helpful? Give feedback.
All reactions