Currently I’m migrating from Tasmota to ESPHome and wanted to use this opportunity to improve some things. I have a Sonoff TH16 that is being used as a doorbell; GPIO14 is connected to the button, this will trigger the relay of the Sonoff that triggers an “old-fashioned” doorbell. Within Home Assistant an automation will play sound on my Nest-speakers when the doorbell button is being pressed.
What I would like to accomplish is:
Whenever the doorbell button (GPIO14) is being pressed it should check if Home Assistant is available and if that’s the case it should trigger the automation in Home Assistant. If Home Assistant isn’t available then it should trigger the relay and try to trigger the automation in Home Assistant. What’s my best approach?