This object is in archive! 
perform an action at 6:30 am but not before sunrise
Need Answer
Hi, I tried to create a rule that has to open my blinds at 6:30 am but only if it's not before sunrise (via virtual weather station). In other words: if it's still "dark" at 6:30 my blinds have to stay shut. (They will be controlled by another rule then)
Unfortunately, it is not possible to select sunrise (or sunset) from the attributes of the virtual wheather station.
My rule would look like this:
- When scheduler [6:30, every day]
- IF now > [virtual wheather meter: sunrise]
- [action to open blinds]
- ...
In the virtual wheather meter, there are 9 attributes available in the drop down, but not sunrise or sunset although I can use the latter 2 in the scheduler, but that's not the case in this rule)
Any idea how I could make my rule work?
No connection
Real-time notifications may not work
Hey,
here an other idea:
I use a virtual switch for "daylight". It is set in the morning to on with the scheduler sunrise and off at evening by sundown (2 rules). I have a lot of rules which use "daylight". Now you have a simple rule for your problem:
if time =06:30 and daylight = on
action
end if
Hey,
here an other idea:
I use a virtual switch for "daylight". It is set in the morning to on with the scheduler sunrise and off at evening by sundown (2 rules). I have a lot of rules which use "daylight". Now you have a simple rule for your problem:
if time =06:30 and daylight = on
action
end if
You can select sunrise in the scheduler. So you have to do it the other way.
Create a variable.
create 2 rules.
First rule:
When sunrise
time(now)->variable;
Second rule:
Your rule with the variable
You can select sunrise in the scheduler. So you have to do it the other way.
Create a variable.
create 2 rules.
First rule:
When sunrise
time(now)->variable;
Second rule:
Your rule with the variable
Thanks John. I tried your advice but got an error message when saving the 2nd rule:
First rule looks like this:
Second rule:
Gives Error message:
FAIL: javac: The method CompareTo(java.util.Calendar) in the type java.util.Calendar is not applicable for the arguments (double)
After saving, the 2nd rule is marked as invalid.
Any idea?
Thanks John. I tried your advice but got an error message when saving the 2nd rule:
First rule looks like this:
Second rule:
Gives Error message:
FAIL: javac: The method CompareTo(java.util.Calendar) in the type java.util.Calendar is not applicable for the arguments (double)
After saving, the 2nd rule is marked as invalid.
Any idea?
I tried another syntax in rule 2. At least, it doesn't give the error message anymore.
I'll provide feed back tomorrow wheather the rule works.
I tried another syntax in rule 2. At least, it doesn't give the error message anymore.
I'll provide feed back tomorrow wheather the rule works.
I am not sure about this but NOW is i think has a date/time type. So it is always better to use time(now)
I am not sure about this but NOW is i think has a date/time type. So it is always better to use time(now)
Hey,
here an other idea:
I use a virtual switch for "daylight". It is set in the morning to on with the scheduler sunrise and off at evening by sundown (2 rules). I have a lot of rules which use "daylight". Now you have a simple rule for your problem:
if time =06:30 and daylight = on
action
end if
Hey,
here an other idea:
I use a virtual switch for "daylight". It is set in the morning to on with the scheduler sunrise and off at evening by sundown (2 rules). I have a lot of rules which use "daylight". Now you have a simple rule for your problem:
if time =06:30 and daylight = on
action
end if
Thank you guys! Both are good solutions. Maybe Andreas' proposition is preferrable (in order to not have issues with the time format).
Thank you guys! Both are good solutions. Maybe Andreas' proposition is preferrable (in order to not have issues with the time format).
Replies have been locked on this page!