You are reading a single comment by @user156756 and its replies. Click here to read the full conversation.
  • Coming back to this for a bit. Great to see a BTHome library. Quick and easy device/sensors into HA.
    Works great with your example using a singlebutton press. I can see the event on the Home Assistant log.

    One thing I can't figure out is how to set up long press and double press events. This sends through both a double and a single press when I hit the puck button once

    ...
    function updateAdvertising() {
      NRF.setAdvertising(require("BTHome").get­Advertisement([
        {
          type : "battery",
          v : E.getBattery()
        },
        {
          type : "temperature",
          v : E.getTemperature()
        },
        {
          type: "button_event",
          v: buttonState ? "press" : "none"
        },
        {
          type: "button_event",
          v: buttonState ? "double_press" : "none"
        },
      ]), { name : "Puck" });
    ...
    

    Feeling stupid - Thanks

About

Avatar for user156756 @user156756 started