I’m setting up my alarm in HA, using Alarmo, and I’m struggling with how to show why an arming or disarming failed.
For example if you enter the wrong code then you press arm, then the code clears and nothing happens. Or if one of the sensors is currently open, that needs to be closed before arming, then it fails to set too, with no feedback.
It would be good to show something that the alarm setting failed and why.
In Alarmo configure this notification (substitute your notification service), it will tell you why the alarm failed to arm if it was due to a sensor and which sensor(s).
Any thoughts on how to have it pop up on the Lovelace card itself somehow? It would be good to have the alert there, even maybe playing a tone on the tablet itself as well.
Thanks for that suggestion. I don’t think that’s going to work for my use case.
But you’ve given me lots of pointers here.
What I really want is a notify service that a Lovelace card can then read from and show the latest notification. I guess I could brush off my Python and try to code that up if I can’t find anything pre-existing!
I’ve figured it out :). I can use the Alarmo event that fires, in an automation, to set an input helper that contains some markdown. Then use a markdown card to show that.
My automation looks like this:
alias: "Alarm: Failure to arm notifications"
mode: single
description: ""
trigger:
- platform: event
event_type: alarmo_failed_to_arm
condition: []
action:
service: input_text.set_value
data:
value: >
# 🔔 Failed to arm! 🔔
{% if trigger.event.data.reason == 'invalid_code' %}
## Invalid code
{% elif trigger.event.data.reason == 'not_allowed' %}
## Not allowed
{% elif trigger.event.data.reason == 'open_sensors' %}
## Open sensors
{% for sensor in trigger.event.data.sensors %}
- {{ state_attr(sensor,'friendly_name') }}
{% endfor %}
{% else %}
Unknown reason: {{ trigger.event.data.reason }}
{% endif %}
target:
entity_id: input_text.alarm_notifications
Now I’m going to make it so that the notification clears after a few seconds…