Example nginx config to limit http access to the bose soundtouch integration and https for everything else?

I am planning on creating a library of voice commands within /config/www/voice/ and have my bose soundtouch play specific files for certain automations. But the bose soundtouch API only allows playback of files over http. The documentation in https://www.home-assistant.io/integrations/soundtouch/ suggests using an nginx reverse proxy to get around this limitation. Does anyone have a good example of a nginx configuration to enable http access for this limited purpose (i.e., only allow http access by the soundtouch and https access for everything else?)

This thread is relevant but didn’t have a good example of what I wanted: Nginx Reverse Proxy Set Up Guide – Docker

Check out my posts in this thread. Seems like you want to do something fairly similar. The threads that I link to in that post describe how to set up NGINX to do what you’re looking for.

1 Like

Looks like bose now provides a REST API https://developer.bose.com/bose-soundtouch-api that allows for programmatic local control over their devices. I guess I will have to learn AppDaemon.

You could also perform discrete actions using the python_script integration.

1 Like

Not sure exactly what you require, but I do have soundtouch speakers and since they’re behind the proxy I can issue notifications etc.
I just have the set up described in my post

1 Like

Thanks for your tutorial. It was very helpful for my set-up.

How are you issuing notifications from the bose soundtouch? Is it integrated via alexa_media_player? The current version of libsoundtouch used by hass doesn’t appear to be updated with Bose’s Soundtouch Audio Notification API.

Alexa integration only works with alexa/amazon devices

The soundtouch appears as a media player. You can send tts using the google tts service.

You can add the Bose skill to Alexa and control the soundtouch via alexa media player if you remove the soundtouch from hass auto discovery and do not have an entry for the soundtouch in configuration.yaml. But I haven’t tried implementing google tts with the bose yet so that might work much better than what I’m currently attempting.

Yes i also have the alexa skill working along with homeassistant and Google tts.

Do you mind providing an example of how you are configuring google tts with the soundtouch? I get the following error with my configuration:

Unable to find preset with id https://example.com/api/tts_proxy/101a163716bdfd156462e33eef8ec28920b43a00_en_-_google_translate.mp3

I have the following in my configuratiton.yaml:

  - platform: google_translate

  - platform: soundtouch
    port: 8090
    name: bose

And I invoke tts via the more info card with the following lovelace yaml:

type: media-control
entity: media_player.bose

I’m able to access http://example.com/local/voice/file.m4a which causes Chrome to download the file but I can’t figure out where to configure google tts to go over http instead of https.

Nevermind. Figured it out. It was the base_url setting in http.