Page 1 of 1

Looking for a syntax trick for iTunes

PostPosted: Sat Sep 17, 2016 4:44 pm
by Different Computers
Hi guys,

I'm trying to find a way to get Siri to control iTunes via Indigo. All I'm trying to do is:
1. Use relatively natural language
2. Play and pause the current track on my whole-house iTunes which is connected to Indigo.
I've tried:

An Action Group called "House Music" that Plays or that toggles Play/Pause. I've tried both & both seem unable to work properly, maybe because Siri isn't aware of what's playing. But it allows for me to say "Hey Siri, turn on house music" and have the command activated.

Trouble is I get a lot of
Code: Select all
[9/17/2016, 6:37:12 PM] [Two Dog Hill] House Music: executeAction(false)
[9/17/2016, 6:37:39 PM] [Two Dog Hill] House Music: executeAction(false)

because Homebridge seems to think whatever I'm asking for is already happening.

Does anyone already have something like this working?

Re: Looking for a syntax trick for iTunes

PostPosted: Sun Sep 18, 2016 12:31 am
by webdeck
Does it work if you use an app instead of Siri? I tried Siri with one of my actions ("Turn on Enter House") and I see this:

Code: Select all
[9/17/2016, 11:27:56 PM] [Indigo] Enter House: executeAction(true)
[9/17/2016, 11:27:56 PM] [Indigo] Indigo request: http://xxxREDACTEDxxx/actions/Enter%20House.json
[9/17/2016, 11:27:57 PM] [Indigo] Enter House: executeAction(false)


The first line is the action switch getting turned on. The second line is the request to Indigo to execute the action group. The last line is where it turns the switch back off automatically for actions.

Sometimes Siri doesn't like the names of devices. For example, I have "Alarm Disarmed" as an action group, but Siri thinks I'm trying to do something with my phone's alarms if I try to tell her to turn that on.

-Mike

Re: Looking for a syntax trick for iTunes

PostPosted: Sun Sep 18, 2016 6:44 am
by Different Computers
Yeah, things work otherwise. Yes, there's confusion between "play this on my phone" and "activate the whole house audio" if I get too close to the syntax of typical Siri commands.

Seems like Siri doesn't know the state of my iTunes for the house, so refuses to turn on something it thinks is on, or off something that's off.

Re: Looking for a syntax trick for iTunes

PostPosted: Sun Sep 18, 2016 9:40 am
by webdeck
If it's an action group, it should always be showing as off to HomeKit. Action groups will turn themselves off one second after you turn it on. You can verify that using a HomeKit app to see its current state.

Re: Looking for a syntax trick for iTunes

PostPosted: Sun Sep 18, 2016 10:21 am
by Different Computers
Good to know about action groups! And it explains why I can't use toggle.

Still searching for a work around. First thing that occurs to me is something like this:

"Siri, turn on home audio"

Virtual device named Home Audio, which has a trigger called Audio Status Monitor which watches the iTunes state so it reflects the player state. That trigger turns Home Audio on or off as appropriate.

Seem like it would work?

Re: Looking for a syntax trick for iTunes

PostPosted: Sun Sep 18, 2016 10:22 am
by webdeck
If you want to track on and off state, create a virtual device in Indigo - you can have on and off be separate action groups, and track on/off state via a variable. That will work just like a switch in HomeKit.

Re: Looking for a syntax trick for iTunes

PostPosted: Sun Sep 18, 2016 10:37 am
by Different Computers
And that did it! Many thanks for the tip. And as a bonus, I understand virtual device status requests a bit better.