Automations with conditions broken?

Hi,

Reddit post here: https://www.reddit.com/r/homeassistant/comments/j877hj/tradfri_motion_sensor_dark_attribute_doesnt_seem/

It seems that automations are broken when you add a condition to it. I upgraded from 0.115.2 to 0.116.2 and since then it doesn’t work. I made even really simpel test automations with a condition, doesn’t work.

Anyone else experiencing this issue?

As far as i have tested, it does work when you make an automation like:

At X time
when light Y is on
Turn of light Y

So that works. But when triggering with a tradfri motion sensor, and the condition “dark = true” it doesn’t work. Neither does the condition “between sunset and sunrise” when triggering on the motion sensor.

Need help!

It would probably be helpful to post the automation that isnt working.

Sorry. Here the automation. When removing the conditions, it works.

I probably should add: when i choose only either one of the conditions, it still doesn’t work. So it’s not the “OR” that doesn’t work.

Change the binary sensor state in the condition to ‘on’ (including the quotes).

Like so? Thats weird because the value is always been True. I will try this out

Doesn’t seem to work. The sensor attribute dark is on/true, but ‘on’ does not work. Automation doesn’t trigger anymore

It is going to be easier to help you if you copy the complete automation yaml code for that automation from your automations.yaml file and post it here. Make sure you format the code correctly (using ``` before and after the copied code).

- id: '1602270016693'
  alias: '(1) Ganglamp aan savonds bij beweging '
  description: ''
  trigger:
  - type: motion
    platform: device
    device_id: 221ab6500a6011eb8371c5fc92aeab51
    entity_id: binary_sensor.tradfri_motion_sensor_2
    domain: binary_sensor
  condition:
  - condition: state
    entity_id: binary_sensor.tradfri_motion_sensor_2
    state: 'on' #(or true... as it always was)
    attribute: dark
  action:
  - type: turn_on
    device_id: e1b81847fe6f11eaac8413a5005fa699
    entity_id: light.dimmable_light_7
    domain: light
    brightness_pct: 10
  mode: single

Solved. Seems to be a bug. The state should be “true” or “false”, but without the quotes. HASS does the quotes by itself, but it needs to be a boolean. That why it fails.

Used a template now.