nielsfaber / scheduler-component

Custom component for HA that enables the creation of scheduler entities
GNU General Public License v3.0
631 stars 41 forks source link

Scheduled action not executed when state of person is unknown #263

Closed pomeloy closed 1 year ago

pomeloy commented 1 year ago

Checklist

Expected behavior

Scheduled action takes place

Actual behavior

Scheduled action does not take place Logs empty

Steps to Reproduce

Actions never get executed whenever a person with unknown state is included in one of the conditions, whereas native automations work flawlessly, e.g.

condition: not
conditions:
  - condition: state
    entity_id: person.person
    state: home
github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

pomeloy commented 1 year ago

Still an issue.

nielsfaber commented 1 year ago

Sorry for the late response. Scheduler uses its own implementation for evaluating conditions, which is very basic. There is no code present to handle cases where a state is unknown or unavailable. So in case you create a condition person IS home any other state than exactly 'home' would cause the conditions to fail. Likewise in case you create a condition person IS NOT home any other state than exactly 'home' would cause the conditions to pass, including unknown.

Could you elaborate which behaviour you would expect here instead? Pointing to the HA implementation is not very helpful since I cannot find any documentation of how cases with unknown/unavailable states are treated.

pomeloy commented 1 year ago

So in case you create a condition person IS home any other state than exactly 'home' would cause the conditions to fail.

This is not what I have encountered. The condition fails whenever a sub-condition checks a person with the state unknown.

What I expected: one unknown state should not fail the entire OR condition if at least one other person IS home

Likewise in case you create a condition person IS NOT home any other state than exactly 'home' would cause the conditions to pass, including unknown.

This again is not what I encountered. The condition does not pass ‘IS NOT home’ whenever the state is unknown, compared to working as expected when checking a known state.

What I expected: a check for person IS NOT home should pass whenever their state is unknown.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

pomeloy commented 1 year ago

Still an issue.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days