Hello
Trying to take what I have learned from my other questions and apply it here.
I want the fan to cycle - this room has vaulted ceiling and mixing the air makes the temp much more balanced
Hello
Trying to take what I have learned from my other questions and apply it here.
I want the fan to cycle - this room has vaulted ceiling and mixing the air makes the temp much more balanced
I'm sorry to say this, but there is a lot wrong here... I don't use repeats myself, so I'll leave it to someone familiar with that stuff to help there. But I see no mechanism to stop this rule's (repeating) actions once it starts, so that will need to get addressed.
You're missing End-Ifs to properly close any of your If statements.
Your stuff about <35 is never going to happen since you don't have a trigger event that would call it.
As it stands now, this rule will trigger every time Station reports a temp >85... Depending on how "Station" is programmed to report temp, that could be really often. That will almost certainly be problematic.
I'm guessing other users have tackled this same sort of desired action before (periodic circulation), so hopefully someone will be able to provide an example that's working for them.
As @hydro311 mentioned, your current rule has a few issues.
I recommend thinking about this one from a different perspective. Take a look at the following rule, which is much simpler to me.
Hope this helps!
This rule uses a "Periodic Schedule" trigger, using the Every 30 Minutes feature. It also has a Required Expression that will prevent the Actions from being run every 30 minutes unless the temperature is greater than 85 degrees. The actions are pretty simple: 1) turn on the fan 2) turn off the fan after a 5 minute delay.
The End-rep doesn't stop it ?
half the time im told to use them and half the time I'm told it doesn't matter. so i never use them to keep from getting confused
yeah i notice i adjust the trigger i made conditions forgot to put it up there.
I didn't think about that, but currently it only polls my weather station API every 15 minutes - no clue how to prevent that
why im posting here - I feel like the dev of this product just assume everyone can program or has knowledge of it.
The only time you can get really away with not using an End-If is when a singular If statement is involved. Otherwise, missing End-Ifs will generally be problematic.
Instead of erring toward never including End-Ifs, I'd encourage you to always include them -- then you're always covered.
The reality is that rule building is often harder than it initially seems -- once you really start thinking through the desired sequence of events and all the corresponding dependencies, there are often more things to consider than you initially thought.
But don't get discouraged -- at one time, we were all at that point too -- it just takes some time and experience to grow your familiarity and confidence.
Start small and simple -- such rules may not be perfect, but as your experince and confidence grows, you can build upon those simple rules to make them more complete and comprehensive.
I'm the farthest thing from a dev/programmer there is, but this stuff is ultimately just applying basic logical reasoning. Who knew one of the most valuable undergrad courses I'd take was a Philosophy class that covered the basics of Logic
Just making sure you saw my earlier post...? Should really simplify things.
I see what you are saying - my biggest issue is in the past i have had issue with "wait? and "every" commands working - but its been ~2 years ill try to set this up - as you said easier
okay where in world do the end-if go ? i i put it before the "else" doesn't the stop the code?
the problem is the way my brain think things flow and the rest of world mine is always complete different lol.
Every If should close out with an End-If -- if there are 4 Ifs, there should be 4 corresponding End-Ifs.
When multiple If statements are used, the End-Ifs ensure that the rule properly progresses to the next component.
You could look at Webcore as well if Rule Machine logic doesn't fit with how you think about things. I think that for many Webcore users, the logic structures are just much more straightforward and simpler than Rule Machine. Others also think it is harder than using RM, but for one thing, you will never have to worry about closing out your if statements since it is automatically done for you.
I personally really dislike the way RM builds the logic. To each their own, but if you have never tried Webcore, maybe look into it if RM seems confusing. I've been using Webcore for many years, from back to when I was on Smart Things. You may hate it, but it may just make more sense for you too, but you would have to try it to know.
I don't have any experience using Repeats, so I'm not in a good position to help salvage that rule as it is now.
I was remiss in an earlier post where I implied that an Else-If also needs an End-If. Since an Else-If is a component within an If, then just that original If needs an End-If to close it out.
In the Documentation, there's a good example of a IF - Else-If - Else - End-If. The link below will automatically scroll down to the section with that example.
What I am seeing in your rule is that you want the fan to run at medium if the temperature is either grater than 85 or lower than 35. The rule as written will not work, so I would recommend you disable it for now and start a new one.
I would do the following (essentially what @ogiewon suggested):
Required Expression:
Temperature of Station is > 85.0 or Temperature of Station is < 35.0
To do this, activate the âUse Required Expressionâ toggle, then âDefine Required Expressionâ, then from the âDefine Expression Elementâ, Select âNew Conditionâ. From there, select: âTemperatureâ, then chose your Temperature Station, then comparison â<â, then enter 35 in the Temperature field. Once that is done, chose âorâ and repeat the selection and setup for Temperature.
Trigger:
Every 20 Minutes
To do this, select: Periodic Schedule, then Minutes as the âSelect periodic frequencyâ, then select â> Every n minutesâ, the select â20â in the â> Select number of minutes drop downâ. (25 minutes is not an available option for a reason that I wonât go into hereâŚ
Action:
Set Fan Speed: Living Room fan to medium
Set Fan Speed: Living Room fan to off â> delayed: 0:05:00
That rule seems simpler (it is), but it will work.
thinking about what you said before - everytime the temp updates - would trigger the rule anyway right ? so for this case the rep rule is redundant and burning CPU cycles ... .
can you educate me on why it wont work so i can learn ?
If i click "run now" it does correctly skip both actions (temps not in range)
however the only way to test would be change the temp so they are in range lol
I will try to wrap my head around the above and post a suggested rule in the meantime
If you click ârun nowâ, it will turn on the fan to medium, then turn it off after 5 minutes. (If you click ârun nowâ multiple times, it will seem like it is doing odd things (stopping), because every time that button is pressed, it adds an action on the hub for 5 minutes in the future to stop the fan. And those actions will remain on the hub until they are executed. This wonât be an issue during the automation, because the rule is only set to run every 20 or 30 minutes.)
If you want to test it, you can create a virtual temperature sensor and use that instead of your Station in the rule. With a virtual device, you can go to the device screen for the virtual station, and manually change the temperature to whatever youâd like.
The âRequired Expressionâ is what will stop it from doing anything unless the temperature is in one of the ranges specified.
The âTriggerâ is what will have Rule Machine (RM) run the rule when the âRequired Expressionâ is met (the temperature is in one of the ranges specified).
The Action will only happen when the rule is triggered automatically every 20 minutes (in my example), but only if the ârequired expressionâ is met (the temperature is in one of the ranges specified).
Does this help?
If you try writing the rule, once done, take a screenshot and share it so we can confirm that it looks correct.
wait so its like firewall rule top down ? so have the condition will not waste CPU on a rules that is going to do nothing
ugh im wondering if this is why my device bogs down over time an i have to reboot ? I dont have a many RM rules though
edit
one this to clarify the Trigger runs every 20 minutes ?
Yes, this trigger will run every 20 minutes. It will then check the Required Expression and will stop all processing if the condition is not met.
This is a very efficient way of handling this rule, IMHO.
However, there is a downside to the way this rule is configured. If someone has already turned the fan on manually, and wants the fan to run for more than 5 minutes, this rule will stop the fan after five minutes. You can add another condition to the Required Expression (RE) to handle this scenario, if desired. Simply make the RE something like...
Living Room fan = Off AND (Temperature of Station is >= 85 OR Temperature of Station is <= 35)
This way, if the fan is already running, the rule simply will not execute, even though one of the two temperature thresholds may be met.
Here is a modified version that will handle the case where someone has previously turned on the fan, and would like for it to not get automatically turned off by this rule.
Thatâs a great catch! @v6turbo, I agree with @ogiewon that the rule as he describes should do exactly what you are looking for.
As for hub performance, it can be due to multiple rules, but more than likely repeat actions. As an example, a light set to flash very often by sending an on or off command continuously can have a great impact on the hub. (Some devices support flashing via firmware, but most donât.)
Many apps or apps that are not properly written can also hurt the hubâs performance.