staromeste / homebridge-http-advanced-accessory

Supports all devices on HomeBridge Platform / Bridges devices to http
Apache License 2.0
65 stars 22 forks source link

Accessory type: "Smart Speaker" - how difficult would it be to add this type? #39

Open webziggy opened 2 years ago

webziggy commented 2 years ago

I was all into getting my Sonos speakers to work with the Smart Speaker accessory type (having looked at the docs, and gone to the HAP github links). But then I spotted a little bit lower on the HAA readme that listed out all of the types supported. Only Speaker, and not Smart Speak. Ah. :-)

Is it easy to add this on? (I might try to check out the code properly and see if my rust old coding skills might get it to work)

webziggy commented 2 years ago

Hmmm... seems like I maybe just need to make it recognise this new(er) type of service.

So adding …

case "SmartSpeaker": newService = new Service.SmartSpeaker(this.name); break;

Into the switch block from line 286 of index.js - might do the trick. Is there anywhere else that needs to be updated, or does this simply map back to the HAP code?

staromeste commented 2 years ago

It maps directly to HAP code

On Tue, 14 Dec 2021 at 19:06, Alan Ogilvie @.***> wrote:

Hmmm... seems like I maybe just need to make it recognise this new(er) type of service.

So adding …

case "SmartSpeaker": newService = new Service.SmartSpeaker(this.name); break;

Into the switch block from line 286 of index.js - might do the trick. Is there anywhere else that needs to be updated, or does this simply map back to the HAP code?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/staromeste/homebridge-http-advanced-accessory/issues/39#issuecomment-993841793, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBP2MJ4YTFVQRDXDXMUACDUQ6BRPANCNFSM5KBRF7PA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

webziggy commented 2 years ago

Ah - ok, so hopefully that should be enough. Sorry - not really great at Github stuff. Suspect I need to put in a pull request or something. But not 100% sure on how to do that.

staromeste commented 2 years ago

Updated, should now work with any Service...

Guido

On Wed, 15 Dec 2021 at 11:04, Alan Ogilvie @.***> wrote:

Ah - ok, so hopefully that should be enough. Sorry - not really great at Github stuff. Suspect I need to put in a pull request or something. But not 100% sure on how to do that.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/staromeste/homebridge-http-advanced-accessory/issues/39#issuecomment-994615367, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBP2MK6BON3O4ZAP32KVC3URBR4TANCNFSM5KBRF7PA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

webziggy commented 2 years ago

Ok - will go and get the update on the plugin, and see if I'm able to use that service type now. I'll give you an update to confirm. (Thanks for this)

webziggy commented 2 years ago

Ok - doesn't throw the error about missing service type now. (But now into a possible different issue about "This plugin generated a warning from the characteristic 'Target Media State'" - but that might be me, will open an issue if I'm stuck)

julioviegas commented 2 years ago

Hey there @webziggy , were you able to set the Target Media State? Could you please provide a sample of your config? I'm trying to use it to control a remote vlc device... Thanks!

webziggy commented 2 years ago

Unfortunately, no. Not as yet, anyway. I seem to have the problem that iOS Home App and Mac Home App don't seem to recognise 'Smart Speaker' properly. But I'm not sure why. Certainly - I also tried setting the title/name with information from what the Smart Speaker was playing. (In my case - I have a selection of Sonos Speakers, and an API that I can query). Reading between the lines - it does feel a bit like the Smart Speaker option is 'emerging' on Apple Home - there's limited examples of how to do this there. Sorry - it's not better news. Happy to hear from anyone who has seen this working, or can explain the Apple Home aspects of this.