Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95333

Ignore device in automations if unavailable or not found

$
0
0

@eric10k93 wrote:

So the latest changes with the MyQ integration did some weird things… first it broke my automations… I have the light set to turn on with the garage door and off after a few minutes when it’s closed… This has not been functioning at all for a week or so.

I finally got into my configs to see what happened and it appears my MyQ device has changed names… the old device named “cover.garage_door_opener” does not exist anymore… now I find it listed as “cover.garage_door_opener_2”

I’m not sure why this happened… but that’s not my immediate concern… my main problem is the light hasn’t been turning off automatically because the automation is looking for the state of “cover.garage_door_opener” to be “closed” but since the device doesn’t exist… it never turns off anymore…

Is there a way to configure an automation to ignore an entity that is either “unavailable” or just doesn’t exist anymore for some reason?

Here’s what my automation looks like now:

  - alias: a_garage_inside_light_timer
    initial_state: True
    trigger:
      - platform: state
        entity_id: cover.garage_door_opener_2
        to: 'closed'
        for:
          minutes: 7
      - platform: state
        entity_id: binary_sensor.contactgaragesidedoor, binary_sensor.contactgaragehouseentrydoor
        to: 'off'
        for:
          minutes: 7
    condition:
      condition: and
      conditions:
        - condition: state
          entity_id: input_boolean.garage_light_timer_override
          state: 'off'
        - condition: state
          entity_id: binary_sensor.contactgaragesidedoor
          state: 'off'
          for:
            minutes: 7
        - condition: state
          entity_id: binary_sensor.contactgaragehouseentrydoor
          state: 'off'
          for:
            minutes: 7
        - condition: state
          entity_id: cover.garage_door_opener_2
          state: 'closed'
          for:
            minutes: 7
    action:
      service: homeassistant.turn_off
      entity_id: switch.garagemainlight

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>