Automation not running from state trigger

I have a L1 lock, when we shut the door we pull the handle up to secure the door, and it automatically locks, in Smartthings, I was able to say, if mode is day and lock is locked, then unlock.

I have set up a dropdown helper to select between Day and Night mode, and have set that as my trigger, the automation run beautifully if I click the run automation link, but not automatically.

my code is …

alias: Unlock Doors in Day
description: ""
trigger:
  - type: not_opened
    platform: device
    device_id: 357e301dda06a6d9003bedbb331ed9c6
    entity_id: binary_sensor.conexis_l1_the_current_status_of_the_door
    domain: binary_sensor
condition:
  - condition: state
    entity_id: input_select.house_mode
    attribute: options
    state: day
action:
  - device_id: 357e301dda06a6d9003bedbb331ed9c6
    domain: lock
    entity_id: lock.conexis_l1
    type: unlock
mode: single

Any pointers would be amazing as I have been playing with this all day trying different things.

Thank you

Remove the following line from the State Condition.

    attribute: options

Genius, brilliant thank you… Can I ask why that worked?

With that line in place, you made the State Condition check if the value of the options attribute of input_select.house_mode is day. However, the options attribute contains a list of all possible values for input_select.house_mode, not its current state value. By removing that line, you made the State Condition check if the input_select’s state value is day.

Thank you, that’s a great help.

1 Like

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.

For more information, refer to guideline 21 in the FAQ.