View Categories

How can I get the battery status of each beacon?

1 min read

To monitor the battery status of your Blue Charm beacon in Home Assistant, ESPHome, or other scanning hardware, you can use either of the following two methods:

Method 1: Using Eddystone TLM Broadcast (Recommended) #

This is the easiest and most battery-efficient method. You can configure your beacon to advertise iBeacon on Channel 0 (SLOT0) and Eddystone TLM on Channel 1 (SLOT1).

Broadcasting TLM is a standard passive advertisement and requires no active scanning, BLE connection, or password authentication.

Eddystone TLM Payload Breakdown (14 Bytes) #

When your scanner captures the Eddystone TLM advertisement (0xFEAA Service UUID), the payload follows this format:

Byte IndexFieldFormat / Byte OrderExample Decoded
0Frame Type0x20 (TLM)
1Version0x00 (Unencrypted)
2 – 3Battery Voltage16-bit Big-Endian (mV)0x0C6F = 3,183 mV (3.183 V)
4 – 5Beacon Temperature8.8 Fixed-Point (°C)0x1800 = 24.0°C
6 – 9ADV Count32-bit Big-Endian1,379 packets
10 – 13Uptime32-bit Big-Endian (0.1s)3,312,658 (~3.8 days)

Extracting Data & Battery Percentage #

  • Voltage Decoding: Bytes 2 and 3 contain the battery voltage in millivolts. Convert to Volts using:
    Voltage (V) = (Byte2 * 256 + Byte3) / 1000
  • Percentage Calculation: Eddystone TLM does not broadcast a percentage directly. Blue Charm beacons stop broadcasting when the battery reaches 2.5V. You can map 3.0V as 100% and 2.5V as 0% using a Home Assistant template sensor.

Method 2: Active Scan Requests (Scan Response Data) #

If you prefer to obtain an internally calculated battery percentage without deriving it from voltage, your scanning hardware must send an Active Scan Request to the beacon. The beacon will reply with a Scan Response Packet containing both the battery status and the device name.

Note: The beacon must be set to Connectable mode to respond to scan requests. Keeping the beacon in connectable mode reduces expected battery life by roughly 20% compared to non-connectable mode. No password authentication or pairing is required.

Scan Response Data Format #

When an active scan request is made, the beacon responds with a combined payload containing Service Data (0x8020) and the Device Name (0x09):

Plaintext

Scan Response Raw Data Example:
09 16 8020 67 04 0BB8 0BB9 14 09 4557435F323630303031303030

1. Service Data Portion (0x8020) — Battery & Beacon Info #

Byte IndexFieldFormat / RemarkExample Value
0Data Length0x09 (9 bytes)09
1Data Type0x16 (Service Data)16
2 – 3Service ID0x802080 20
4Battery Percent1-byte integer (If value > 100, treat as 100%)67 (103% $\rightarrow$100%)
5Adv TypeBroadcast subtype (e.g., 0x01 or 0x04)04
6 – 7Major ID2 bytes (Big-Endian)0B B8 (Major 3000)
8 – 9Minor ID2 bytes (Big-Endian)0B B9 (Minor 3001)

2. Device Name Portion (0x09) #

Byte IndexFieldFormat / RemarkExample Value
0Data LengthLength of device name payload14 (20 bytes)
1Data Type0x09 (Complete Local Name)09
2+Device NameASCII String455743... (“EWC_260001000”)

Summary Comparison #

  • TLM Broadcast Method (Method 1): Passive advertisement (no active scanning needed), optimal battery life, provides exact voltage (mV), requires template logic to derive percentage.
  • Scan Response Method (Method 2): Requires Active Scanning and setting the beacon to Connectable mode(~20% higher battery consumption), but provides direct battery percentage alongside the device name.