Amazon music as a trigger?

The tv attached to this receiver isnā€™t a smart tv.

But since the receiver has a telnet interface and hubitat driver, Hubitat knows when the receiver is on/off and which input itā€™s set to.

So for the moment Iā€™m thinking of something like the following.

A rule in rule machine that is triggered by motion sensors in my living room/kitchen (where the receiver and HEOS speaker are). If motion is present, turn on receiver and cancel delayed events. Else if no motion, turn off receiver (cancelable delay by 5 mins).

That at least keeps the receiver on when people are home, now to figure out how to keep the input set to HEOS, unless I want to watch the fire TV, in which case the receiver switches to the appropriate input (which should occur every time I use the fire tv cube remote). So the trigger/condition to make use of is the receiver input changing to Fire TV cube.

Not sure if I explained that last part well, but if anyone has any ideas, Iā€™d appreciate it.

I believe that was suggested already. If you want to have your receiver on whenever someone is in the living room, than you can certainly turn it on with a motion sensor. Of you could just issue one extra command to Alexa when you want to listen to music. Is that really that bad?

My original goal was to turn the receiver on when amazon music starts playing on a WiFi speaker. From that perspective, no, just keeping the receiver input set to amazon music isnā€™t sufficient, unfortunately.

But if itā€™s not possible to come up with a trigger that turns the receiver on every time music starts playing, then Iā€™ll have to come up with a way to create rule machine rules that do something like this:

Keep the AV receiver on and set the input to amazon music as long as thereā€™s movement in the room. If thereā€™s no movement, turn off the receiver. If someone turns on the fire tv, donā€™t change the input back to amazon music until theyā€™re done watching tv.

In the big scheme of things? Of course not. Most of the stuff we discuss in this forum consists of first world problems. But when it comes to home automation and xAF (trying to be inclusive, not everyone has a wife :slightly_smiling_face:), then one extra voice command is really that bad.

I wouldn't want to turn my receiver on/off a couple dozen times a day. But that's just me.

Duly noted, thanks.

If anyone else has any ideas re: converting that logic into RM, Iā€™m open to suggestions.

I will try to post my own ham-handed attempts to create a couple rules later, after my kids go to sleep.

It is possible to detect if the echo is currently playing, and also to use that as a trigger (or in an action) for something:

image

This may however not be exactly what is being looked for.

J

2 Likes

How do you have you Echo connected? Echo speaks?

This does look like it's a screenshot from Echo speaks. I tried installing it, haven't had a chance to really play around with it yet, but it looks like the hubitat echo devices that the app creates will report when they are playing or stopped. This is probably on the right track, thanks @GatVlieg.

I also did some googling, and since what I'm ideally looking for is to detect whether a HEOS speaker is playing music (I'm using Echo devices for the voice commands but actually playing the music with HEOS), it looks like HEOS has a published API. If I'm understanding these documents correctly, there's a way to connect to HEOS speakers over telnet?

http://rn.dmglobal.com/euheos/HEOS_CLI_ProtocolSpecification.pdf

However, not being a developer, and generally pretty dumb when it comes to this kind of stuff, I have no idea what to do after installing that npm package...:face_with_monocle:

Just use a Alexa routine

Which::

Flips a switch

Then

ask
Asks for what to play ( which it totally possible by using the $ sign in the play filed on the action which prompts Alexa to ask ā€œwhat do you want to play ā€œ )

1 Like

The switch is virtual and does all the stuff u want setup in the background

Alexa routines can follow-up by asking you for a music source after they are triggered? Iā€™ll have to look into that. Thanks.

That would be tricky but u could have a few routines that distinguish between sources

Alexa , I want to listen to music from my phone ( Alexa asks what music and the Bluetooth virtual switch is thrown )

== blue tooth connection

Sorry misread ur post

Yes $ basically means go interactively ask what to do in Alexa ... itā€™s king of nifty

3 Likes

Cool, Iā€™ll look into that too. Thanks.

It would still require an extra step (vs. the standard voice command telling Alexa to play x, with the receiver turning on because the music stream started), thus not ideal for WAF.

But since Iā€™m unlikely to figure out a way to make calls to the HEOS api directly, Iā€™ll have to make do with what I can.

1 Like

Thanks. I had no idea.

1 Like

Yea I was messing with Alexa over Christmas and stumbled across the capability... it is very handy when u want to play music and do a few other things at the same time ..... eg make it spouse friendly

2 Likes

@okellyro Could you please point me to where you found this about the "$"? I am interested in learning more about this ability.

in the routine add a music / play action ... in there the first field is play... put the $ there and it will try to play whatever came after your activation phrase