Hello,
I would like to send a MQTT message as alert.
I searched a lot on google but did not find a solution.
My MQTT broker is not on the same device but running on a separate Raspberry Pi.
Any good hints for me?
Thanks and best regards
Ben
Hello,
I would like to send a MQTT message as alert.
I searched a lot on google but did not find a solution.
My MQTT broker is not on the same device but running on a separate Raspberry Pi.
Any good hints for me?
Thanks and best regards
Ben
Can you elaborate on what you mean? Do you simply wish to publish a payload (the alert message) to an MQTT topic? That can be done with an automation using the mqtt.publish
service.
Exactly that is what I want to do. I have a Neopixel ring that flashes red when a message is sent.
How do I trigger an automatation when an alert is active? I did not find any information how to trigger a service in an alert event.
What do you mean by “alert event”? That’s not a term used in Home Assistant. There’s an Alert sensor integration and there are Events generated by certain integrations. Are you referring to either of those two?
Sorry for being ambiguous.
I mean the alert sensor:
I have two notifiers (Pushbullet) and I want additionally publish a MQTT message.
Create an automation with a State Trigger that uses the same entity_id and state value you assigned to the Alert sensor. The automation’s action calls the mqtt.publish service. Easy-peasy. Let me know if you need help composing the automation.
If you were thinking of making the Alert sensor do that, it’s designed to use notifiers exclusively.
The automation itself would not be a problem.
But is it possible to repeat the message like for the alerts? (e. g. alert every 10 minutes)
?
You asked to publish a payload to an MQTT topic. You want to do that repeatedly? Why? From MQTT’s perspective, the payload remains unchanged so what’s the point of continuously re-publishing it?
Perhaps my question should be, what do have that is subscribed to the topic and awaiting the payload?