companion icon indicating copy to clipboard operation
companion copied to clipboard

SSDP Discovery Helper

Open peternewman opened this issue 3 months ago • 3 comments

Is this a feature relevant to companion itself, and not a module?

  • [X] I believe this to be a feature for companion, not a module

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the feature

Off the back of #2087 , it would be great to do the same sort of thing but for SSDP.

For example Sony Bravia use this which would benefit https://github.com/bitfocus/companion-module-sony-bravia/ . Others have implemented SSDP in other tools to discover it (e.g. https://github.com/home-assistant/core/pull/77772 ).

Here's their relevant code https://github.com/home-assistant/core/commit/7c460cc641f16077943585473be40a416783b924#diff-0af27839888d627dfb217e7ae091cd8cc5f24627d03f7f79f130db04d781b3ebR142-R157

So in that case filtering for a particular attribute within a third level hash looks to be sufficient.

Usecases

Similar to the Bonjour stuff, allow the system to suggest suitable/valid hostnames.

In future possibly even suggest modules/connections to add/load similar to #2088 for Bonjour.

peternewman avatar Mar 18 '24 22:03 peternewman

I don't expect to look into this myself (not for a while at least) as I don't think I have anything on my network which uses SSDP, so testing anything will be hard. But If someone else wants to do it I can provide some support/assistance.

It isn't that much code to do, I would do this by copying the bonjour classes/components added in https://github.com/bitfocus/companion/pull/2428/files to make SSDP versions of everything, then redo the implementations to be using SSDP. A corresponding change is needed in the module-base to allow modules to use this: https://github.com/bitfocus/companion/pull/2428/files

Julusian avatar Mar 19 '24 09:03 Julusian

Thanks @Julusian . I'm not sure I've got any SSDP device on my main network either TBH or will either get to it particularly soon.

I assume you mean https://github.com/bitfocus/companion-module-base/pull/57/files for the module-base changes?

I guess with half of this, choosing a suitable SSDP library might be part of the challenge too.

peternewman avatar Mar 23 '24 22:03 peternewman

Ooh, I do have something which does SSDP, Sonos uses that. So I could look into this and use that module as a reference implementation https://github.com/bitfocus/companion-module-sonos-speakers

I'll add this to my list of things to consider looking into, when I want something new to pick up

Julusian avatar Mar 25 '24 19:03 Julusian