Help with Garage Automation(solved) Thanks to everybody that contributed

What I am trying to do is turn the garage fans (which are two old fans wired to a plug and plugged in a smart outlet) on when temp goes over 85 and turn off when the temp goes below 85. Here is what I have so far.


The thing is, if I leave home I want the fans to turn off and then turn on when I get back as long as the temp is still over 85.
I know this may be mundane to some of you but I am just learning and need all the help I can get. All my basic automations run great but I am trying to make some more complicated ones.

I have a quick errand to run, but I totally get what you're saying. I have a similar rule that runs my bedroom fan. the problem you're going to find is that sensor isn't going to report enough to be reliable. They're great for reference, but basing an automation on it might frustrate you. Just know that reporting isn't fast and it might not report often enough.
I'll post my fan rule here, you can modify it for your needs. It's much more than you need ,but will help you with the concept. When I return in roughly 60 minutes, I can discuss more.
You would just use your presence and the temperature would be handled in a more simple way, but here's the idea

1 Like

Thanks for the reference material. I will be in and out today, but I will totally look this over and see if I can understand what you have done and adapt it for my application.

No problem. When I get back I'll give you something closer to your use case to check out later as well.

Hi,
@april.brandt is better at this than I but I can give you some direction.

Triggers are just that. The Actions are not evaluated until a trigger occurs. And triggers only work with things changing. Think of a gun, when the trigger is pulled, the gun fires. If you continue to hold the trigger in ..... nothing else happens. So a trigger like " bathroom light is on" is meaningless. Also triggers are always OR's together so any one trigger will result in the Actions to be evaluated.

You would need three triggers

  1. Temperature of garage becomes > 86
  2. Temperature of garage becomes < 84 I would not have both the temperatures the same as it could cause the fans to dither on / off.
  3. If mode changes

Actions:

  1. If mode is home and the temp is > 86 turn fan on
  2. If mode is home and the temp is <83 turn fan off
  3. if mode is away then turn fan off.

I personally cannot write rules from my head. I have to write out something like the above and review it a couple of times before I start writing my rule.

Hope this helps.

John

Well I came up with this, based on what you sent me.


I am not sure what circled in red does, I could use an explanation. I noticed you had it for Home mode fans off, so I made it for Night and Away fan off. Do you think it will fly.

Thanks, I can use this info. So it looks like I need to change the temps. I tried writing things down and like you try to get it lined out. Most of the time I know what I want to do but find it hard to get it going with RM.

That sets the outlet to off when mode changes to either night or away
This is how I would write this rule.
The reason I would do that is because if you leave and the mode changes to away, the fans will turn off after 2 minutes, but if you return within that time or, say, your wife comes home, then the fans will not shut off if it's within that 2 minute window.
image
That being said, I would definitely put this switch in a dashboard and set up in the notifications app that if home is in away mode for more than 5 minutes and the fans did not shut off, to notify you. i would actually notify you of this switch on or off all the time using pushover. Just to be safe. Just because these are older fans and you don't want them running if you're not there.

[EDIT]
Luckily, I have the right automations in my garage to be able to use the respective devices that you're using. But no fans :grin:
What are you using for presence? Will you need them to turn off when you go to bed? Do you have a mode for that. I run - home, away, night and quiet time for modes.

You might consider staying with separate temperature triggers:

  1. Temperature of garage becomes > 86
  2. Temperature of garage becomes < 84

Because if I understand your Temperature sensor reports to 2 decimal places (77.67) So it may report a lot of changes. Or if the reports are limited to 5 or 10 minute intervals (or so interval) then it doesn't matter.

This will never trigger the second rule as the event triggers when over 85, so it would never be under 85 and over 85 at the same time. Create a separate rule or use something like @april.brandt suggested with the Temperature changed trigger. Just note this will trigger the rule frequently as any change in the temp will cause the rule to trigger.

I would suggest two rules:

Rule 1
Trigger: Temp > 85
Run: If Mode is Home THEN On: Fan
END-IF

Rule 2
Trigger: Temp < 85
Run: Off: Fan

This way each rule will only trigger when the respective condition is met and only turn on the fan if you're home and the temp is over 85

If you did want a single rule, could try the following:

Trigger: Temp < 85 OR Temp > 85
Run: If Mode is Home AND Temp > 85 Then On: Fan
ELSE Off: Fan
END-IF

This should only trigger when the temp crosses that 85ΒΊ threshold. If below, turn off fans. If above, and you're home, then turn on fans.

After all the great help I have received, I have come up with this.


I think it checks all the boxes.

Your rule looks great the way it is @davidcwright59 - I need to set this thread straight, you're being told to keep the temperatures without a gap. And using the sensor you're using, it might be ok, but if you get something more responsive, you'll get the fans cycling on and off repeatedly because it will never really cool below the 85 degree threshold for long enough to keep the fan off. The intent is to cool it enough below 85 so that the fans turn off for a while. I can say with 100% accuracy and confidence that putting the fan temperatures at >85 and <85 without a buffer will give you poor results, so please keep that gap.
Also, the and you have in your rule means that your temperature needs to be below 84 AND it has to be night or away to turn off. . If you change that to an OR, the rule will turn off if the temperature is low enough AND will ALSO turn off if mode changes to night or away. I believe this was your original intent?

Yes, you are correct about the AND change to OR, that is my intent. I will change that, thank you.
I don't sensor responsiveness is a thing I need to be concerned about, but I will keep an eye on any cycling on and off repeatedly.

With your current rule with 2 degrees difference, you wont have that. Your rule looks great, just needs t hat OR and I feel like you're all set. The reason I mentioned the cycling is because I experienced it with my ceiling fan in the bedroom in the middle of the night. Annoying. I separated the temps a bit and it runs like a dream. But, I do have an environment sensor created by @iharyadi, so when the temp changes, it's recognized immediately. This wouldn't be necessary in a garage, but you did need to know that it's a thing that will happen. Also with new users looking at the thread, it could be an issue.