Thanks for the mention @ben_jones12! Wow - local TTS using Squeezebox? This is awesome. My announcements using Google TTS were reliable for a while, then less-so, then altogether stopped working - I couldn’t be bothered to look into it, but I shall use this. Thanks for your excellent work!
@jbags81 (and others) may be interested to know that I didn’t end up using the GPIO port of the XAP, but rather I’m using the serial port, and addressing it from OpenHAB. Haven’t written this up on my blog yet, but I’ll paste below an example config for addressing the XAP from OpenHAB.
You need a USB to serial (RS232) cable, I got mine for a couple of quid on eBay.
The below is quite basic, it simply switches the audio input for a given zone (in this case the bedroom) from one stereo source to another.
There are four commands in the rule for each time I switch an audio source, see rule below. Imagine a matrix with an x that marks a mapping. Each time you switch an output you need to remove an x from the matrix, and add an x elsewhere. That’s two actions. Then times by two because it’s a stereo source.
Check out Appendix E of the user guide (http://www.clearone.com/uploads/resource/800_151_101_Rev4_1_XAP800Man.pdf)
I set up the XAP using the Windows software so that it had device number 1. The format in the above doc says you need to feed it with this:
#DEVICE COMMAND [X] [X]
#DEVICE = 51 = the device type of the XAP800 which is always 5, and the device number you set (i.e. 1 in my case)
The command is MTRX, meaning you want to edit the matrix, i.e. you want to map or unmap something to / from something. The MTRX command is documented on page 118, that’s how I came up with the below.
OpenHAB settings:
Items:
Number Bedroom_Audio_Source
String XAP800
Rules:
rule “Bedroom Source”
when
Item Bedroom_Audio_Source received command
then
switch(receivedCommand) {
case 0 : {
sendCommand(XAP800, “#51 MTRX 11 I 1 O 1 \n”)
sendCommand(XAP800, “#51 MTRX 12 I 2 O 1 \n”)
sendCommand(XAP800, “#51 MTRX 9 I 1 O 0 \n”)
sendCommand(XAP800, “#51 MTRX 10 I 2 O 0 \n”)
}
case 1 : {
sendCommand(XAP800, “#51 MTRX 9 I 1 O 1 \n”)
sendCommand(XAP800, “#51 MTRX 10 I 2 O 1 \n”)
sendCommand(XAP800, “#51 MTRX 11 I 1 O 0 \n”)
sendCommand(XAP800, “#51 MTRX 12 I 2 O 0 \n”)
}
}
end