RF Bridge/Automation on Button Press

I have a Sonoff RF Bridge R2 and I’m using the Sonoff LAN integration. The bridge has learned signals for two buttons. I’ve built an automation around the buttons below. It works just fine.

alias: Dogs - Potty Bell
description: ""
trigger:
  - platform: device
    device_id: 5292317bfb55af06f0d02fd9196cf387
    domain: button
    entity_id: button.10016275a1_0
    type: pressed
  - platform: device
    device_id: 5292317bfb55af06f0d02fd9196cf387
    domain: button
    entity_id: button.10016275a1_1
    type: pressed
condition: []
action:
  - service: tts.google_translate_say
    data:
      cache: false
      entity_id: media_player.all_homepods
      message: The dogs probably have to go outside.
mode: single

Here’s the problem, the Sonoff seems to become unavailable from time to time. When it comes back online the automation gets triggered and that’s obviously annoying and wrong.

Is there any way to prevent this from happening?
Should the automation be differently?

Thank you