Powershell command not running
I have several audio outputs (namely speakers, headphones and home cinema) and used HA to switch between them. This used to work yesterday (old HASS.Agent, switching using index) and is not working today (using ids). I copied the command from HASS.Agent and ran it directly in powershell and the output changed, however nothing happens when I press the button associated with the command in HA (no logs are written to the best of my ability to find them).
The command in question is:
Set-AudioDevice -id "{0.0.0.00000000}.{9a3730ee-fb93-41c1-bd3b-d255652cf07b}"
Is there something I'm missing or is the powershell command really not running at all?
9 Replies
Help us Help Others!
To help others find answers, you can mark your question as solved via
Right click solution message -> Apps -> ✅ Mark Solution
Help us Help You!
Please don't delete messages or posts because it makes it impossible to understand what happened. If you don't want your messages to be seen then don't post here.
Please provide us with your integration version number.
You can find it in HACS -> HASS.Agent -> Top left
for installed version number.
Make sure to provide detailed reports of bugs.
Please include error log uploads and info about the bug.
@DrR0x
Seems like this is a client side issue so if you could just swap the tags so that this one is client and I'll get @Amadeo to have a look.
---
@Goblin
Okay so this depends on a few factors:
About the powershell test you did:
- What is the directory the powershell is in when it works?
- Is the powershell elevated?
About hass.agent:
- What version are you using?
- Send either a screenshot or the snippet from the config file of this command
+ additional question, is the command just the "set-audiodevice..." or are the more lines/commands after ; for example
+2 unrelated note but the new hass.agent (currently a beta release) has commands to switch audio output
What directory:
Does not matter, last try was in C:\Users\Me
Is it elevated:
No, it's run as me, regular user
Version of HASS.Agent
2.0.1
Command from json:
-------
--------
Single command?
Yes, nothing more.
Note at the end:
Yes, I have seen it but wanted to show you anyway since it might mean that powershell commands in general might not work as intended. If it's just my case, I can wait for the new release of course :-)
Thank you (for your time and effort on all of this!).
Directory check was to make sure it's on path
I would try low integrity as well
Often fixes weird issues
And the test I like to try is simply making the command open an app or even just spawn another filexp/terminal
That way we know if it's general command issue or this specific command
https://b.chihi.ro/3o8JfD.png
gib ps lib you're using 😄
It took me a while since I had to find it again. I'm honestly quite green in terms of powershell (I thought it was an old Icelandic curse until recently). Here it is: https://github.com/frgnca/AudioDeviceCmdlets
GitHub
GitHub - frgnca/AudioDeviceCmdlets: AudioDeviceCmdlets is a suite o...
AudioDeviceCmdlets is a suite of PowerShell Cmdlets to control audio devices on Windows - GitHub - frgnca/AudioDeviceCmdlets: AudioDeviceCmdlets is a suite of PowerShell Cmdlets to control audio de...