Alexa Timer activated twice in automation

I have an automation that automatically sets a timer to feed the dog within 15 minutes of coming home from a walk. The automation turns on an input_boolean, which then turns on a binary_sensor. That binary_sensor is exposed to Alexa via the smart home skill (not nabu casa). Then, an Alexa Routine triggers a custom action of “set a dog feeding timer for 15 minutes” when the binary sensor is detected as open.

Everything seems to trigger correctly, except for some reason the Alexa will create two timers instead of one. It’s really annoying because when the timer goes off, I now have to tell it to cancel the timer twice instead of once. To be honest, I have no idea whether this is an issue with my automation, or within Alexa, but I verified that there are no duplicate actions in my HA automation or in the Alexa Routine, but I would appreciate any help you can give. An excerpt of my yaml/routines are below:

Automation to trigger input boolean

trigger:
  - platform: state
    entity_id: person.me
    from: not_home
    to: home
    for:
      hours: 0
      minutes: 0
      seconds: 10
action:
  - service: input_boolean.turn_on
    target:
      entity_id: input_boolean.dog_food_timer
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.dog_food_timer
    data: {}

binary sensor template:

binary_sensor:
  - platform: template
      dog_food_timer:
        friendly_name: 'Dog Feeding Time'
        device_class: door
        value_template: >
          {{ is_state('input_boolean.dog_food_timer', 'on') }}

Alexa Routine:

When: Dog Feeding Time Opens
Anytime
Alexa will: "Alexa, set a dog feeding timer for 15 minutes."
From: Living room echo

I’ve also having duplicate events with binary_sensor devices exposed to Alexa via the Smart Home Integration. I upgraded to core-2022.3.1 a couple days ago. My last upgrade before that would have been back in November or December of 2021. I don’t know if code changed between November and now or if it’s something else.

In my case, I have binary_sensor devices that get set using a value_template. I have Alexa routines that detect changes with these binary sensors and make announcements. I noticed either yesterday of the day before that the announcements were being duplicated one after the other. The binary sensors only show one state change in the history, however.

Link to my post:

I set my automations up sometime in February and it has always been like this. At first I didn’t realize it was an issue because I thought that me having to cancel the timer twice was just typical Echo nonsense when it can’t hear you issue a command. I also only show one state change in the binary sensor in HA, but when I view the activity page in the Alexa app it clearly shows the binary sensor triggering twice simultaneously.

While starting Alexa timers is unfortunately only possible via routine at the moment, maybe a solution to your issue is to use the Alexa Media Player custom component, and just using the TTS feature? I use that for Alexa announcements and I don’t have any duplicate messages.

Same when I check the activity for the routine in Alexa…It shows two “Routine was triggered” entries with the same time.

I was originally using Alexa Media Player and it worked great for a while then Amazon changed something and I was constantly having to redo the captcha and was constantly having to logon again through amazon.com. Ended up locking the Amazon account to where you couldn’t logon again if it was a new device or if you logged off. This was my wife’s account and she uses it for her business. She was not too happy with me!

I wanted to move away from needing the cloud for announcements so I had started to migrate some things to ESP8266_WLAN_speaker. This uses an ESP8266 and a speaker to play audio files. You basically pipe an audio file wirelessly to the esp8266 and it plays the file. Works really well. I was using third party free TTS software to convert text to an audio file which then was send to the ESP8266 WLAN speaker. This worked well but the TTS was not always easy to understand. I then had an idea to record Alexa saying certain things and dumping to mp3. This works great but every time I want her to announce something new, I have to make new recordings.

I think I cracked this issue. See: Duplicate Events/Messages with Alexa Smart Home Integration - #5 by FlaTLin3

2 Likes

When I read that, I thought “no way the fix is that simple,” but it is, and now I don’t get duplicate events anymore! Thanks for cracking this!

Nevermind, the issue reappeared in the last couple of days. Ipv6 is still disabled and I haven’t performed an Alexa discovery, the only thing I dod was restart HA a few times