Starting automations via Alexa

Hi,

I’m currently having trouble with some automations in the first case I want to trigger an air-filter (connected with an AVM switch component) off after it has run for an hour:

automations:
    - alias: 'Trockner aus'
      trigger:
        platform: event
        event_type: call_service
        event_data:
          domain: scene
          service: turn_on
          service_data:
            entity_id: scene.Trockner
      action:
        - delay: '01:00:00'
        - service: switch.turn_off
          entity_id: switch.luftreiniger
    scene:
      - name: "Trockner" #Luftreiniger
        entities:
          switch.luftreiniger:
            state: on

I’ve tried the same for playing a youtube video on my TV:

- alias: 'Kamin an'
  trigger:
    platform: event
    event_type: call_service
    event_data:
      domain: scene
      service: turn_on
      service_data:
        entity_id: scene.kamin
  action:
    service: media_extractor.play_media
    entity_id: media_player.cc_wohnzimmer
    data:
      media_content_id: "https://www.youtube.com/watch?v=m3eMBErXMYE"
      media_content_type: "video/youtube"

Both automations are working when the scene is triggered via the home assistant UI, but not when the scene is triggered over Alexa.

Do you have any suggestions what I’ve to change?

BR,
DerScheffel

It might be better to use the timer rather than a long delay.

how do you start the scenes with alexa?
and are there any other scenes that you can trigger?
whats the difference between the working and not working scenes?

@ReneTode the scene it self is working, so in the first example the switch will power on, same with the second example, the scene it self triggers some light. It’s only the automation which isn’t working.All other scenes are also working with alexa and written down in YAML the same way.
Alexa talks with emulated hue, and i trigger it by saying “Alexa Trockner on”

@bbrendon This could fix the first problem, but not the second.

so
HA GUI scene button > scene > automation works but
emulated hue > scene and then nothing?

seems to me like that can only happen because there is a bug somewhere.
then there are 2 options:

  1. find out what the bug is and ask for a bug fix which can be hard
  2. find a work around.

workaround could be:
dont use the scene service as trigger but use the switch as trigger

OK, that might be a bug (or a feature), but I’m not really able to fix it… so I found a work around:

The work around for my air-filter is as you said to connect it to the switch state. The only disadvantage is that I can not trigger it our of HA for more then one hour, but thats not really a usecase…

The work around for the media player was to put it to a light group (limitlessLED) which I’m not using.

1 Like

On a tangentially related note, why are you using a scene instead of a script? This action seems more suited to a script than a scene, although that might be important.

1 Like

I’m going one further and asking why you’re using an automation rather than just a script given you’re not automating anything if only triggering with Alexa.

1 Like

I have some scenes that I activate using Alexa, but recently I made some scripts that I call from Alexa. The scripts seem to work more reliably and are faster. So I am going to jump on board with those suggesting the use of a script.