Multiple expires for different events

I have a coffee machine I would like to turn on at 7:30am each weekday and stay on for 1 hour then turn off, I also have a button switch I would like to press on at any time and the coffee machine comes on but goes off after 30 minutes.

Ideally I would also like to use the button to turn OFF the cofffee machine if I am in the 1 hour morning sequence

I have experimented with rules and dummy switch items with expire bindings that have more rules looknig for OFF status to then turn off the coffee machine but I have got myself in a bit of a knot with expire bindings on the dummy items and rules all over the place.

Is anyone able to help with a set of cler rules, items and config that could support the scenario above?

Think you need 2 buttons
1 to turn on with 30min expire
1 to turn off

Are they physical buttons or on UI?

could try this or adaption there of.
I use it for my alarm clock with squeeze box

When you’ve got multiple expiring Items doing the same thing, it sometimes becomes a problem managing a ‘cancel’ feature. Might help -

I would do the following:

  1. Create one rule triggered by time (7.30am) and your button item

  2. Within the rule you can differentiate if the rule is executed by time or by button (check if a triggering item is existing or not)

  3. If the rule is triggered by time, then turn on the coffee machine and set a timer to 1 hour, which will turn the coffee machine off

  4. If the rule is triggered by the button and the coffee machine is off, then turn on the coffee machine and sweet a timer to 30 min to turn off the coffee machine again

  5. If the rule is triggered by the button and the coffee machine is on, then cancel any existing timer and turn off the coffee machine immediately

This cannot be done in Rules DSL though so beware.

Beyond that caution, this too is how I would do it.

1 Like

Ok it sounds like I’m actually on the right track the only difference I can see in suggestions is I’m using the expire binding which itself seems to be unreliable to trigger rules

I will post all my items and rules shortly