Greenhouse alarm - advanced

I have built a basic alarm with 1 LED and a buzzer that should wake me in the night if there is a problem. This alarm will be triggered by HA automations. Now, I want to extend it. I want the alarm to monitor HA itself. That means that I want HA to send ‘health status’ messages to the alarm, which will track those messages and trigger if about 3 minutes pass without receiving a status update. I have the following questions. I am just asking for guidance to the docs, though implementation suggestions would also be appreciated.

  1. I can imagine a HA automation to trigger every 60 seconds but I don’t know how to format and transmit a message to a destination. Where can I find that?
  2. How can I process those messages on the alarm ESP32? I suspect that is beyond what can be done in the YAML .

I suspect that I will have to add extra source code in both my HA automation and the alarm. I think that I saw how to insert a source code function into an automation, but don’t remember where. I noticed in my ESP Home build that there is a lot of PlatformIO C++ code that is built. I will use either Python or C++. I am competent in Python but much more comfortable with C++, though Python has higher level support (easier coding).

TIA!

I would start with an on_client_disconnected: trigger in the api: block.

Set the reboot_timeout: to zero or to a suitably large value. Zero will mean that the device never reboots even if HA goes away. The trigger can beep your buzzer or whatever when the api disconnects.

If you want to put a delay before triggering, your trigger can start a script with a suitable delay step as the first action, then play the buzzer. Another action triggered by on_client_connected: could stop the script before the buzzer beeps if the connection comes back inside the delay.

1 Like

Heres the

Just a suggestion but, if you have something like an Alexa or similar smart speaker then you could use that to play an alarm or even make an announcement based on the reason for the alarm being triggered. Instead of using a tiny little led that could be overlooked, you could instead use the main ceiling lights in that room or mayve a bedside lamp could blink blue/red like emergency lights.......

My point is you could do lots of stuff and your only limited by your imagination.

When I initially started thinking about this project I came up with 6-8 LEDs, each indicating a specific problem, very quickly. I soon realized that was a poor direction. First, I couldn't possibly keep those errors straight. Second, what would I do about errors I realized later? The one LED will be green and indicate that the alarm has power and is working properly. If the alarm goes down, I can't sound the buzzer because the alarm is down. But the LED will go out.

The suggestion of Alexa or equivalent is interesting. I will investigate that. I don't have any of those home automation products (yet).

Only if "alarm" means your esp device, not HA and if "is down" means without power.
And zoogara answered your question.