Preventing Alexa seeing certain devices?

I used the fantastic guide here (Alexa with Home Assistant Local for FREE Without Subscription - YouTube) to set up my Alexa integration and was wondering if there is a way to prevent certain devices being exposed (ideally until I tell it to expose but I’d be happy the other way around).
Even better blocking at the integration level would be best!

Thanks!

1 Like

Using configuration.yaml file, you can set inclusion or exclusion rules.

1 Like

Interesting… the method I followed hasn’t put any of those items into my config, only

alexa:
smart_home:

based on that I should just add the filter option below?

I don’t see a way to exclude by integration - am I missing something?
Failing that, how do I identify which domain an item is?

(e.g. I have the Xbox Live integration and I have a bunch of my Xbox Live friends being exposed to Alexa which are useless to me - I’d like to disable these. Similarly I have the Blink integration which these is very little point exposing to Alexa as they’re wifi anyway and part of amazon ecosystem - what’s the best way to disable those without disabling my other cameras?)

So I’ve found how to get the domains here: Where can I find a list of domains? - #10 by petro

Sadly, despite the glossary implying a domain is linked to an integration, that doesn’t seem to be the case…
e.g. my Xbox integration uses the binary_sensor domain for the users - I don’t want to exclude all binary sensors, and I don’t want to have to manually exclude all 91 users it’s added in that integration…

So seems I’m a bit stuck

EDIT: well, it didn’t seem to work anyway!
I’ve added to my config

alexa: 
  smart_home:
    filter:
      exclude_domains:
        - binary_sensor

Just rescanned in Alexa and they’re all still there and all still available

Edit2:
Also tried

    exclude_entity_globs:
      - binary_sensor.*

Also negative

You can use wildcard as pointed in documentation and use device name.

Alexa does not remove existing sensors, you have to remove them manually

Surely they would appear as unavailable however? (like when I delete a device)

EDIT: Apparently not - very odd!

Okay, so seems the only way to do this is to manually exclude each of those 90+ Xbox users (or manually include others…)

Urgh - no wildcards at the start sadly :frowning:

      - switch.oven*
      - *.philips_65oled935*

gives a YAML error… any way to escape?

You didn’t wait long enough. Alexa holds onto things forever. You have to run discovery again for her to ‘forget’ things.

  1. Add filter
  2. Restart HA
  3. Rediscover in Alexa
  4. Delete devices that aren’t available.

Step 3 and 4 can be reversed if you want to. You can delete everything then rerun discovery.

2 Likes

Put it in quotes. Strings starting with * is a keyword in YAML, you avoid that by wrapping it in quotes.

1 Like

Thanks.
I did do all of the above in that order, the devices never seemed to show as unavailable.

Doing 4 then 3 seemed to work however (a little more manual as nothing to indicate what is ‘missing’)

I now seem to have an opposite issue - I’ve added an input_button helper, the documentation says this is supported, but having scanned for new devices it doesn’t appear - am I missing a step?

Even explicitly including it in yaml doesn’t seem to discover, pre or post reboot :confused:

Only specific input helpers types are supported. I doubt button is supported as it’s a stateless entity.

As expected, it’s not supported.

input_booleans are the only supported helper domain.

1 Like

Shame - didn’t need it to have a state (it’s to trigger a WOL event), guess I’ll need to go for an input_boolean and toggle it off immediately after use

Scripts are supported. That’s all you need.

Sorry, can you you give me a little more detail on that? (new user, still getting to grips with everything!)

In the automations tab, there’s a script tab. Just create a script with the actions you want to perform. Have the script press the button. Or skip the button all together and have it perform what the button is doing.

Ah thanks - so now I have script._server_wake_on_lan which does what I want to do… but it’s not found by Alexa either…

you’ll have to restart home assistant and run discovery in alexa.

Do we need to restart HA? I thought discovery should be enough