Skip to content

Power Control Role #127

Closed
Closed

Description

@DanielHabenicht

If a sendspin client is used as a proxy for a sound system (or the goal is to save power by shutting down amplifiers) there currently is no way to control the power state via the protocol.
The current controller role only supports volume, mute and state or severing the connection (with not way to turn it back on).

Examples for external power control:

  • the bluetooth connection to a speaker
  • the sound system via e.g. RF or IR.
  • a power switch to an external system

Other protocols also support this use case, e.g. Squeezelite -S <Power Script>.

This would also allow to implement real power control in music assistant for sendspin devices, see https://github.com/orgs/music-assistant/discussions/4359

Proposal: power@v1 role

Every client which lists the power role in the supported_roles of the client/hello message needs to implement all messages in this section.

Server → Client: server/command controller object

The controller object in server/command has this structure:

  • power: object
    • desired_state: 'on' | 'off'

'on' - turn the sound system on, so audio playback of music is possible
'off' - turn the sound system off, so audio playback of music is not possible

Client→ Server: client/state power object

The power object in client/state has this structure:

  • controller: object
    • supported_states: string[] - subset of: 'on' | 'off'
    • current_state: string - one of supported_states

When a client cannot play music because the sound system is off it should either send state: 'error' via client/state, or turn on the sound system to resume playback.

Activity

  1. Hedda commented on Aug 17, 2026

    @Hedda
    • a power switch to an external system

    I really like this concept, but wondering how would server vs. client role work exactly in a real world use case where ex. have a power-switch (e.g. smart power-plugs/relay) connected to external DAC and/or external power-amplifier to save electricity while idle?

    Physical/logical architecture example:

    • Music Assistant with Sendspin Player Provider (server-side) <-> Sendspin client on receiver with line-out <-> external DAC <-> Amp

    Like you argue it would in this use case be great if Sendspin had some way to command power control change state of the power-switch.

    Yes you could of course already create automations for this using Home Assistant and even make Blueprints from Music Assistant to make those easier to create, but what if you think about the big-picture where you would like Sendspin to be adopted by other ecosystems as well that might not involve Music Assistant or Home Assistant. In such a scenario it would be a good idea if the Sendspin protocol specifation has a native power ontrol role as suggested here above by @DanielHabenicht

  2. maximmaxim345 commented on Aug 18, 2026

    @maximmaxim345
    Member

    How would this differ from hooking into the stream start/end messages of the player@v1 role?
    With required_lead_time (https://github.com/Sendspin/spec#client--server-clientstate-player-object) its also already possible to factor in the time the connection/power switch needs to turn on, so playback can start without cutting of the beginning of the track.

    Playback can only happen with a started stream, so this should be the ideal indicator whether the speaker needs to be turned on/off. Or is there a use case I am not thinking of?

  3. PerDeg commented on Aug 18, 2026

    @PerDeg

    I think a very useful use case for power@v1 would be controlling a standard 12 V amplifier trigger from a Sendspin client.

    Many power amplifiers and active speakers have a 12 V trigger input specifically for this purpose. Missing this on the sonos connect units im replacing with sendsend spin clients now. I would use it to better control my multiroom amplifiers from sleep that has a 12v Trigger input.

    I like the idea of having this represented by power@v1 rather than implementing it as a separate Home Assistant automation or client-specific playback hook. If playback starts i would always like the AMP to wake up from sleep.

    I have this and it supports 3-30V DC/AC trigger input
    https://www.parts-express.com/Dayton-Audio-MA1240a-Multi-Zone-12-Channel-Amplifier-300-815

  4. DanielHabenicht commented on Aug 18, 2026

    @DanielHabenicht
    Author

    How would this differ from hooking into the stream start/end messages of the player@v1 role?

    Thanks for challenging this, altough it might be unpopular.

    For playing I agree with you that there would be no explicit need for turning it on (although, the power state would support use cases where the external playback device can already be turned on before music is actually played (e.g. when user enters a home) and thus the delay until playback can be shortened for the actual play command).

    My problem currently stems from not knowing and not being able to externalize the power off state.
    Of course I can turn off the device when playback pauses but is this just a pause because the user switches tracks? Is it because he left the house and everything is save to turn off? Just adding device internal delayed switches does not play nicely with automation.

    So having this explcitly in the protocol would clearly define those use cases, while still retaining the current functionality (and also the functionality for devices not implementing it)

  5. maximmaxim345 commented on Aug 18, 2026

    @maximmaxim345
    Member

    My problem currently stems from not knowing and not being able to externalize the power off state. Of course I can turn off the device when playback pauses but is this just a pause because the user switches tracks? Is it because he left the house and everything is save to turn off? Just adding device internal delayed switches does not play nicely with automation.

    Have you tried the "Fake power control" setting in Music Assistant? Thats of course not part of Sendspin, but that might work for your use case.

    But even if Sendspin natively support power controls, you need the Sendspin server or client to relay this information to Home Assistant.

  6. DanielHabenicht commented on Aug 18, 2026

    @DanielHabenicht
    Author

    Yes, I could use this. But I am building a sendspin component for https://github.com/UbiHome/UbiHome and having it integrated, so users do not need to setup FAKE controls and automations based of that, is what motivated this request.

    So to see it in perspective the power control protocol expansion is exactly what should replace the fake control currently implemented for music assistant sendspin players.

  7. balloob commented on Aug 19, 2026

    @balloob
    Contributor

    We have discussed this and decided that this is not something that we want to implement.

  8. DanielHabenicht commented on Aug 20, 2026

    @DanielHabenicht
    Author

    Just so its clear for anybody coming across this issue can you elaborate on the why? And maybe if it will be reconsidered in the future? (By popular demand or just not at all)

  9. maximmaxim345 commented on Aug 20, 2026

    @maximmaxim345
    Member

    We think power control is the client's responsibility. A power role would move it onto the user instead, because someone then has to decide the policy: when to turn off, after how long, under what conditions. Today the client vendor picks a sensible default and the user never thinks about it. Whether it would even work as a stand alone role is a separate question I'll go into later.

    Lets view both halves separately:

    Power-on. The protocol already carries enough. If the group's playback_state is playing, the output needs to be on. group/update isn't role-gated, so even a player-only client receives it. No new data required. Except if you want to pre-warm an amplifier or similar, but this is a really niche use case.

    Power-off. Same signal plus a timeout: power down once playback_state has been stopped for a while. That covers the large majority of cases. It's also a UX question. Why should a user have to think about the amplifier at all? Sendspin is deliberately always-on, play resumes the group's last media and that history persists across reboots, so there's no "turn the system on first" step to model. It also adds a state the group has to reason about: a powered-off player is semantically a player that isn't ready to play, which is a second flavour of not-ready alongside available, and one more reason pressing play might not simply work. That's a lot to put in front of someone who just wants to hear music on their speaker.

    And even if we figure out how to solve the UX problem, it's genuinely hard to get right on how this should look like.

    For example: No auto power-off costs you electricity. Doing it server-side is worse rather than better: a client holds one admitted connection at a time, so a displaced server's power intent is orphaned, and if a server simply disappears there's nobody left to turn the amp off. You end up back at the two rules above:

    • turn on when the group starts playing
    • turn off after X minutes stopped

    Where it would even live is also unclear. Making it core would force it on regular speakers that handle power themselves. As a standalone role it doesn't fit the model: roles are activated independently, so you get player active with power declined, where the server schedules playback into an amp it can't turn on and the client has no way to say so. Closest fit would be the player role, and that needs a lot more thought than this feature warrants right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions