Holyiot NRF52810 with push button question

Hello all

I have this BLE beacon from Holyiot, which have a single push button on it

https://www.aliexpress.com/item/1005004501233344.html

I was able to create a presence sensor , battery status and rssi sensor in esphome for that device, following some posts i search and github i found

but i couldn’t get the push button recognized and trigger an event. in my case i tried simple log message from esphome
hte UUID for this beacon igot by using the Android app of nRF connect which displays the BT packets data

here is the relevant config section of esphome

esp32_ble_tracker:
  id: ble_tracker
  scan_parameters:
    window: 300ms
    continuous: True
  on_ble_service_data_advertise:
    - mac_address: FA:65:16:C1:0D:EA
      service_uuid: "5271"
      then:
        - lambda: 'id(ble_sensor).publish_state(x[1]);'

bluetooth_proxy:
  active: true

sensor:
  - platform: ble_rssi
    mac_address: "FA:65:16:C1:0D:EA"  # Replace with your iBeacon's MAC address
    name: "iBeacon RSSI"
    id: ibeacon_rssi

  - platform: template
    name: "Holy-IOT"
    id: ble_sensor
    device_class: "battery"
    unit_of_measurement: "%"
    entity_category: "diagnostic"
    accuracy_decimals: 0

binary_sensor:
  - platform: ble_presence
    mac_address: "FA:65:16:C1:0D:EA"  # Replace with your iBeacon's MAC address
    # service_uuid: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"  # Replace with your iBeacon's UUID
    name: "iBeacon Presence"
    id: ibeacon_presence

  - platform: ble_presence
    name: Holy IoT Black-1 Presence
    ibeacon_uuid: "FDA50693A4E24FB1AFCFC6EB07647825"
    ibeacon_major: 10011
    ibeacon_minor: 19641
    device_class: "presence"
    icon: mdi:key-chain-variant
    filters:
      - delayed_off: 10s
    on_press:
      - script.execute:         
          id:         bt_press_annouce


script:
  - id: bt_press_annouce
    then:
      - logger.log: "bt_press_annouce"

any direction on how to get this push button recognized?

Ok solved with the help of the git owner mentioned above. alexander borisov

Here is updated yaml section

esp32_ble_tracker:
  id: ble_tracker
  scan_parameters:
    window: 300ms
    continuous: True
  on_ble_service_data_advertise:
    - mac_address: FA:65:16:C1:0D:EA
      service_uuid: "5242"
      then:
        - lambda: 'id(black1_battery).publish_state(x[1]);'
        - lambda: 'id(black1_button_11).publish_state(x[11]);' # catch button press
        
bluetooth_proxy:
  active: true

sensor:
  - platform: ble_rssi
    mac_address: "FA:65:16:C1:0D:EA"  # Replace with your iBeacon's MAC address
    name: "iBeacon RSSI"
    id: ibeacon_rssi

  - platform: template
    name: "Holy IoT Black-1 Battery"
    id: black1_battery
    device_class: "battery"
    unit_of_measurement: "%"
    entity_category: "diagnostic"
    accuracy_decimals: 0

  - platform: template
    name: "Holy IoT Black-1 Button"
    id: black1_button_11
    entity_category: "diagnostic"
    accuracy_decimals: 0


1 Like

Hi @shaikedem , I bumped into your conversation which appears to be with yourself but nevertheless interesting! I am fiddling around with the HolyIoT beacon as well and managed to get it working for my purpose: detecting if my car is close to my house. For this purpose I use a device_tracker state (probably created by the iBeacon integration but really not sure what I’ve done there…) I set up a bluetooth proxy using an ESP32 dev board which detects the beacon once it’s around. I set the beacon to behave like an iBeacon by the way.
Looking at your code, I think you create the sensors without the iBeacon integration, but where is this code placed? Is it just in configuration.yaml and will this addition create the required sensor?

It’s placed in the yaml of the esp32 device that is the BT proxy
The BT proxy is the one who connects to the BT button

1 Like

Do you use the iBeacon integration?

Not sure
I have only configuration inside esp32 yaml
I think it’s creating sensors inside home assistant not sure what kind of integration it uses

1 Like

Last night i was just playing with the button with an esp proxy, but the button also triggers when there is motion. Is there a workaround?