Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to expose sub “Power On/Off” control to HomeKit? #157

Closed
NateUT99 opened this issue Dec 15, 2020 · 4 comments
Closed

Possible to expose sub “Power On/Off” control to HomeKit? #157

NateUT99 opened this issue Dec 15, 2020 · 4 comments

Comments

@NateUT99
Copy link

I recently added a Sonos sub to my system and noticed that it has a separate power on/off control exposed in the S2 app. I was curious to see if that could be exposed to HomeKit so I could add it to some of my evening automations and scenes, primarily so I could turn it off in the evening when my toddler goes to bed, and then turn it back on as part of my “Good Morning” scene. Do you know if making this a switch via this plugin is possible?

@ebaauw
Copy link
Owner

ebaauw commented Dec 15, 2020

Setting the sub on or off is straightforward enough:

Transmission Control Protocol, Src Port: 50491, Dst Port: 1400, Seq: 1, Ack: 1, Len: 793
Hypertext Transfer Protocol
eXtensible Markup Language
    <s:Envelope
        xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
        s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <s:Body>
            <u:SetEQ
                xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1">
                <InstanceID>
                    0
                    </InstanceID>
                <EQType>
                    SubEnable
                    </EQType>
                <DesiredValue>
                    1
                    </DesiredValue>
                </u:SetEQ>
            </s:Body>
        </s:Envelope>

The master (in my case the PlayBar) seems to send notifications on changing it:

Transmission Control Protocol, Src Port: 45750, Dst Port: 3400, Seq: 1, Ack: 1, Len: 699
Hypertext Transfer Protocol
eXtensible Markup Language
    <e:propertyset
        xmlns:e="urn:schemas-upnp-org:event-1-0">
        <e:property>
            <LastChange>
                 &lt;Event xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/RCS/&quot;&gt;&lt;InstanceID val=&quot;0&quot;&gt;&lt;SpeakerSize val=&quot;6&quot;/&gt;&lt;SubGain val=&quot;0&quot;/&gt;&lt;SubCrossover val=&quot;0&quot;/&gt;&lt;SubPolarity val=&quot;0&quot;/&gt;&lt;SubEnabled val=&quot;1&quot;/&gt;&lt;/InstanceID&gt;&lt;/Event&gt;
            </LastChange>
        </e:property>
    </e:propertyset>

Best expose this as an extra characteristic on the Speaker service (like Treble, Bass, etc). You will have to use Eve, but once you create a scene in that app, you can recall it from Home (or Siri).

Note to self: don't forget to add support to zp as well.

ebaauw added a commit to ebaauw/homebridge-lib that referenced this issue Dec 15, 2020
- Add `SubEnabled` characteristic, see ebaauw/homebridge-zp#157.
ebaauw added a commit that referenced this issue Dec 15, 2020
- Bug fix: `getEq()` always returned `false`;
- Add `getSubEnable()` and `setSubEnable()`, see #157.
ebaauw added a commit that referenced this issue Dec 15, 2020
- Add `zp subEnable [on|off]`, see #157.
ebaauw added a commit that referenced this issue Dec 15, 2020
- Add _Sub Enabled_ characteristic to _Speaker_ service, see #157;
- Bug fix: TV inputs not always set correctly on startup.
@ebaauw
Copy link
Owner

ebaauw commented Dec 15, 2020

Could you try beta v1.1.4-0? It seems to work for Sub connected to my PlayBar. Do you have the Sub connected to a home theatre setup, or to a regular stereo pair?

@NateUT99
Copy link
Author

Could you try beta v1.1.4-0? It seems to work for Sub connected to my PlayBar. Do you have the Sub connected to a home theatre setup, or to a regular stereo pair?

Will try and report back when I get home this evening. The sub is part of a home theater setup with a beam and two on SLs.

@NateUT99
Copy link
Author

NateUT99 commented Dec 16, 2020

I have been playing around with it for an hour or so now and everything appears to work as expected! Will continue testing and report back if any issues arise but at this moment it looks good.

@ebaauw ebaauw closed this as completed Dec 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants