Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Avago Tech Bluetooth Buttons #20088

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

kabongsteve
Copy link
Contributor

@kabongsteve kabongsteve commented Nov 23, 2023

Description:

Support Bluetooth Buttons directly (without need for hub) and potentially other Bluetooth buttons

https://www.aliexpress.com/item/1005005791145037.html?spm=a2g0o.order_detail.order_detail_item.3.1478f19chQFmBA

Avago Tech Buttons come in 1 to 3 button versions and simply broadcast a Manufacturer packet with the following details without encryption

/*
Offset Button Manufacturer Data
0 Company ID = 2 bytes 0x0043
2 Unknown = 4 bytes 7fffffff
6 Counter = 1 byte
7 Unknown = 1 byte 05
8 Switch = 2 bytes - unique per switch unit
10 Unknown = 1 byte 00
11 Button = 1 bytes 0x (x = 1 to 3) single button 1 only dual button 1 and 3
12 Unknown = 4 bytes 50000100
*/

NOTE: To use these buttons

  • BLEAddrFilter must be set to 1 or above

  • MI32Option1 1 - otherwise teleperiod will act like a button press

  • Due to all buttons using same static random MAC address C1:A2:A3:A4:A5:A6 I dynamically update the MAC to include the Switch as the last two MAC values. Thus slots into the MI32 sensors functionality

  • If BLEAlias is used to remember buttons, both the static MAC address and the pseudo MAC addresses must be Aliased
    eg
    BLEAlias C1A2A3A4A5A6=AnyButton
    BLEAlias C1A2A3A40058=Button3 (where 0058 is the Switch ID)

Related issue (if applicable): fixes #

Checklist:

  • [X ] The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • [NA] The code change is tested and works with Tasmota core ESP8266 V.2.7.4.9
  • The code change is tested and works with Tasmota core ESP32 V.2.0.14
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@barbudor
Copy link
Contributor

Interresting, other Buttons seemed to be a pain to integrate due to encryption.
Too late for me as I decided to go zigbee for such use cases but great to see working solution in BLE.

@arendst arendst merged commit 3568b55 into arendst:development Nov 23, 2023
64 checks passed
@kabongsteve
Copy link
Contributor Author

@barbudor Similar issues, but I wanted units to directly interact with Tasmota and not require a separate service like MQTT or HomeAssistant.

IE my door/window sensors talk directly to each shutter controller so opening the window Locks the shutter to not operate.

These buttons are for my home grown Lift and (some of the shutters) and again want it running almost standalone without needing wifi or internet.

I was very pleased to find these and at <$5 each a bargain, especially with the fact there is no encryption .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants