Skip to content

[New Sensor]: #1563

Description

@kecsger

Sensor Description

BWT Perla water softener

Additional information

Hello! I would like to request support for the BWT Perla Bio / Perla water softener series.

Unlike standard passive BLE sensors that constantly broadcast telemetry advertisement packets, the BWT Perla uses a connected/active GATT polling approach to retrieve live capacity and historical consumption data.

I have successfully reverse-engineered and written a working bash script that connects via gatttool, reads specific characteristics, hex-decodes the payloads, and publishes them. Providing native or easier integration support for this would be amazing, but in the meantime, here is the working script I use to fetch and sync the data:

#!/bin/bash
MAC="XX:XX:XX:XX:XX:XX"
MQTT_HOST="YOUR_MQTT_IP"
MQTT_USER="YOUR_USERNAME"
MQTT_PASS='YOUR_PASSWORD'

# 1. Hardware Reset
sudo hciconfig hci0 reset
sleep 2

# 2. Step 1: Fetch Live Stats (Remaining Capacity, etc.)
echo "--- Step 1: Live Data ---"
RAW_LIVE=$(gatttool -i hci0 -b $MAC --char-read -a 0x003a | awk -F': ' '{print $2}' | tr -d ' ')

if [ ! -z "$RAW_LIVE" ]; then
    LIVE_JSON=$(echo $RAW_LIVE | xxd -r -p | sed 's/{"1": //;s/}$//')
    mosquitto_pub -h "$MQTT_HOST" -u "$MQTT_USER" -P "$MQTT_PASS" -t "home/bwt/perla/live" -m "$LIVE_JSON" -r
    echo "Success: $LIVE_JSON"
else
    echo "Failed to reach Perla for Live Data."
fi

sleep 3
# 3. Step 2: Fetch History/Consumption
echo "--- Step 2: Consumption ---"
RAW_COUNT=$(gatttool -i hci0 -b $MAC --char-read -a 0x003f | awk -F': ' '{print $2}' | tr -d ' ')
COUNT=$(echo $RAW_COUNT | xxd -r -p | grep -oE '[0-9]+' | head -n 1)

if [[ ! -z "$COUNT" ]]; then
    # Return to the "Yesterday" index logic (Count - 1)
    LAST_INDEX=$((COUNT - 1))
    WRITE_VAL=$(echo -n "{\"offset\":$LAST_INDEX}" | xxd -p | tr -d '\n')

    gatttool -i hci0 -b $MAC --char-write-req -a 0x0041 -n $WRITE_VAL > /dev/null

    # Standard 5-second wait
    sleep 5

    RAW_CONS=$(gatttool -i hci0 -b $MAC --char-read -a 0x0043 | awk -F': ' '{print $2}' | tr -d ' ')
    if [ ! -z "$RAW_CONS" ]; then
        CONS_JSON=$(echo $RAW_CONS | xxd -r -p)
        mosquitto_pub -h "$MQTT_HOST" -u "$MQTT_USER" -P "$MQTT_PASS" -t "home/bwt/perla/cons" -m "$CONS_JSON" -r
        echo "Success: $CONS_JSON"
    fi
else
    echo "Could not retrieve log count."
fi

echo "--- Sync Task Complete ---"to product details, etc.

GATT Characteristics Map Discovered:

  • MAC Address prefix: C4:DE:E2:... (BWT Water Softener)-
  • Live Stats Handle: 0x003a (Returns JSON string containing remaining capacity, percentage, etc.)-
  • Log Count Handle: 0x003f-
  • Log Offset Write Handle: 0x0041
  • Consumption History Handle: 0x0043

BLE advertisements

See above.

Metadata

Metadata

Assignees

Labels

new sensorRequest for a new sensor

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions