#"Grouping" Scripts to control a device (e.g. receiver) via IR

1 messages · Page 1 of 1 (latest)

viral oasis
#

I'm hoping to come up with a reasonable logical way to control my audio receiver. Right now, this receiver doesn't have its own integration, but is instead controlled via a slew scripts that control a broadlink IR blaster type device (RM4 Pro). There's one script per function, like:

  • Power On
  • Set Input: Digital 2
  • Volume Up
  • Mute

I'm hoping to come up with a way to do reasonable commands like "set stereo to line in" or similar, but, there's no "stereo" entity or device per se. Is there a way to create a logical / virtual device that could aggregate / contain these various scripts? I can of course just create aliases for each individual script, but it seems like there should be a "better way."

(I'm not quite sure if this belongs here, or in another category, happy to move or recreate as needed. And, thanks in advance for the help!)

shrewd socket
#

You can create some input select and give it "line in" option. But it's easier to write automation or intent script, that will answer to "set stereo to line-in" sentence. And that automation can just call these 4 scripts in sequence.

viral oasis
#

Oh - to clarify, it's more like I want to be able to say "Stereo volume up" etc or "stereo usb input" or "stereo bluetooth input" or such - there are ~8 inputs, of which I use ~5 regularly - with some amount of actual automation, thankfully, but there are some limits on how usable that is, given all the sources. So it's not about chaning actions per se, but about being able to logically group things in a "Not having to write out full aliases for each separate input" or such.

brave monolith
#

An intent script with a defined slot could likely do this

#

You can define the valid values for the slot, and take actions based on them using jinja templating

shrewd socket
brave monolith
#

I think you can mostly do it with an automation, but don't think automations have the lists you can define for a slot like intents do

#

Would just be a wildcard slot

shrewd socket
#

Yeah then basically use "choose" to branch it...

brave monolith
#

Yeah could certainly do that, just have to create a default case where the wildcard is something completely unknown

#

intent script with a list slot would let you limit the slot, so if you say something unknown it would get caught by the intent processor