Hi @spec8320 and welcome to the community
Just to make sure I understand your need. The alerts you’re talking about are actually automations ?
→ You’re looking to show “something” only if a defined list of automation are all enabled ?
For this purpose, you could use the conditional card to show something only if all alert are enabled :
type: conditional
conditions:
- condition: state
entity: automation.alert_1
state: "on"
- condition: state
entity: automation.alert_2
state: "on"
card:
type: markdown
content: All alerts are enabled
This is just an idea since there is several ways to address it. You might want to list which alerts are enabled, or create a boolean entity which contains true if all alerts are enabled, false otherwise.
Many ideas depending on what would be your expected result.
Concerning the second point, assuming you’re talking about several automations that you’d like to turn on/off all together. There is an action (usable in scripts, or even directly through buttons) which can turn on, turn off, or toggle automations, see below an example :
action: automation.turn_{off | turn_on | toggle}
data: {}
target:
entity_id:
- automation.alert_1
- automation.alert_2
Finally, assuming I understood your initial request, I think a nice way to handle this would be to create your own virtual switch in the yaml config.
Setting its state via templating to return true
when all alerts are enabled, false otherwise.
Setting its turn_on
and turn_off
actions to turn on/off the automations.
This would allow to handle everything you’re looking for (assuming I got you right) in a single solution.
switch:
- platform: template
switches:
frigate_alerts:
value_template: "{{ is_state('automation.alert_1', 'on') && is_state('automation.alert_2', 'on') }}"
turn_on:
action: automation.turn_on
target:
entity_id:
- automation.alert_1
- automation.alert_2
turn_off:
action: automation.turn_off
target:
entity_id:
- automation.alert_1
- automation.alert_2
You would end up with an entity that reflect exactly what you’re looking for (state true if all alerts are enabled, false otherwise) and switching it on or off would enable/disable all alerts.
Hope this help.
Cheers !