WarlaxZ / alexa-home-controller

Control all items in my home from amazon's Alexa
16 stars 5 forks source link

Mopidy - speakers #11

Open johnkareoke opened 7 years ago

johnkareoke commented 7 years ago

This is more of a support request/question than an issue per se.

Firstly, thanks for your contribution WarlaxZ. Its really neat. I seem to have the mopidy app working however i deleted the speakers as this is clearly unique to your setup.

I'd like to do a similar thing with my multiroom speaker setup which uses Snapcast. From looking at app.intent('speakerControl'... it appears that this intent runs an shell script called /home/pi/moveSink.sh.

Firstly, is this correct and secondly what does moveSink.sh do? Presumably it takes a speaker name as an argument and redirects your output. Anything else worth noting?

WarlaxZ commented 7 years ago

So the script actually looks like the following:

`#!/bin/sh

pacmd list-sink-inputs | grep index | while read line do echo "Moving input: "; echo $line | cut -f2 -d' '; echo "to sink: $1"; pacmd move-sink-input echo $line | cut -f2 -d' ' $1 done `

Basically it changes the sink that pulse audio is outputting on, ie to change from one output device to the next, in my case from usb speakers to a bluetooth sink.

Nice one on getting it and running though! :D And yes you are correct in your assumption :)