2 Garage Doors and Visual Alert automation not working

Hi I have two garage doors. Both have myq garage doors that are integrated into Home Assistant and I can close and open them.
My goal which I’ve failed a couple times is to

  • turn on an led light when one or both garage doors is open as a visual que within my house.
  • I would like to turn the light off when one or both of my garage doors is closed.

I’ve been trying to use the Home Assistant UI to accomplish this but I can’t get it to consistently work.
I can get the lights to come on and turn off 80% of the time but not consistant.

My rules are
when garage door a is open then turn on light
when garage door b is open then turn on light

when garage door a is closed AND garage door b is closed turn off the light
when garage door b is closed AND garage door a is closed turn off the light.

am I missing something?

Thanks for your help!

Post the actual automation so we can review it.

As was said above we need to see your code, but just something as a suggestion that I ran into with my garage door is that I had

from: closed
to: open

when in actuality my garage door a lot of the time was going

from: closed  
to: opening

then “open”, and obviously the opposite when closing… removing the “from” made it much more reliable…

But, as mentioned… show us your automation and we could help more…

@Bartem @123
Thanks for your help so far!

‘’’’
alias: A Garage Door Open
description: ‘’

trigger:

  • entity_id: binary_sensor.wyzesense_77a1ddff
    from: ‘off’
    platform: state
    to: ‘on’

condition: []

action:

  • brightness_pct: 100
    device_id: 1a82869676b441efa548bb604fbb0778
    domain: light
    entity_id: light.hue_color_bulb
    type: turn_on
  • device_id: 391187c56904413d912169059e43604b
    domain: switch
    entity_id: switch.hank_electronics_ltd_hkzw_so01_smart_plug_switch
    type: turn_on
    mode: single
    ‘’’’’

‘’’’’’
alias: B Garage Door Open
description: ‘’

trigger:

  • entity_id: binary_sensor.wyzesense_77a1e62d
    from: closed
    platform: state
    to: open

condition: []

action:

  • brightness_pct: 100
    device_id: 1a82869676b441efa548bb604fbb0778
    domain: light
    entity_id: light.hue_color_bulb
    type: turn_on
  • device_id: 391187c56904413d912169059e43604b
    domain: switch
    entity_id: switch.hank_electronics_ltd_hkzw_so01_smart_plug_switch
    type: turn_on
    mode: single
    ‘’’’’’

‘’’’’
alias: A Garage Door Closed
description: ‘’

trigger:

  • entity_id: binary_sensor.wyzesense_77a1ddff
    from: ‘on’
    platform: state
    to: ‘off’

condition:

  • condition: and
    conditions:
    • condition: and
      conditions:
      • condition: state
        entity_id: binary_sensor.wyzesense_77a1e62d
        state: ‘off’

action:

  • device_id: 391187c56904413d912169059e43604b
    domain: switch
    entity_id: switch.hank_electronics_ltd_hkzw_so01_smart_plug_switch
    type: turn_off
  • device_id: 1a82869676b441efa548bb604fbb0778
    domain: light
    entity_id: light.hue_color_bulb
    type: turn_off
    mode: single
    ‘’’’’
    ‘’’’’
    alias: B Garage Door closed
    description: ‘’

trigger:

  • entity_id: binary_sensor.wyzesense_77a1e62d
    from: open
    platform: state
    to: closed

condition:

  • condition: and
    conditions:
    • condition: device
      device_id: 79e99438288343198c042349ff40db3d
      domain: cover
      entity_id: cover.ngaragedoor
      type: is_closed

action:

  • device_id: 391187c56904413d912169059e43604b
    domain: switch
    entity_id: switch.hank_electronics_ltd_hkzw_so01_smart_plug_switch
    type: turn_off
  • device_id: 1a82869676b441efa548bb604fbb0778
    domain: light
    entity_id: light.hue_color_bulb
    type: turn_off
    mode: single
    ‘’’’’’’

Please format your code properly, number 11 of this post: How to help us help you - or How to ask a good question

Any chance Garage Door A is more reliable? The issue i mentioned would only apply to Garage door B (the actual cover entity)

I would try opening and closing Door B while on the developer tools > states page and see if the door goes from closed > opening > open and vice versa for closing.

This uses the correct state values for a binary_sensor, namely on and off.

trigger:
  entity_id: binary_sensor.wyzesense_77a1ddff
  from: 'off'
  platform: state
  to: 'on'

This is wrong:

trigger:
  entity_id: binary_sensor.wyzesense_77a1e62d
  from: open
  platform: state
  to: closed

Change open to 'on' and ‘closed’ to 'off'

A binary_sensor with a device_class set to door will present its state in the UI as open or closed. However, that’s just for presentation purposes. The binary_sensor’s state values are always on and off.

There may be other errors as well but that one definitely prevents the automation for Garage Door B from working properly.

Also, as per Bartem’s suggestion, please format the code. Two ways to do it:

Select the code and then click the </> icon in the menu bar.

or

Type three consecutive back-quotes ``` on a separate line before the code.
Type three more back-quotes on a separate line after the code.

Whoops, didn’t pay enough attention just saw the cover entity in the condition for the one…

Thanks @Bartem and @123 for your help. I’m going to give it a try make updates to my code