While working here and there on my HA instance I figure that to have an Alarm system configured to manage different sensors based on different arming state, it takes forever… therefore I had an idea that might be helpful.
It might be useful to have, on a sensor definition level, an optional option to define if this sensor trigger an alarm, and in which state.
For example, let’s say we are configuring a PIR which sits inside the house and you want it to trigger the alarm when in away and night mode
trigger_alarm:
- armed_away
- armed_night
This way what we will need to do is only manage the actions that will be perform based on the alarm armed state.
And of course, sensors (or components) that have no this option, will no trigger the alarm.
Users will still be able to use automations to trigger alarm based on components status, but this might make things easy, specially when there are many sensors.
This should be an option for every type of sensor, not sure it makes sense (it might) for other type of components.
It might be that I didn’t think about every possible outcome, if so, feedback are welcome
If you are struggling setting up an alarm system, have a look at this custom component. Scroll to the end of the thread to see the new version. It has lists of sensors you pick for each alarm mode.
I am not saying that sensor are automation, but that when you defined them you can directly “assign” them to a specific arm state as triggers without having to modify different automations (or a group) whenever you have a new sensor.
Well whenever you have a new sensor you still need to create the sensor configuration.
A group comes to handy to don’t have to modify (most of the time at least) multiple automation based on those sensor to trigger the alarm, but it would still means modify multiple file everytime you have to add 1 sensor (or remove or modify)
I understand but you write you still need to create the sensor configuration while currently there is nothing to configure for a sensor as far as I know.
Not sure what sensor you use, I guess it might be different.
For instance, I use Sonoff PIR sensors that use Sonoff RF Bridge to communicate (Tasmota Firmware) to HomeAssistant using MQTT, and to have that sensor available in HA I need to create the configuration file for that sensor with mqtt platform, state topic, availability topic and so on.
So, I figure that if I am creating that file for that sensor (binary_sendor in this case), it might be useful to specify what alarm mode it needs to trigger when a “on” payload is received