Service for enabling/disabling Alexa voice control execution

If have switched on the Alexa integration (Nabu Casa). It is working perfectly.

Now I thought/wonder if there is a service to enable/disable this one like the cloud connect (cloud.remote_disconnect), which is only disabling the remote-URL, but not Alexa control execution.

Background: Would be more than great and secure if I would be able to switch this of, if no one is at home. So that even if whoever is shouting something to Alexa, and she understands, what it want, that the control command to my HA is not executed.

Of course, such service cannot stop the Alexa mics, but should only stop the execution of received commands in my HA server.

Is there something existing, which I missed finding during my search?

No nothing like this exists. You can build it yourself with automations or template sensors.

Do you have a hint? I was not able to find any service or whatever to do this.

It seems that there ia a command triggering the normal services, e.g.

image

But how to switch of/disable this/such Alexa command execution?

I really don’t need the whole solution, but only the direction you are thinking with automations or template sensors, if you are saying, that I would be able to solve the requirement with such things.

create an input boolean that determines the on/off for voice control. Then create templates switches that have a condition for the turn_on / turn_off using that input boolean. Expose the template switches (or other entities) to alexa.

Ah, you mean, a dummy-one for every device? Don’t think, that this will work for work for climate, vacuum, shutter, dimming, etc.etc. where I use more per voice then only on/off.

Yes it will, you have to build it into each template entity: light, switch, climate, etc. Climate is the only caveat, there is no climate template, but there is a generic thermostat integration, and you create a series of template sensors that run it.

o.k. Thank you. As climate is one of the focus topics, I want to avoid other ones steering when shouting, but do not want to lose all the standard alexa phrases around climate, most probably no solution for me (of the waf).

An alexa_command_disabled as cloud.remote_disconnect would be more central and would get around all this workarounds.Perhaps an idea for the future or the Nabu Casa Alexa subscription. Will suggest this there.

Wouldn’t this be a good idea for a feature request?
Translating each single exposed entity to Alexa with e separae new entity (template) feels like an overkill (I have a significant number of entities exposed to Alexa).

Every now and then I disable single entities manually using the entity configuration → voice assistants → alexa (e.g. to prevent the kids to turn on TV ;-))

For my case it would be helpful to either do this with a service or to deactivate voice controls completely, when no one is at home.

afair there were already some of them

I don’t get this at all. Esp. if everything is about security. And here it could be most probably easily adjusted and make HA better than Alexa & Co can do on their own.

For Cloud access, it is described in the same way from Nabu Casa:

Exactly. If here I would like to automate as well for important security reasons.

The “only” thing is, that there has to/should be an additional service alexa_disable_command_execution and alexa_enable …, which switches a new Boolean and is checkt in every execution (and only in this execution) of the sent command:

Thanks for your reply.
To be honest, I don’t get from your response if you are pro or contra :wink:

If I switch off the cloud connection by cloud.remote_disconnect, I won’t be able to use the App through Nabu Casa anymore.

Pro of course. As said, if they are advertising the other service in their paid service as security and automation profit, then the voice control switch is even more important for security and automation profit.

Having to hack into my network to do it via app should me more complicated as shouting through the window: all shutters up.

1 Like

Just an FYI
I found a way to deactivate voice control when not at home:
Spook :ghost: a scary powerful toolbox for Home Assistant.

This tool creates services to enable / disable entities.
So, I just need to deactivate the entity I would like to remove from Alexa and it will not be possible to voice control e.g. the door lock.

I am still playing around and wonder if it’s possible to deactivate the code request for locks from alexa…

I know. But did you try to use it? It is not only disabling the execution, but remove all the entities from alexa and you have to enable all of them again and afterwards the alexa internal jobs didn’t work anymore, Szene were not there anymore with old names, etc.

At least what I tested some months ago.

I am still playing around with it, but it seems that I can deactivate the entity and activate it again with a switch.
I must admit, that activation takes much longer until the entity is back to normal.
But we will see…

But you are getting the alex push messages ‘new device’ after re-enabling? And I remember other side effects and disadvantages.

I still would like to see a pure switch, which is only blocking voice action to do anything.

I don’t remember, that I got the Alexa new device message yesterday when I tried it.

However, I try to translate a swith to a lock, because Alexa always requires a PIN Code to unlock.
I don’t know yet, which Helper would be good for this (accepting “Alexa, open the door”)

I had some time to find a work around for my garage door.
I have a input_boolean named Amazon Command Switch used in automations to let the commands through or not.

For the garage door it works well, because I have a cover (exposed to Alexa) with a temporary switch to UP / DOWN / STOP which will be triggered by a toggle helper (or not if the Amazon Command Switch above is OFF).

However, I also have a door lock and I would like to use a switch (or something else) to open / close it.
But on a lock Alexa always asks for a PIN, which is annoying.
(when I am at home, it should work without a PIN).

Do you have any suggestion which kind of helper I can use to tell Alexa open or close (instead of on / off with a input_boolean helper)?

I am trying to use a switch to trigger the lock with this template:

# Helper Switch for locking / unlocking door if at home (Amazon - Echo-Befehle)
- platform: template
  switches:
    gartenhausschlosschalter:
      unique_id: switch_gartenhaus_schlos_schalter
      friendly_name: Gartenhaus (Schloss-Schalter)
      value_template: "{{ is_state('lock.gartenhaus_schlos', 'locked') }}"
      turn_on:
        service: lock.lock
        target:
          entity_id: lock.gartenhaus_schlos
      turn_off:
        service: lock.open
        target:
          entity_id: lock.gartenhaus_schlos

but when I toggle the switch, I get:

Failed to call service/turn_off. Entity lock.gartenhaus_schlos does not support this service.

don’t make a switch, make a cover template. it’s utterances will be open/close.

As for your error, that’s outdated or you’re still exposing your lock with the same name and alexa is using the lock, not the switch.

Thank you for your help.

I tried this before, but for the cover Alexa was asking for a code as well
(because it’s connected to the lock in the background?)
Anyway, I will try this again.

The error was displayed in the Web UI after I triggered the switch itself from an automation.