Help with Rules for Screens

I have 4 sets of French doors in a room with awning windows and automatic exterior screens. I have added security sensors to the awning windows. The screens are on a scheduled timer (Bond Hub) to close after Sun Rise. I wrote what I think is a correct rule to stop the automatic closing if the awnings are OPEN. I'd appreciate it if someone could look over the rule I wrote and tell me if there are any errors. Admittedly I am a novice at this.

Your Required Expression needs attention - right now, it's "[sensors] any open AND [sensors] any closed", which doesn't make sense.

If I'm understanding correctly, I think you want the Reqd Expression to instead just be "[sensors] all closed" -- if that's not true (i.e. any or all awnings are open), that would then make the Reqd Expression false so then the screens won't close at SR.

In the "Actions" section, does that "open" command mean that the screens will (in fact) close? That seems unintuitive, but I know those terms can get weird depending on the driver being used.

1 Like

I agree this doesn't seem right. I am definitely in deep water for my ability.

To start. I am unsure if I should base the rule on whether the awnings contacts are open or closed. Essentially I do not want the screens in the room to close if any awning (contact) is open.

I changed this to what I thought would work (see below) but it doesn't. I ran the rule and even though there were awnings open (contact open) the screens came down.

I appreciate the help.

As I mentioned earlier, I think the Reqd Expression should be "[sensors] all closed". Then if any (one, some, all) are open, the rule will not trigger.

1 Like

With this, you'll need to change your Required Expression to all contacts are closed not any. With any, all it takes is for one contact to be closed and the Required Expression becomes true even if all the others are open.

When you click Run Actions, it does not check the Required Expressions or Triggers. It just runs the actions. That's why it still ran.

1 Like

Again Appreciate the help.

I changed the rule to ALL

I am getting an error I don't understand in logs though.

I didn't run the rule from the app though. I just used the Bond App to try closing the screens. They came down.

If you click on the "dev:24" link in the logs (left side), that'll tell you what device is spitting those errors.

Running commands directly from the Bond app on your phone won't have anything to do with this rule here - the bond app has no idea this rule exists.

Ok, I know I'm in over my head now. Maybe what I am trying to do isn't feasible. Or the way I have it set up? I had hoped that the Habitat Rule would prevent the screens from coming down when the Bond Device Schedule (also on Habitat) triggers them to come down. How would I do it?

Here is what I get when I click on "dev:24" -My apologies I have no idea what it is telling me.

Sorry, I'm not sure about those Bond errors in the log -- I haven't ever seen those, so I'm not sure what they mean.

Any rule only knows itself -- its own triggers, action, conditions -- it doesn't know what else is going on with the hub. If there's some other schedule triggering the shades to come down, this rule doesn't know that... It only knows that if its own Reqd Expression is true, then at sunrise, it'll do its own specified actions -- that's it.

Click the error button which should open up the Bond App on Hubitat. Make sure that everything looks correct in the app and hit the done button. See if that shakes loose the error.

What you want is definitely feasible assuming Hubitat is the only thing controlling your Bond Bridge. If you use the Bond phone app, Hubitat will not know what state your blinds are in since the Bond Bridge does not sync.

  1. Clicking on Error takes me to the Bond Device Page but you said the App? Am I missing something?

  2. OK I get it - The Bond App has the schedule that's working the closing and opening. Are you saying that I need to replicate that schedule using a Habitat Rule for this to work? Assume that can be done. How would I test that then?

Nope. Go into the Bond Integration App. Make sure that it looks configured correctly and click done. See if that works. Did the error pop up after creating/running this rule? If so, delete the rule and go to the device page and see if things work.

Yes. The general advice is that for all automations, you want Hubitat to control it. Use the Bond app for manual control (if necessary). What is the automation in the Bond app? You should be able to replicate it in Hubitat fairly easily.

1 Like
  1. Not sure when the error takes place or why? Seeing how the only way I was testing is using the Bond App to run the screens down or the local wall switch. When I go to the Bond App (iPhone) it works correctly on anything that controls the screens. The automation is a "schedule" in the app to close and open a group of screens in the same room at certain times of the day.

I am going to try creating the schedule of open and close in Hubitat.

Should the rule for closing the screens based on time of day use the status of the awning sensors?

That would be completely up to you, unless there's some kind of potential for physical interference between the screens and the awnings - in that case, you'd definitely want to deconflict that correspondingly.

Ok, I wrote a new rule to use Habitat to close (I've omitted the time so I could test it by running it, I assume if it had the time in there it wouldn't run)

I tried to run it but it doesn't work. I have all the Awnings (contacts) closed. No errors in the log only shows "Initialized".

Also not sure what the "True, Unused" part is in the conditions means.

There are no actions in your screenshot, so there is nothing to run.

This just means you created a condition, but have not implemented it into any part of your rule.

A couple issues... First, you haven't put any Actions in the rule. Next, you built a condition, but you haven't used it anywhere yet.

I realize the latter thing is kinda confusing... Think of that "Manage Conditions" section as a staging area... You can pre-emptively build one or more conditions (as you've done here), and then later use them as a If-Then in the Actions area, or use them as a Conditional Trigger (which is similar but not the same as a Required Expression).

Whether you build conditions pre-emptively or you build them "as you go" in the rule, they'll show up in that Manage Conditions section. That becomes helpful in complex rules where you may use the same condition in multiple places w/in the rule -- in such cases, if it's necessary to later edit a condition, you can easily do it just once from the Manage Conditions area (instead of digging into the guts of the rule multiple times).

You should really check out the documentation for Rule Machine -- it helps cover a lot of basic rule-building concepts.

Rule 5.1 | Hubitat Documentation

1 Like

I 100% agree with the suggestion to read the documentation. There are lots of ways you could attack this. Below is a sample I whipped up to help get you started

At sunrise, this rule will run. It's very first action is what we call a simple conditional. It checks the state of all contacts to see if any are open. If this is true (any one of the contacts is open), the rule goes into a wait. The wait is for all the contacts to close. Only when that happens will the rule move to the next action. In this case, it turns off my back patio switch (your awnings).

If the simple conditional was false (i.e. all the contacts were closed), the rule would have progressed to the next action of turning off (closing in your case).

This is just one of many different ways you could attempt to only close the awnings if all contacts are closed.

1 Like

First thanks for everyone's help. The last example from JB 10 put me in the right place. I matched up what I was doing and it works just fine. I will be reading up on rules as well. A little nudge in the right direction helped.

1 Like