Can I make a group of automations? (not UI request!)

Hi, I have a bunch of NFC automations that I’d like to be able to simply enable and disable (NFC that play TV content for my kid).

It doesn’t seem I can create a group (group helper or manually in YAML) that I would just turn on or off. YAML won’t let me as I already have this in my config.yaml.

automation: !include automations.yaml

Any tips? This is a specific question about grouping automations, I know I can just add the automation.xxx entities into another automation, but I’d really like to be able to create groups of automations. Thanks.

You can group automations with legacy groups in yaml.

Thanks but how?

Like this it complains about bad indentation of a mapping entry on the line " - platform"

automation: !include automations.yaml
  - platform: group
    name: NFC cards
    entities:
      - automation.tv_nfc_kaceri
      - automation.tv_nfc_cuphead 

Just adding a new block like this leads to duplicated mapping key

automation: !include automations.yaml
automation: 
  - platform: group
    name: NFC cards
    entities:
      - automation.tv_nfc_kaceri
      - automation.tv_nfc_cuphead

When i place it into automations.yaml like this, the group is not created

- platform: group
  name: NFC cards
  entities:
    - automation.tv_nfc_kaceri
    - automation.tv_nfc_cuphead

Ah, I see, the “old style YAML groups”

group:
  kitchen:
    name: "Kitchen Group"
    entities:
      - switch.kitchen_pin_3

ok, thanks.

1 Like

The recommended way of controlling an automation’s behavior is by simply adding a State Condition that checks the state of an Input Boolean. If the Input Boolean is off, the automation’s actions aren’t executed.

One could take this idea a step further and incorporate the State Condition in the action section. Then the automation can be designed (using an if - then - else) to inform the user that regular services (i.e. playing TV content) is currently disallowed.

1 Like

Yes, I have checks like that in the automations themselves. What I’m doing now is a simple toggle for all the NFC automations so when my daughter misbehaves, I can simply and quickly disable them all - I set the NFC cards so that she can turn on the TV and play her cartoons via Kodi using these :slight_smile:

Thanks!