What is wrong with these conditions?

I have automation that opens garage door when I come home. Here is the code I use(d):

- id: 'mirek_returned_home'
  alias: 'Mirek returns home'
  initial_state: true
    platform: zone
    entity_id: device_tracker.life360_miroslaw_malinowski
    zone: zone.near_home
    event: enter
    - condition: state
      entity_id: sensor.mirek_car_presence
      state: 'Garage is empty'
    - condition: state
      entity_id: sensor.garage_mirek
      state: 'closed'
    - service: script.toggle_mirek_garage_door

Few notes about conditons I have:

  • I want garage not open when my car is in garage (obviosu, no need if car is already there)
  • I do not want garage to close accidentaly, if it was opened already when I was approaching home (I do not see the garage from the distance, so I could hurt someone with unexpectedly closing door).
  • trigger works fine, tested on separate automation
  • script to toggle the door also work fine, tested…

Automation was working perfectly until (I think) upgrade to 0.106.x…
I was doing some troubleshooting about differens aspects of this automation and I narrowed problem to conditions, that seems not to be met, even if sensors report states properly. If I remove conditions section everything is fine. Any idea?

Well, if you say it was working fine then it’s something to do with the sensors you’re using in them.
As we can see nothing about them, it’s difficult to say anything (especially if you say that sensors report states properly).
If you roll HA back, does your automation work?

Are you sure the state of sensor.mirek_garage_presence is ‘Garage is empty’, you can check under Developer Tools -> States

Also you imply it no longer “works perfectly”, but you don’t explain the change in behavior. What is it doing, or not doing, now that is not what you expect?

@Burningstone You were right…
Actually sensor I use for car presence detection got unstable, changing its state randomly (I configured history graph for sensor and over time it proved this). When troubleshooting apparently I was lucky enough to observe proper states…
I think it is issue with power supply, since both sensor (mine and my wife) behavies erronously and both are powered from the same source. Interestingly symptoms are slightly different - mine is unstable, wife’s is not changing status at all, but I do not have any automation yet configured for her, so it passed unnoticed.