Giter Site home page Giter Site logo

Comments (10)

ebaauw avatar ebaauw commented on May 30, 2024 1

Cool. I'll bring out a non-beta release with this shortly.

from homebridge-zp.

ebaauw avatar ebaauw commented on May 30, 2024

You can accomplish this already using HomeKit scenes. Simply create a scene switching on the Speaker services of the zones you want to group. In the Home app, you can turn off the scene and the zones are ungrouped again.

from homebridge-zp.

Garywoo avatar Garywoo commented on May 30, 2024

I have found that using scenes in this way is quite cumbersome if you want to manage multiple groups, even if only one is active at a time. My suggestion would enable support for multiple groups with ease.

For example - my current use case:

  • During my morning routine, I'd like my bedroom and bathroom speakers to be grouped so my alarm plays in both rooms synchronized.
  • Once the alarm is finished, I'd like to un-group these two speakers so that they are separate again, for seperate use later in the day.
  • I have another set of speakers in my kitchen that are always grouped.

With homebridge-zp right now, I have to create multiple automations that fire minutes apart to first un-group everything, then re-group the desired speakers, i.e:

  1. Before alarm - Un-group all
  2. Before alarm - group bedroom + bathroom
  3. After alarm - Un-group all
  4. After alarm - group kitchen speakers

With this described automation-flow, I'm still running into the issue described in #40, where the platform coordinator speaker ends up joining the first group created after un-grouping all speakers.

I believe that a switch to perform pre-defined grouping would allow for more robust grouping, and would remove the need to un-group everything before creating a new group, and think such a feature is worth considering.

from homebridge-zp.

ebaauw avatar ebaauw commented on May 30, 2024

I have found that using scenes in this way is quite cumbersome if you want to manage multiple groups

Yes. In its current setup, homebridge-zp effectively handles only one group. I understand your use case, and would like to support multiple groups through homebridge-zp. I don't think having pre-defined groups is the answer, though. I want homebridge-zp to mimic, as much as possible, the functionality of the Sonos app in HomeKit. Defining pre-defined groups (in config.json?) is beyond that scope.

It's been quite challenging to match the Sonos functionality to HomeKit. Sonos uses hypermedia controls, where the zoneplayer informs the app what actions are possible at this moment. HomeKit requires a fixed configuration, that is only supposed to change with firmware upgrades. That's why I came up with the current implementation: use each zoneplayer as fixed group (coordinator), and, through the Speaker service, allow another zoneplayer to join this group.

Instead of using the opaque concept of a "platform coordinator" (which I never really liked anyway, because it's not transparent to the user), I could probably list the possible groups (or rather: coordinators) per zoneplayer, and allow the user to pick the coordinator to join. That would probably forego the functionality for a coordinator to leave the group to a new coordinator. To leave the group, simply select the zoneplayer itself as new coordinator.

I'm not sure how best to expose this to HomeKit. If I were to expose each potential group (per zoneplayer) as a switch, Apple's Home app would support this. However, for n zoneplayers, you would see extra tiles. I could use a custom characteristic instead, but then you would need to use another HomeKit app (like Eve) to join or leave a group, or to define a HomeKit scene to do so. Instead of using switches, maybe I could create a dropdown list (i.e. a string characteristic with a fixed list of values), but I'm not sure if that can be used in scenes.

Alternatively, I could list the potential members per zoneplayer (or rather: coordinator). This would result in "only" n(n - 1) extra tiles. When selecting a zoneplayer, it would join the group, potentially stealing it from another group (when it was already a member of another group) or leaving its group to a new coordinator (when it was the coordinator of its own group). When deselecting a zoneplayer, it would become a standalone group. Using a dropdown list would not be possible here, since you want to be able to select multiple members.

from homebridge-zp.

ebaauw avatar ebaauw commented on May 30, 2024

Did some testing: it would seem that a string characteristic cannot be included in a HomeKit scene, so using a drop-down list is a no go.

I had another idea this morning. Maybe expose the platform coordinator explicitly (as a switch on each Sonos service) and allow users to set it. That way, in the morning, you could assign the bedroom as platform coordinator, and group the bathroom to it, while leaving the kitchen group intact. Not sure if HomeKit scenes keep order (you want to set the coordinator first), so you might need two schedules (one to set the platform coordinator, one to join the bathroom).

from homebridge-zp.

ebaauw avatar ebaauw commented on May 30, 2024

Could you try v0.3.6-0 (install through sudo npm -g i homebridge-zp@beta)? It provides a new characteristic, Sonos Coordinator in each Sonos service. This allows you to set the platform coordinator, so zoneplayers will join this group when setting the Speaker service On characteristic.

from homebridge-zp.

Garywoo avatar Garywoo commented on May 30, 2024

I'm now running homebridge-zp v0.3.6-0, however I do not see a Sonos Coordinator characteristic in any of the Sonos services. I restarted both of my Homebridge instances after updating. Should I be doing something else to show the new characteristic?

from homebridge-zp.

ebaauw avatar ebaauw commented on May 30, 2024

I had to stop and restart Eve before it showed. HomeKit doesn’t like configuration changes.

from homebridge-zp.

Garywoo avatar Garywoo commented on May 30, 2024

I've force quit and relaunched both the Eve and Controller apps, but neither are showing the new characteristic. I'll try restarting my Apple TVs when I get home to see if that helps.

from homebridge-zp.

Garywoo avatar Garywoo commented on May 30, 2024

This is working now. Turns out I had conflicting local and global versions - whoops.

Repeated testing by manually triggering the following scenes is working very well indeed! The Kitchen group remains unaffected and intact during the grouping and ungrouping of the Bedroom + Bathroom speakers.

I'll continue testing with daily automation and report any issues I encounter.
Thank you very much for solving my problem!

from homebridge-zp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.