Automations disable them self when put in a specific group

Hi all,

Not sure what to do or how to trigger it, but I use areas (Bedroom, Kitchen, Living Room etc). If I put any automation in the “Living Room” area, it disables it’s and this happens with all the automations I put in there. I can’t see a pattern on when it becomes disabled, so I can’t tell why it’s happening but I would appreciate any assistance. I don’t know where in the logs to start looking or what time to look at as I do when when it becomes disabled. I’m trying to find out why it’s only this one “area” that’s disabling all automations that is put in it.

Are you using device IDs (as opposed to entity IDs)?

If so the automation will be disabled if the device is not available.

They are all entity IDs and is created using the UI (IPhone Home Assistant App) here is one example I know that had been automatically disabled when put into the “Living Room” area:

 - id: '1676152935660'
  alias: Lounge Plugs - Turn off if idle Combined
  description: '"Turn off" Lounge Plugs if they are not used after being turned on,
    or it becomes idle (10 mins by sonos default), but look out for Sonos L being
    used and if so, keep that 1 plug on'
  triggers:
  - entity_id:
    - media_player.lounge_tv
    from: playing
    for:
      hours: 0
      minutes: 5
      seconds: 0
    to: idle
    trigger: state
  - entity_id:
    - media_player.lounge_tv
    from: playing
    for:
      hours: 0
      minutes: 5
      seconds: 0
    to: 'off'
    trigger: state
  - entity_id:
    - sensor.livingroom_loungetv_l_energy_power
    for:
      hours: 0
      minutes: 0
      seconds: 40
    below: 9
    trigger: numeric_state
  - entity_id:
    - switch.livingroom_loungetv
    to: 'on'
    for:
      hours: 0
      minutes: 6
      seconds: 0
    enabled: true
    trigger: state
  conditions:
  - condition: not
    conditions:
    - condition: state
      for:
        hours: 0
        minutes: 0
        seconds: 10
      entity_id: media_player.lounge_tv
      state: playing
    enabled: true
  actions:
  - if:
    - condition: numeric_state
      entity_id: sensor.livingroom_loungetv_l_energy_power
      below: 9
    then:
    - data: {}
      target:
        area_id: living_room
        label_id: livingroom
      action: homeassistant.turn_off
    else:
    - data: {}
      target:
        label_id:
        - lounge_switch_r
        - lounge_switch_tv
      action: homeassistant.turn_off
  mode: single

Wild guess - does the automation itself have an area assigned? See Edit below:

One of your actions is trying to switch off everything with the area_id: living_room.
If your automation has a living_room area assigned, then the homeassistant.turn_off service will also switch it off.

EDIT: That’s exactly what you’re doing. You need to choose between either

  • not setting an area for your automation.
  • use only the label_id: livingroom in the action and remove the area_id line
  • use switch.turn_off instead of homeassistant.turn_off if all the target devices are switches.

The homeassistant.turn* action sends the commands to all domains, including automations (see docs here)

Thank you. This appears to have been the issue. I just wasn’t able to spot it in the logs to say whats what was going ok :slightly_smiling_face:

1 Like