Skip to content

Add a way to copy the full device name #1950

@enchained

Description

@enchained

What workfow do you want to improve?

HASS agent automation software allows certain automations to control PC audio externally via smart home software: https://www.hass-agent.io/2.1/getting-started/commands/#creating-your-first-command_1

To use it, for example to switch the output device, you have to specify the device name. In some cases, it is straightforward and typing whatever you see in the SoundSwitch works (i.e. Speakers (C-Media(R) Audio)).

However, for reconnectable devices, there can be additional prefix numbers that SoundSwitch does not show (.i.e. Headphones (2- HUAWEI FreeBuds 5) displayed as Headphones (HUAWEI FreeBuds 5)). Specifying the latter would not work.

How to make it better?

I wish there was a convenient way to copy the full device name. For example:

  • In the SoundSwitch settings, when device is selected (blue highlight), Ctrl+C would copy its name, short notification would say the name was copied to clipboard.
  • Or, when device is right-clicked, "copy device name to clipboard" option would appear.
  • Or, separate clipboard buttons would be added next to each device.

This would also be useful for other automations, for example Powershell AudioDeviceCmdlets uses those names.

Any alternative?

  • We can go into the device properties and manually retype the name that we see (some spaces and brackets are not very obvious, didn't get it right on my first try).
  • We can make a screenshot and trust the windows OCR feature.
  • But to properly get the full copy-pasteable audio device name we have to install a Powershell module:
Getting device names via Powershell

source: https://www.answeroverflow.com/m/1299828495152844861

For the next person using Windows 11:

Open powershell, install the AudioDeviceCmdlets module:
Install-Module -Name AudioDeviceCmdlets

then, run
Get-AudioDevice -List | Select-Object Name

For example, mine gave:

    Name
    ----
    Headphones (3- WH-1000XM3)
    Realtek Digital Output (Realtek(R) Audio)
    Philips (Some Audio Interface)
    Line (Stereo USB AUDIO  CODEC)

The names that I had to add to HASS for this to work were:
Headphones (3- WH-1000XM3)
and
Realtek Digital Output (Realtek(R) Audio)

No quotes needed, add the name in full. Good luck!

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementIssue which are a enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions