What’s the best way to handle controlling a Harmony Hub via Voice PE?
For instance, I can ask Alexa to “Pause the TV” and Alexa will send the correct pause for the currently-in-use device (Tivo, Shield, etc). To do this with a remote.send_command action, I’d need to specify the device. (This’d work with HA’s default sentences if the TV was seen as a media player)
With Alexa, I can “turn on the TV” and it starts the “Watch TV” activity. I can do that in Home Assistant with a remote.turn_on along with the correct activity.
Is the best way to set this up to create an automation that understands all of the possible commands I might use? Or is there a blueprint? Or do I create sentences for each command?
Friday is surfing media all around my home because exactly what you hit on. I’m working hard to make my stuff present as exactly that. Use Homeassistant features to force your stuff into behaving like default stuff then the built-in tools and generic tools from the community take over. When something (like the media panel on my hot tub) doesn’t I force it into that mold using a universal media player. Things like template entities and universal media players can glue together actions and status to simulate a coherent entity or device…
That means so I can literally tell Friday to pause the TV, switch to the Denon and send X Spotify Playlist to it then fire up the jot tub audio and join the speaker… Or in shorthand. Friday, I’m going for a soak, you know what I want to listen to - set it up… The ai knows the intent is music in the hot tub and then can figure it out because it knows default tools.
(And I put these in here so you guys know I’m not BS-ing you. I was conveniently about to check Chem and the spa is now running with Motley Crue playing out back.)
I’ll have to think about this a bit, but I don’t think it gets me to “pause the tv” and have it understand which device’s (Tivo, Shield) pause to send.
It certainly does if you use universal media player to glue your scripts I to a real media player. Pause the TV pauses tbe media player which runs the right script which pauses the TV. This is exactly how my media stack works.
Just to make sure I follow, when you set up the command for, say, media_pause, you’d have that be (for instance) a script that looks at the Harmony Hub’s current activity and choose the correct Harmony device to send a pause to? (The TV’s not an entity in HA, so the primary way I’d be able to infer that it’s in use is to look at the Harmony’s current activity)
No. The universal media player when setup properly sets up a virtual media player thag is used like a normal media player. So you should have a synthetic TV that you pause. That would I turn trigger the correct script.
This is a universal that automates a denon avr, a firetv, an Xbox, a GameCube and Friday’s audio input and makes them all work like one single media player.
Yes, and that’s why I wondered why the HA integration for Harmony doesn’t provide actions to send remote button commands to the current activity.
I know from other smart home solutions that they integrated this, and also this Node-RED supports this:
As activities already have mapped commands like pause / play / skip / … on the physical remote, you can send a pause to the current active activity and it will know which device needs to be addresed.
In HA it seems like you have to rewrite the complete Harmony activity logic again.
And when you change something on the Harmony side, you would have to do the change on HA side too.
So if you already use Node-RED, a solution might be to use a script to send these play / pause / … cmds through a custom event and listen for it in Node-RED.
Then you can send these commands using the Harmony node there.
But still a little bit work to get this all together and combine it with a universal media player
I think he speaks about devices in Harmony, not HA.
So yes, he would need to look up which activity is running and then send the correct cmd to the corresponding device registered in the Harmony.
I can send, for instant, a pause, via the Harmony integration but I have to specify a device to pause. Which is the part I’m trying to work out the best way to handle.
Right, but for instance, I don’t have an entity for the Tivo. It’s all referenced through the Harmony controls. So I’d need to create a media player for that. Then make it a child of “TV” or whatever parent universal media player I create.
Ok, but you still have to rewrite all these rules (which device in harmony has to be paused for which activiy) somewhere, right?
That’s the difference to e.g. Node-RED or other smart home solutions I’m talking about:
They don’t need to specify the harmony device, they use the mapping that already exists in the harmony activity.
So you always just send “pause” to the current running activity, nothing else needed.
I’d not do it in node red T. Yes I would absolutely do it inthe universal. (you’re also talking to someone running fast away for NR, it’s been problematic the last few months)
Ok, I see the way you were thinking about it.
I would have liked to use one universal media player for TV AND Radio AND Apple TV using the way I described above.
Then tell the LLM that it’s all controlled through the same media player.
Well, this wasn’t specifically about Node-RED. I was just wondering why this is missing in HA.
But as harmony isn’t produced anymore it might not make sense to look into that and try to improve it…
I’m using universals for EVERYTHING harmony used to do. And yes even this scenario. But in each I’m trying to get the whatever to resolve down to a media player ent so default tools work. No matter which way you slice it. The answer for llm control isn’t a ‘bunch o scripts.’ at the end of the day you need the media player ent. Else the llm will be completely lost.