Shell_command with emulated hue bridge

I’m trying to get a shell_command to show up on the emulated hue bridge via an echo. I can’t seem to find anything about this in the documentation, adding

exposed_domains:
    - shell_command

doesn’t make it show up either (my Samsung TV is detected if I add media_player to this same spot however, so it’s picking up something at least.

I’m not sure how to do what you are asking but I have a slightly clumsy workaround via script that I use.

shellworkaround:
  alias: shellscriptforhue
  sequence:
    - service: shell_command.yourshellcommandname

Thanks, I’ll give this a go later today.

I’m literally just trying to make it able to run an arbitrary script. Currently just to do ‘Alexa, turn on computer’ and have it send a WoL request. The shell_command works fine when I test it via the HA API

Scripts work fine, so running the shell command via script will work, just be aware that you will need a different script for OFF. If you need OFF it might be better to try and use a switch instead of script?

I’ll take a look. Currently I just need an on. Off is all timer/use based automatically so I don’t think I’ve explicitly needed to turn them off for years.

Edit: I’m on a computer now instead of my phone, and command line switches sound great if they show up on the echo. Thanks!

Oooh yes. that shows up. Now to figure out a way that I don’t need to switch things on/off each time. Do you have any ideas for something like that? just a one-shot type thing, like a toggle button that always sends the same command?

Just put the same command for on as off if using a switch.

An off for a script just sends a cancel I think so if the script has already run maybe nothing would happen?

I’m away from home at the moment remoting in to set it up so I can’t test with alexa, but when setting the state to on repeatedly via the API it doesn’t re-run the script, it only runs on a state change.

It seems your initial suggestion of the script function works as I wanted, so when I get back I’ll give it a go with the echo itself and make sure it doesn’t sound too stupid when I’m telling it what to do.

Thanks for all your help!

Hmm. so it works, mostly. It does turn on my computer now using the script function and saying 'Alexa turn on ’ but, it times out and says the device isn’t responding (even though it woke up)

That is an Alexa thing I believe. There have been a few posts about it lately, not sure if there is a fix in the works.

If you search these threads for “alexa device responding” you’ll be able to find them.

In case anyone ever shows up here again;

I ended up using emulated_hue and the following customization to make it visible to the alexa:

homeassistant:
  customize:
      script.wake_ironwood:
        emulated_hue: true
        emulated_hue_name: Ironwood

Then it just shows up as a light and saying ‘turn on foo’ works as expected. No need for a script or any other workaround.