What am I doing wrong?

I recently wrote this so when my hue motion sensor, sense light above a certain amount, and the blinds would automatically shut on that side of the house. I only wanted it working from a certain amount of time and then to open up at a certain amount of time, here is what I wrote if anyone help would be appreciated

First I would look at your trigger. Your rule will trigger when the illuminance is 3401, but also again at 3402, 3403, etc. The same with the temp, although you don't show how you are using that. Looks like some of the rule is cut off in your screenshot. You don't really say what is does or does not do that you didn't expect.

If you only want it triggering during certain time, a better approach might be to use a required expression, or conditional trigger. The conditional triggers are fairly new and I haven't really used them much yet, but seems like a good option for this.

1 Like

Another view of OP’s rule.

ETA: I’m also unsure why the Hue sensor’s temperature reports are in the rule trigger, based on what OP has said so far about intended use case.

3 Likes

I had initially installed temperature range so I wouldn’t have to pause the app in the summer time. I have the blinds go down in the summertime (time and temperature), as It’s so hot on the inside of the house. In the Winter time, the blinds can stay up, to let sun in. That was my I had wanted that. I can just pause app once it gets colder..

What is your intent with that second IF statement (since it's just a 5-minute window)?

terminal3's advice above to use Reqd Expression(s) and/or Conditional Trigger(s) is most definitely good advice to put better bumpers around all of this.

Remember that Triggers are events and Conditions are states. For example, "when time is 4:30" is an event, but "time is between 4:30 and 4:35" is a state, not an event.

1 Like

Your rule will send a lot of open and close commands to the device which more often than not already opened or closed.

I will make two rules. These will only fire when neccessary.
Be careful, because if one of the conditions fluctuates, it could drain the batteries on your blinds. For example on a cloudy day... You could slow that down by axtending the times in the triggers. Close every 5 minutes, open every 30 minutes for example.

  1. Close blinds
    Trigger: Every 5 minutes
    Required expression: Temp > 60 AND Illuminance > 3400 AND Blinds are Open AND Time between 08:00 and 16:30
    Action: Close blinds

  2. Open blinds
    Trigger: Every 5 minutes
    Required expression: (Temp < 60 OR Illuminance < 3400) AND Blinds are Closed AND Time between 08:00 and 16:30
    Action: Open blinds

You might need to create a hub variable "Blinds are open/closed"

If need be, add a third rule to open the blinds at 16:30.

Thank you for the help. I still do not understand not being able to write one rule, but still new at this, so any advise is appreciated.

Would your above examples be written in the rule section.

It would look something like this:

Thank you, did you right this in Rule machine Legacy rule or the new rule machine.

You might be overthinking this in some aspects.

You can’t create new rules in rule machine legacy. There is even an instruction to use Rule Machine:

Just browse to “Rule Machine” in your hub’s apps list, or add it as a built-in app by clicking the button at the top of the list of installed apps (if you have never installed Rule Machine previously). Then create a new rule from there.

Ok thank you.