Sudden automation problem

Not sure if I’m going mad. Everything was working fine, and now a few telegram automations won’t stop executing.

If I rename them, they just keeps executing under the new name? How can I find what’s triggering them?

  • alias: “Telegram - Help”
    trigger:
    platform: event
    event_type: telegram_command
    event_data:
    command: ‘/Help’
    action:
    • service: telegram_bot.send_message
      data_template:
      target:
      message: >
      Commands are case sensitive:

        ArmAway - Full arm alarm
        ArmStay - Arm stay alarm
        ArmSleep - Arm sleep alarm
        Disarm - Disarm the alarm
        GarageCam - Send Photo from garage camera

Seems to be a problem with either the latest version of HA - or Telegram - just tried another command and now its also stuck in a loop.

Seems to be related to version 0.64 - rolled back to 0.63.3 and everything seems fine. Not sure if this topic can be moved to an “issue” section?

There’s an issue on Github for something like this - although that user was just using the event as the trigger *so I suspect you then get another event when it sends the text, so it sends the text again, which then generatres another event, which generates another text etc etc.

I’m using a similar setup to yours though, using specific commands, and I’m not seeing this issue. Feel free to compare your code with mine t try and narrow it down (see my Github).

Thanks - I’ll have a look.

My instance keeps rebooting which is very very annoying.

- alias: 'Telegram - Restart Home Assistant'
  trigger:
    platform: event
    event_type: telegram_command
    event_data:
      command: '/restart'
  action:
    - service: notify.telegram
      data_template:
        message:  "Home Assistant is restarting."
    - service: homeassistant.turn_on
      entity_id: script.restart_homeassistant  

And even worse:

- alias: 'Telegram - Reboot Raspberry Pi'
  trigger:
    platform: event
    event_type: telegram_command
    event_data:
      command: '/reboot'
  action:
    - service: notify.telegram
      data_template:
        message:  "Raspberry Pi is rebooting."      
    - service: homeassistant.turn_on
      entity_id: script.reboot_raspberry   

I had a very small window to add initial_state: off between starting samba share and re-executing the automation otherwise it would have been endless.

Is there a fix?

This is a known problem and has been around for quite some time now. It’s related to the Telegram integration, running in webhooks mode. If you switch your configuration from webhooks to polling (platform: polling), it should stop doing that. There’s a relevant discussion here: https://github.com/home-assistant/home-assistant/issues/12774

BR