A Knob for the Room

My television plays through a Sonos system. I also have an IKEA SYMFONISK lamp with a built-in Sonos speaker. When I wanted the film’s audio through the lamp as well, I had to find my phone, open the Sonos app, add the lamp to the television’s speaker group, and adjust the volume. Then I could settle down and watch the film.

Finding the phone was often the first problem. Like the TV remote, it was never where I needed it when I needed it. The rest was only a few steps in an app, but I wanted a physical control I could reach from the sofa: press to add the lamp, turn to adjust the volume, press again to remove it while the TV speakers carry on.

I had an IKEA SYMFONISK E1744 remote: a small wireless knob that can be pressed and turned [1]. Echomotus connects that remote to the Sonos system using an ESP32-C6 development board. The board receives the remote’s Zigbee messages and sends commands to Sonos over Wi-Fi. It controls which speakers play and how loud they are; the audio itself never passes through the board.

The prototype does this without an IKEA hub, Home Assistant, or a cloud service for the controller. Getting it to work meant checking what the remote actually transmitted, making Zigbee and Wi-Fi work together on the same board, and changing the volume without losing the balance between speakers. Those are the three problems this article follows.

Three gestures, one existing system

My setup has a Sonos Amp, two SYMFONISK bookshelf speakers, a SYMFONISK lamp speaker, and a Philips OLED854 television. For the controller, the useful distinction is between the television room, called Salotto, and the lamp as a separate Sonos room. The lamp can join the television room’s group and leave it again. Echomotus is not supposed to reconfigure the relationship between the other speakers.

The interaction is deliberately small:

GestureEffect
PressAdd the lamp to the television room’s group
TurnChange the television room’s volume and, while grouped, the lamp’s
Press againRemove the lamp from the group

Joining first reads the television room’s volume and sets the lamp to the same numeric value. After that, the rooms can be adjusted independently in the Sonos app. Subsequent turns should respect the resulting balance. Matching the numeric values is a control policy; it does not establish equal sound pressure from two different speakers.

I did not want to add Home Assistant, an IKEA hub, an MQTT broker, or a cloud service to perform those three actions. That is a constraint on this controller, rather than a claim about everything Sonos itself might need. The controller’s job fits on a board that is powered over USB and stays on the local network.

Its most useful boundary is where it sits relative to the audio:

E1744 remote -- Zigbee --> ESP32-C6 -- Wi-Fi / HTTP --> Sonos
                               ^
                               |
                         local browser

Television ---------------- audio -----------------> Sonos

Unplugging the board removes the extra controls. It does not cut a cable in the television’s audio path. That follows from the wiring; preserving every existing grouping and television behaviour still needs regression testing.

Read the gesture before designing the timer

My first design treated rotation as a duration. A Zigbee Move would start a local timer, the timer would change the volume periodically, and Stop would end the motion. A deadline would stop a lost Stop from leaving the volume running indefinitely.

That is a plausible interpretation of the command names. It was not the interaction observed on the remote.

To check that interpretation, I paired one E1744 with the C6 running Espressif’s Zigbee SDK [2], bound the OnOff and LevelControl clusters to the board, and logged the incoming commands. Wi-Fi was disabled for this capture. I pressed the remote and turned it in both directions:

Physical actionClusterCommandPayload
Single press0x00060x02, Toggleempty
Clockwise step0x00080x01, Move00 c3 00 00
Anticlockwise step0x00080x01, Move01 c3 00 00
End of a step0x00080x03, Stop00 00

Every observed step produced a Move/Stop pair. Stop followed about 0.2–0.4 seconds later. Continuous turning produced more pairs. The rate field stayed at 195, so it supplied no useful measurement of how fast the hand was turning in that session.

The integrated prototype therefore counts Move messages as steps. Its control task combines a burst of queued steps using a 60 ms receive window, then applies two volume points per net step. Stop is counted for diagnostics; it does not drive a repeating volume timer in this implementation.

The capture changed the implementation from a repeating timer to a count of physical steps. This test covered one remote in one session; I did not test double-click, triple-click, or long-press behaviour.

Two radios on the box, one radio to share

The C6 shares one radio between Wi-Fi and Zigbee. Espressif documents the arbitration between them and the limits of concurrent operation [3].

The first radio problem looked like a networking failure. Wi-Fi alone associated in about a second, and a minimal HTTP statistics endpoint replied in about 20 ms. Starting Zigbee made those results disappear.

I compared Wi-Fi alone with both stacks running, changed their startup order, and then enabled coexistence explicitly. The setup was one C6, ESP-IDF 5.5.5, ESP Zigbee SDK 1.6.x, Zigbee channel 25, and Wi-Fi channel 3 at approximately −40 dBm. I checked Wi-Fi association, ping replies, and responses from a minimal HTTP statistics endpoint:

ConfigurationResult
Wi-Fi aloneAssociation about 1 s; HTTP about 20 ms
Zigbee started before Wi-Fi, coexistence call absentWi-Fi association failed
Zigbee started after Wi-Fi, coexistence call absentAll ping probes lost; HTTP timed out
Coexistence explicitly enabled after Wi-Fi start8/8 ping replies; HTTP 16–89 ms

The relevant call in the prototype is:

esp_coex_wifi_i154_enable()

It is made after esp_wifi_start(), with software coexistence enabled in the build configuration. In this setup, starting both stacks without that call left the Wi-Fi connection unusable. Enabling coexistence made the combined experiment usable again.

With Wi-Fi responding again, I checked whether browser traffic affected the remote. I counted 20 physical presses while an HTTP poller made one request every half-second, then counted another 20 without concurrent HTTP requests. The board’s Toggle counter gave the received count:

Load during the pressesPhysical pressesToggle messages received
HTTP polling every 0.5 s2017
No concurrent HTTP requests2020

During the polling run, all 147 HTTP requests completed, with a median response time of 111 ms and p95 of 127 ms.

The browser could therefore look healthy while physical input was being missed. Measuring HTTP availability alone would have hidden the problem. This test does not identify the cause of the missed presses. It does show that a responsive HTTP endpoint is insufficient evidence that the remote is working reliably. The next radio test needs more presses under concurrent browser and Sonos traffic.

Group volume was the wrong operation

The second surprise was further up the stack. Sonos exposes a group-volume operation, which sounds like exactly what a knob controlling a group should use.

I set Salotto to 63 and the lamp to 53, then requested a group volume of 54. Reading back the two room volumes gave 54 and 54. The independently chosen balance was gone. That one result was enough to reject SetGroupVolume for this interaction; it says nothing universal about every Sonos topology or firmware version.

Echomotus instead reads each room’s volume and calculates separate targets. The television room is the reference. If its current value is ss, the lamp’s is ll, and the requested step is dd, the calculation before final per-room clamping is:

s′=clamp⁡(s+d),l′=round⁡(ls′s),s>0.s' = \operatorname{clamp}(s + d), \qquad l' = \operatorname{round}\left(l\frac{s'}{s}\right), \quad s > 0.

For example, a two-point reduction from 63 gives 61. The lamp target is then round⁡(53×61/63)=51\operatorname{round}(53 \times 61 / 63) = 51. Both move down while retaining approximately the same ratio between their numeric settings. This preserves a ratio, rather than a fixed difference or a measured acoustic balance.

The C implementation makes the zero case explicit:

int nl = (s == 0) ? l + delta
                 : (int)lroundf((float)l * (float)ns / (float)s);

When the reference volume is zero there is no ratio to preserve, so the lamp receives the same absolute delta. Each write is clamped to the prototype’s allowed range. At the boundaries, preserving the ratio becomes impossible.

There is another limit before the boundaries: rounding at every step can accumulate drift. Starting at 63 and 53, two steps down followed by two up returned both rooms to their initial values in the short test. The code still rounds from integer readings at each step, so that result does not establish that longer sequences will return exactly. A floating-point baseline retained between gestures would avoid repeated rounding; it would also need to be refreshed when the Sonos app changes a volume.

A toggle becomes a question about state

Pressing the remote sends Toggle. The controller still has to find out what it would be toggling.

The prototype reads GetZoneGroupState, looks for the expected television-coordinated group, and checks whether the lamp belongs to it. To add the lamp, it reads the television room’s volume, sets the lamp’s volume, then sends SetAVTransportURI to the lamp with an x-rincon: URI naming the television coordinator. To remove it, it sends BecomeCoordinatorOfStandaloneGroup to the lamp. These local UPnP grouping operations are also implemented in the open-source Sonos controller SoCo [4].

There is no Play request in that sequence. The intended change is the lamp’s membership, leaving the television room’s source and the other speakers’ configuration alone.

The operations are several network requests, so they cannot be treated as one indivisible action. Setting a volume can succeed before joining fails. Updating the television volume can succeed before updating the lamp fails. A timeout can happen after Sonos has already acted.

The design calls for observing state again after an uncertain outcome, rather than blindly repeating a toggle or a relative change. The prototype does not yet implement that full reconciliation. A mutex serializes its Sonos operations, and the control task clears queued gestures after a group change so that presses accumulated during that operation are not replayed. Those mechanisms limit overlap; they do not make the requests atomic or establish their final effect.

Where the prototype stands

The integrated prototype is written in C on ESP-IDF. The C6 runs the Zigbee coordinator, receives gestures, sends Sonos commands over Wi-Fi, and serves a browser interface at echomotus.local. A separate Rust prototype implements the HTTP and Sonos side; it does not yet integrate the remote.

The C firmware is configured for this installation: speaker addresses and identifiers are compiled in, and topology parsing uses string searches. It allows volume values from 0 to 100. Wi-Fi credentials are also compiled in, and the browser controls have no authentication. Discovery, configuration, and authenticated access are still needed before this can be installed on someone else’s network.

The experiments answered three immediate questions. The remote sends a Move/Stop pair per observed step. Explicit coexistence made Wi-Fi usable alongside the Zigbee coordinator in this setup, but concurrent HTTP traffic still coincided with missed presses. Separate room-volume writes preserved the chosen balance in a short test where the group-volume operation had flattened it.

Longer input tests and recovery from partial Sonos operations are the next work. The interface I wanted remains the same: sit down, press to add the lamp, turn the knob, and watch the film.


References

[1] IKEA. SYMFONISK sound remote, E1744 — user manual. The remote’s physical controls and its intended operation with the TRÅDFRI gateway; Echomotus replaces that gateway for the interaction described here.

[2] Espressif. ESP Zigbee SDK. The Zigbee SDK used to implement the coordinator and receive the remote’s commands. The experiments in this article used the 1.6.x series.

[3] Espressif. RF Coexistence — ESP32-C6, ESP-IDF 5.5.5. The shared radio, coexistence configuration, and performance limits of simultaneous Wi-Fi and IEEE 802.15.4 operation.

[4] SoCo. Sonos controller implementation. A public implementation of local Sonos control, including join with SetAVTransportURI and an x-rincon: URI, and unjoin with BecomeCoordinatorOfStandaloneGroup. SoCo is a protocol reference here, not a dependency of Echomotus.