nielsfaber / scheduler-component

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

Schedule scheme with conditions #358

Closed bgottschall closed 2 months ago

bgottschall commented 4 months ago

Checklist

Proposal

Making a scheme schedule that turns on and off something using a condition might function not as users expect it. Lets say you want to turn on a switch using a condition and the condition is met i.e. you want to turn on the irrigation for your garden if the precipitation is below a threshold. Now you want to turn off this switch after a certain time. The scheme seems nice to set it to on for a certain time and after that off but if one uses a condition and the condition is changing to false while in the on phase the off action is never triggered and you garden gets flooded.

I know the generic approach of this scheduler is really just triggering actions based on conditions but it might be an idea to allow setting a default state for switches which the switch is returning to after being switched on. This would make it unnecessary to actually define a off action in the scheme and it would also immediately set the switch to the default state when the current action doesn't meet its condition.

Additional info

I don't exactly know if that idea with the default state of a switch is the best solution here so I'm open to suggestions. But right now if one just wants to control a switch using conditions the scheme option of the scheduler is not reliable since one cannot guarantee that the condition is met for the next action. Maybe another idea is (probably a bigger change) to allow setting conditions for every action within the scheme separately?!

github-actions[bot] commented 3 months 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