How would you toggle something based on state?

Short version, my coffee machine is defective and goes to sleep every half hour when it should stay on. Solution: every half hour toggle the outlet to keep it awake. How would you go about this? I already have an outlet called Coffee that flips the power to the machine. I created a new virtual switch called Virt coffee real, that'll be the new switch that I would use to control when the machine should be on (i.e. would interrupt the 28 minute toggle so the machine isn't on 24/7, only when I want it on), then tried to create my first conditional rule, which I don't think worked. Details below, but some questions up front...

  1. when doing a conditional rule, which I understand to take place in the actions side more, and not using any event trigger, is it understood that the event is basically "always true"? When my machine was off I knew something went wrong, so wanted to make sure having no event trigger wasn't the issue.

  2. on my display it seems like my attempt at an "else if" condition is nested within the first if condition. If that's the case, they'll never both be true at the same time so the else if would never trigger. Can one have two "top-level" conditions in one rule? Or is it necessary for me to create a separate rule entirely to address the inverse situation?

Here's what I've got so far. Doesn't seem to be working just yet. Would appreciate any thoughts!

Despite your attempts, you will still need a trigger for any rule with or without conditions. Maybe I'm misunderstanding something here... but for this I would have used the virtual switch as the trigger, and then something very simple like this for turning on and off that will need a reactivation every half hour.

1 Like

This should do what you want

Amazing... So amazing idk how to even enter it into hubitat yet lol but I'll figure it out! Thanks for your input!

How'd you get the ELSE as a top level thing within the same action? I'm on mobile if that matters, but I can only seem to nest it within the IF...

Okay, I think I managed to set it up the same way, but for some reason my coffee machine went cold... Am I missing something? Thanks again for any help!

You don't need the IF coffee real on as it's the only other option.
You do need to have the END-REP after the off and on. Without this there isn't really an end to the list of the actions to repeat. You also don't need the delay on the off.

1 Like