PROJECT 001 / HOME AUTOMATION

A Bluetooth sofa.
A smarter connection.

Reverse-engineering my sofa’s Bluetooth controls and bringing them into Home Assistant.

PythonBluetooth LEHome AssistantRaspberry Pi 4
THE STARTING POINT

Bluetooth-enabled Poltronesofà sofas with a manufacturer’s app.

THE BUILD

A custom Python integration and a Home Assistant dashboard for two sofas.

THE RESULT

Headrest, footrest, stop and child-lock controls in my existing smart-home interface.

01 / THE IDEA

One more device.
One less separate app.

I wanted my Poltronesofà sofas to sit alongside the rest of my home controls in Home Assistant. The sofas already had Bluetooth, and the Raspberry Pi 4 running Home Assistant OS already had a Bluetooth radio. The missing piece was understanding the commands.

Rather than adding a separate Wi-Fi controller, I used the existing hardware and built the connection in software. My phone accesses the Home Assistant dashboard over the network; the Pi sends the actual commands to the sofas over Bluetooth.

Phone dashboardHome Assistant
Custom Python integration
Pi 4 BluetoothSofa

02 / DECODING BLUETOOTH

Listening before building.

I used Android Bluetooth packet captures to analyse the traffic generated by the manufacturer’s app. Comparing the traffic with the controls I pressed let me identify the commands for headrest movement, footrest movement, stop and child locking.

The integration reproduces those command payloads through Bluetooth Low Energy GATT writes. It also subscribes to notifications when querying the sofa’s child-lock state.

ONE DECODED MOVEMENT COMMAND PYTHON
# Headrest out: the payload sent over Bluetooth.
headrest_out = bytes.fromhex(
    "05 01 05 01 00 00 00 00"
)

An example from my integration. Device addresses are not included in this write-up.

03 / THE INTEGRATION

More than a command sender.

I wrote a custom Home Assistant integration in Python, using Bleak and Home Assistant’s Bluetooth support. The integration exposes button entities for movement and stopping, plus a switch for the child lock.

01

Two movement modes

Timed commands schedule a stop after seven seconds. Jog commands keep a Bluetooth connection open so the dashboard can send stop when a held button is released.

02

Connection handling

Connection and command retries account for Bluetooth interruptions, with cleanup when operations finish or fail.

03

A dedicated stop path

Stop requests invalidate older queued movements. The code uses the existing jog connection when available, with a fresh connection as a fallback.

04

State that is checked

After a child-lock change, the integration queries the sofa again and checks its reported state, rather than simply assuming the command worked.

04 / THE DASHBOARD

Try the controls.

I built the dashboard using Home Assistant’s custom button-card: large hold-to-move controls, a prominent stop button and a separate child-lock switch for each sofa.

This browser demo recreates those interactions. It does not connect to Home Assistant, Bluetooth or any real device.

BROWSER SIMULATION NO DEVICE CONNECTION

Sofa 1

Hold a direction to move. Release to stop.

HEADREST

0%

FOOTREST

0%

TIMED MOVEMENT

Tap once. A stop is scheduled after seven seconds.

Ready. This is a simulation, not a live device.

Give it a go

  1. Hold OUT to extend the simulated headrest or footrest.
  2. Release the button to stop.
  3. Try the timed controls, then press STOP.
  4. Lock the controls and try to move again.
  5. Switch sofas to see their independent simulated states.
About “full travel”

My Home Assistant dashboard labels its one-tap controls “Full travel”. In the integration, these are timed commands with a stop scheduled after seven seconds, not position-controlled moves.

The demo’s percentages are visual simulation values. The integration does not provide measured headrest or footrest positions.

05 / THE TAKEAWAYS

The interesting part is the detail.

This project brought together protocol analysis, asynchronous Python, Bluetooth communication and interface design. Sending a command was only part of the work: reading state back, handling connections and coordinating movement and stop requests made the integration much more useful.

It is a personal integration built around my own sofas. This page documents that build rather than claiming compatibility with every model.

Working on a similar project? Say hello
← Back to projectsPERSONAL PROJECT / BUILT AT HOMEMore from the workbench ↗