Ble Button For Your Photon 2

About the project

Transform your Photon 2 with a Shelly BLE button, enabling customizable, wireless control for smart home automation and DIY projects.

Project info

Difficulty: Moderate

Platforms: Particle

Estimated time: 2 hours

License: MIT license (MIT)

Items used in this project

Hardware components

Particle Photon 2 Particle Photon 2 x 1
Shelly BLU Button Shelly BLU Button x 1

Story

This guide will show you how to add Bluetooth Low Energy button functionality to your Particle Photon 2, enabling you to create customizable, wireless controls for various applications.

These buttons can be used with any current or future Particle device that supports BLE.

Particle Photon 2

This powerful Wi-Fi microcontroller from Particle continuously scans for nearby Shelly sensors.

For the longest range, add an external BLE antenna (and enable it in the code).

Shelly BLU button setup

Press shortly once, twice, or three times, or press and hold for about 2 sec to emit a signal. It advertises this data in the BTHome format.

It is recommended to update the Shelly devices to the latest firmware using the Shelly app. In case of trouble, you can use the Shelly debug app.

For more technical information, click here.

BTHome

BTHome is an open standard for broadcasting sensor data and button presses over Bluetooth LE.

BTHome is an energy efficient but flexible BLE format for devices to broadcast their sensor data and button presses. Devices can run over a year on a single battery. It allows data encryption and is supported by popular home automation platforms, like Home Assistant, out of the box.

For visiting the BTHome website, click here.

Code

The Particle beacon-scanner library was updated as part of this project to detect BTHome devices.

The minimal code to scan and get information from these devices is on GitHub.

Here's the output of a couple of these buttons read by the Photon 2:

0000124363 [app] INFO: Scanning...
0000124403 [app] INFO: BTHome Address: B0:C7:DE:2C:16:17, Battery: 97, Button: 1, Window: 0, Rotation: 0
0000124428 [app] INFO: BTHome Address: B0:C7:DE:61:14:15, Battery: 99, Button: 1, Window: 0, Rotation: 0
0000124454 [app] INFO: Scanning...

Printable examples

Here are some nice 3D printables:

Usage Examples

Use these buttons in your project to accomplish practically anything you want on your Photon 2.

Connectivity Options:

If there is no Wi-Fi available, Particle offers alternative options:

Code

Github

Credits

Photo of gusgonnet

gusgonnet

If you need professional help with a project, contact me at gusgonnet@gmail.com

   

Leave your feedback...