custom-components / ble_monitor

BLE monitor for passive BLE sensors
https://community.home-assistant.io/t/passive-ble-monitor-integration/
MIT License
1.91k stars 247 forks source link

[New Sensor]: HolyIOT BLE tracker #1183

Open fokcuk opened 1 year ago

fokcuk commented 1 year ago

Sensor Description

BLE tracker

Additional information

https://www.aliexpress.com/item/1005003211033416.html?spm=a2g0o.productlist.main.9.5c0b315cxrUJH1&algo_pvid=3ef75d81-8d09-43ac-9b6d-53b3a4b4aa35&aem_p4p_detail=202305252017357354224051675580003716456&algo_exp_id=3ef75d81-8d09-43ac-9b6d-53b3a4b4aa35-4&pdp_npi=3%40dis%21AUD%2111.16%2111.05%21%21%21%21%21%402102186a16850710553228488d077f%2112000030168733162%21sea%21AU%21119444967&curPageLogUid=quf1qexyVhHq&p4p_pvid=202305252017357354224051675580003716456_1

BLE advertisements

2023-05-26 11:30:17.201 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Data measuring sensor received: {'type': 'iBeacon', 'packet': 'no packet id', 'firmware': 'iBeacon', 'data': True, 'rssi': -78, 'mac': 'C6B545F6F18E', 'uuid': '9976aed5f58c49af85ebd0ac7281e3f6', 'tracker_id': b'\x99v\xae\xd5\xf5\x8cI\xaf\x85\xeb\xd0\xacr\x81\xe3\xf6', 'major': 10011, 'minor': 19641, 'measured power': 36, 'cypress temperature': 80.13515625, 'cypress humidity': 31.109375}
fokcuk commented 1 year ago

0x0201061AFF4C0002159976AED5F58C49AF85EBD0AC7281E3F6271B4CB9240D0962696E2D747261636B657200101642524164C6B545F6F18E0606060000

fokcuk commented 1 year ago

Screenshot_20230526_115253_nRF Connect

fokcuk commented 1 year ago

Screenshot_20230526_150157_nRF Connect Highlighted is the part that is changing when either button is pressed: 601 or vibration is detected: 401 Not sure which one is battery

Ernst79 commented 1 year ago

Based on your info, I think is should be something like this 101642524164C6B545F6F18E0606060100

10 = length (in hex) = 16 bytes 16 = 16 bit uuid 4252 = UUID (0x5242) (read backwards per byte) 4164C6B545F6F18E0606060000 = data

Data 41 = device type? 64 = battey? (64 in hex = 100 --> 100%) C6B545F6F18E = MAC address 0606 = ? 06 = measurement type (06 = button, 04 = vibration, ....) 0100 = measurement (read backwards per byte, so, 0x0001 --> 1 = True, 0x0000 = Off

fokcuk commented 1 year ago

Sounds good to me =) can we please add it?

Ernst79 commented 1 year ago

Sure, will do that somewhere in the coming days

fokcuk commented 1 year ago

Legend! Is there a way to incorporate a dynamic sensor setup based on the data received? Something like settings menu where you can define how the data is translated?

Ernst79 commented 1 year ago

No, that is not possible. Why would you need that?

Ernst79 commented 1 year ago

Can you please try 12.0.1-beta. It should add support for the vibration sensor and button (as remote single click binary sensor)

fokcuk commented 1 year ago

Nothing has changed. No extras and no battery state

Ernst79 commented 1 year ago

Sorry, I think I used the wrong branch. Can you try again with the 12.0.2-beta release?

fokcuk commented 1 year ago

Still nothing Screenshot_20230530_174711_Home Assistant

Ernst79 commented 1 year ago

hmmm, it is recognized as a iBeacon. No additional sensor with a MAC address C6B545F6F18E?

The tricky thing with iBeacons is that they rotate their mac address. Can you make some longer log, like you did in your opening post?

2023-05-26 11:30:17.201 DEBUG (MainThread) [custom_components.ble_monitor.sensor] Data measuring sensor received: {'type': 'iBeacon', 'packet': 'no packet id', 'firmware': 'iBeacon', 'data': True, 'rssi': -78, 'mac': 'C6B545F6F18E', 'uuid': '9976aed5f58c49af85ebd0ac7281e3f6', 'tracker_id': b'\x99v\xae\xd5\xf5\x8cI\xaf\x85\xeb\xd0\xacr\x81\xe3\xf6', 'major': 10011, 'minor': 19641, 'measured power': 36, 'cypress temperature': 80.13515625, 'cypress humidity': 31.109375}
fokcuk commented 1 year ago

This one does not change the MAC The device is a beacon device but with few extra sensors

fokcuk commented 1 year ago

Ok, my bad. It added it further down the list, so I now have 2 devices. One with uuid in the name and the other with MAC. Vibration and battery seem to work, but button does not change

Ernst79 commented 1 year ago

That is because the sensor sends both iBeacon data and service data.

Not sure about the button. Can you verify that the 06 is changing when you click the button.

fokcuk commented 1 year ago

Sure does Screenshot_20230530_215910_nRF Connect

Ernst79 commented 1 year ago

not sure what is going wrong. If I enter your BLE advertisement in the data_parser service of BLE monitor

image

043e49020102018ef1f645b5c63d0201061AFF4C0002159976AED5F58C49AF85EBD0AC7281E3F6271B4CB9240D0962696E2D747261636B657200101642524164C6B545F6F18E0606060100CC

results in

image

fokcuk commented 1 year ago

Received documentation from HolyIOT with data info (Excel file) https://filetransfer.io/data-package/Mb95m4zz#link

They make various devices with temp/humidity etc. Can make a generic one for the whole HolyIOT selection

Ernst79 commented 1 year ago

Added all measurement types in 12.0.3-beta. Changed the remote single click to a button sensor. Can you test this version? Sensors should now be added when they are being broadcasted, so it might take a while before they all show up. You might have to delete the device first, to remove the remote single click binary sensor.

fokcuk commented 1 year ago

For some reason it still does not show the button =( Also, for the vibration sensor, can you assign an icon? Comes up as blank

fokcuk commented 1 year ago

dont know what happened, but now can see the button. Enabled debug logging to see what was going on but it just started to work

Ernst79 commented 1 year ago

Hmm, strange. Try to use it for a day, just to check that it keeps on working.

I’ll add an icon for vibration.

fokcuk commented 1 year ago

Yeah, I have been trying it for some time. Looks good. Not sure about other sensors like temp etc as my device does not have them, but should work

botany112 commented 9 months ago

sorry for opening it again. did anyone got the button pres working?

botany112 commented 9 months ago

the ibeacon works, but the button press doenst do anything. do i have to change anything in the app?

botany112 commented 8 months ago

anybody? knows about?

fokcuk commented 8 months ago

You need to monitor BLE adverts from your phone. Problem is that it does not retransmit the button press for long, so if you are pressing in between the intervals that BLE monitor scan, it will not be registering. Try holding the button for a minute or whatever your scan interval is set to. That's the reason I am not using the button You may have better luck with a ble components on esp32 boards with a more frequent scans

botany112 commented 8 months ago

thank you. ill do it