node-sonos-http-api icon indicating copy to clipboard operation
node-sonos-http-api copied to clipboard

Web hook payload doesn't include members

Open maddox opened this issue 9 years ago • 6 comments
trafficstars

When a coordinator's state changes, it's state is reported to the web hook. It doesn't include it's members if it's grouped, though.

So if you're trying to track exactly what is playing in a room, no matter how it's grouped, the web hook can't provide this info.

It works obviously, if the room is the coordinator, but not if it's a member.

maddox avatar Aug 30 '16 16:08 maddox

Good point. Another option would be to duplicate the request, one for each member. This might be easier to integrate against.

jishi avatar Aug 30 '16 16:08 jishi

I'd keep it more like the responses that the api currently provides. If you GET /zones, your client has to "find" the room inside the response. Since people are already doing that because of the existing responses, keeping it the same in the web hook might be better. That way we're not having to do multiple different things.

maddox avatar Aug 30 '16 16:08 maddox

Would love to just see the package schema here be the same as what's reported from the /zones endpoint. Then things would just be normalized. As now, I can't get the state of a specific room if it's a member of another coordinator.

Could we just get the members key tagged onto this payload so that the whole payload matches an item of the array that is returned in /zones?

maddox avatar Sep 06 '16 05:09 maddox

We could, but I still don't feel like that is the "easiest" to implement for others. I guess most current users are familiar with parsing /zones and /room/state but I think for most applications the webhook is a lot better.

I'm thinking that the most common use case for it would be a stationary information screen that you only want to reflect state or changes for a specific room (regardless of grouping). That leads me to believe that giving a unique notification for each room in the group would be much easier to implement for a newbie.

Doing complex parsing within the limited tools that HA-systems provide is a real challenge in my book.

jishi avatar Sep 06 '16 07:09 jishi

Well, my argument was that it'd be easier for people already used to parsing /zones, since it'd be the same schema as one of the items in that array. As it is now, it doesn't match, so my personal parser doesn't work. I thought that my suggestion was actually making it easier.

maddox avatar Sep 06 '16 12:09 maddox

Have their been any developments on this?

gregkinney avatar Nov 10 '19 03:11 gregkinney