The example showcases the implementation of BTHome support for Silicon Labs development kits.
The example application illustrates how BTHome can be effectively utilized with Silicon Labs development kits to communicate internal temperature sensor values to a Home Assistant setup running on a Raspberry Pi 4. This demonstration will provide developers with insights into integrating BTHome with Silicon Labs hardware for IoT applications.
The BTHOME v2 sensor device is a BGM220 Explorer Kit that reads the internal temperature sensor and sends BLE advertisement packets in the BTHome v2 format.
Raspberry Pi 4 runs a Home Assistant OS that scans for and detects BTHome v2 sensor device. Users use the Home Assistant application on the smartphone to communicate with Raspberry Pi 4 to get the advertisement packet of the BTHome v2 sensor device, parse and display it on a smartphone.
- SDK version
- Software Required
- Hardware Required
- Connections Required
- Setup
- How It Works
- Report Bugs & Get Support
- 1x Bluetooth Low Energy Development Kit. For simplicity, Silicon Labs recommends the BGM220-EK4314A
- 1x Raspberry Pi 4 running Home Assistant OS
- 1x smartphone running Home Assistant application
The following picture shows the connection for this application:
To test this application, you can either create a project based on an example project or start with a "Bluetooth - SoC iBeacon" project based on your hardware.
Note
-
Make sure that the Third Party Hardware Drivers extension is installed as part of the SiSDK and the bluetooth_applications repository is added to Preferences > Simplicity Studio > External Repos.
-
SDK Extension must be enabled for the project to install the required components.
-
From the Launcher Home, add your product name to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project filtering by "bthome v2".
-
Click Create button on Bluetooth - BTHome v2 - Internal Temperature Monitor example. Example project creation dialog pops up -> click Create and Finish and the project should be generated.
-
Build and flash this example to the board.
-
Create a Bluetooth - SoC iBeacon project for your hardware using Simplicity Studio 5.
-
Copy all the
src/app.cfile into the project root folder (overwriting the existing file). -
Install the software components:
-
Open the .slcp file in the project
-
Select the SOFTWARE COMPONENTS tab
-
Install the following components:
- [Services] → [IO Stream] → [Driver] → [IO Stream: USART] → default instance name: vcom
- [Application] → [Utility] → [Log]
- [Platform] → [Driver] → [TEMPDRV]
- [Third-Party Hardware Drivers] → [Services] → [BTHome v2]
-
-
Build and flash the project to your board.
Note
To utilize the BTHOME sensor device, you have two options. You can use Silicon Labs development kits and run either the "BTHome v2 - Internal Temperature Monitor" example or create your own project by following the instructions provided in the "Setup" section above.
-
Power on Raspberry Pi 4 and BTHOME sensor device. After powering on, the BTHOME sensor device sends the advertisement packet every 10 seconds that contains the temperature value.
-
Open the Home Assistant application on the smartphone, select [Settings] → [Devices and Services] → [Add Integration]
-
Add Integration with the name 'BTHome'. You can see the list of device, which is advertising in BTHome format. Choose your device with the correct name (it is 'Temp 79B4' in this example) and submit the Bindkey, which is defined in the firmware of the BTHOME sensor device.
The name and Bindkey in the firmware of the sensor device.
-
After adding your sensor device successfully with the Bindkey, select a suitable area where your sensor device is located.
-
Now you can see your sensor is already added to the Home Assistant system. You can track the temperature value from your sensor by selecting your device in BTHome.
Note
To be able to find your sensor device with the home assistant application, you need to use the same network on both Raspberry Pi 4 and the smartphone.
To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of bluetooth_applications repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues.
Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of bluetooth_applications repo.