Service for enabling/disabling Alexa voice control execution

it’s no different than your template switch

that error makes no sense then. You’ll never get that error with this service call:

So my only guess is that you had it wrong at one point and then corrected it.


cover:
- platform: template
  covers:
    gartenhausschlosschalter:
      unique_id: cover_gartenhaus_schlos_schalter
      friendly_name: Gartenhaus (Schloss-Schalter)
      value_template: "{{ is_state('lock.gartenhaus_schlos', 'locked') }}"
      open_cover:
        service: lock.open
        target:
          entity_id: lock.gartenhaus_schlos
      close_cover:
        service: lock.lock
        target:
          entity_id: lock.gartenhaus_schlos

I have tried your cover above, but triggering the switch does not change anything.
Even the cover itself stays open all the time (while the door is locked).

The cover changes to Closed, when I unlock the lock.

If I then toggle the cover switch it changes it’s position but stays closed

So no matter what, I cannot control the lock via the cover switch. :frowning:

This doesn’t make sense unless you meant cover.

This also doesn’t make sense if it changed from open to closed.

Are you sure you don’t have a miss understanding on how your lock works?

What integration is creating the lock?

Post a screenshot of your lock entity in developer tools → states page.

Thank you @petro for your help and patience :slight_smile:

Yes, I meant the cover button does not trigger the lock.
(as I have this as “door”, it looks like a switch with two positions and not a slider like a garage door)

My lock is a danalock with z-wave with the two states unlocked and locked:

I also use this in another automation when leaving and the garden shed is still unlocked:

- service: lock.lock
        data: {}
        target:
          entity_id: lock.gartenhaus_schlos

Actually I changes the code above to:

value_template: "{{ is_state('lock.gartenhaus_schlos', 'unlocked') }}"

Now I can lock / unlock with the cover. :slight_smile:
Thank you so much.

Is this how it supposed to be?

It’s supposed to be however you want it. That’s what the value template does. I just copied the logic you originally had, if that wasn’t what you originally intended then that was the problem.

Yes, undestood.
But by changing locked to unlocked above I would expect a mirrored result (closing the cover would open the lock and vice versa), but not failing to control the lock.

Anyway - it’S working so thanks a lot again for your help, @petro

I am sorry, but I need to revive this topic as I cannot control the workaround using alexa voice.

My garage door is working fine:

- platform: cover_rf_time_based
  devices:
    cover_garagentor:
      name: Garagentor
      # unique_id: cover_garagentor does not work
      travelling_time_up: 16
      travelling_time_down: 30
      close_script_entity_id: input_boolean.garagentor_toggle_helper # switch.garagentor_schalter
      stop_script_entity_id: input_boolean.garagentor_toggle_helper # switch.garagentor_schalter
      open_script_entity_id: input_boolean.garagentor_toggle_helper # switch.garagentor_schalter
      send_stop_at_ends: False #optional
      always_confident: False #optional
      device_class: garage #optional

This cover is exposed to Alexa.

The input_boolean.garagentor_toggle_helper triggeres a temporary z-wave switch to activate the garage door motor.

When I am not at home, I prevent the input_boolean.garagentor_toggle_helper to switch the z-wave switch (Alexa command does not work anymore).

I tried the same with the lock of the garden shed:

- platform: template
  covers:
    gartenhausschlos:
#      device_class: garage
      unique_id: gartenhaus_schlos
      friendly_name: Gartenhaus (Schloss Cover)
      value_template: "{{ is_state('lock.gartenhaus_schlos', 'unlocked') }}"
      open_cover:
        service: input_boolean.turn_off
        target:
          entity_id: input_boolean.gartenhaus_toggle_helper
      close_cover:
        service: input_boolean.turn_on
        target:
          entity_id: input_boolean.gartenhaus_toggle_helper

This cover is also exposed to Alexa and the input_boolean.gartenhaus_toggle_helper triggers the lock, when I am at home.

The state sync and triggering manually from the UI works well. and is reflected in Alexa.
I cannot use Alexa voice commands to open/close the “cover”.
Neither as device_class: door nor as device_class: garage

When using door the Alexa App looks like this and I can switch open & close with the round button (geschlossen = closed) perfectly - only the voice command does not translate somehome.

When using device_class: garage Alexa always closed the cover (locks the door) even if I say “Alexa, Gartenhaus open”.

The strange thing is, that the cover for the garage triggers the switch perfectly and that this looks the very same in the Alexa App.

Does someone have a clue why?
Thanks in advance.

No one with an idea?

Is this any help?

How to launch an Alexa skill from Home Assistant.

You can use Alexa routines to simulate voice commands, and you can trigger routines with input_booleans.

Thank you.
That would be a workaround and I will consider this.

However, I am also keen on finding out, why the two cases (Garage door and Garden lock - both as cover behave differently.