Thanks for your example, but it's not exactly what I'm looking for..
I think my question was not clear enough, I try again:
I would like my shutters to open at sunrise, but never before 8.00 o'clock.
But I don't know how to compare "sunrise" and "8.00" inside a linknx rule…
An idea ?
Regards,
Ben
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your example.
But in your case, if sunrise is before 8.00, shutters do not open, do they ?
the actionlist will executed if both timer conditions become true. If the sunrise is before 8:00, the second condition (Timer 8 to 12) will become true at 8 o'clock and then both conditions are true and the actionlist will be executed.
I haven't tested it but I think that it will function.
Best regards
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I want to create a rule like this, but I don't known how :
open shutters :
- either at sunrise if sunrise > 8.00
- nor at 8.00
Thanks for your help.
Ben
Hello,
I use:
<services>
<location lon="9.357208" lat="52.104018"/>
</services>
<rules>
<rule id="rule_tag">
<condition type="timer" trigger="true">
<at type='sunrise' wdays='1234567' offset="0"/>
<until type='sunset' wdays='1234567' offset="0"/>
</condition>
<actionlist>
<action type="set-value" id="tag" value="on" />
</actionlist>
<actionlist type="on-false">
<action type="set-value" id="tag" value="off" />
</actionlist>
</rule>
<rule id="rule_nacht">
<condition type="timer" trigger="true">
<at type='sunset' wdays='1234567' offset="0"/>
<until type='sunrise' wdays='1234567' offset="0"/>
</condition>
<actionlist>
<action type="set-value" id="nacht" value="on" />
</actionlist>
<actionlist type="on-false">
<action type="set-value" id="nacht" value="off" />
</actionlist>
</rule>
<rule id="tag_on">
<condition type="or">
<condition type="object" id="tag" value="on" trigger="true" />
</condition>
<actionlist>
<action type="set-value" id="daylight" value="on" />
</actionlist>
</rule>
<rule id="nacht_on">
<condition type="or">
<condition type="object" id="nacht" value="on" trigger="true" />
</condition>
<actionlist>
<action type="set-value" id="daylight" value="off" />
</actionlist>
</rule>
</rules>
Hans
Hello Hans,
Thanks for your example, but it's not exactly what I'm looking for..
I think my question was not clear enough, I try again:
I would like my shutters to open at sunrise, but never before 8.00 o'clock.
But I don't know how to compare "sunrise" and "8.00" inside a linknx rule…
An idea ?
Regards,
Ben
Hello Ben,
I would guess, that the following will work as you asked:
But the stuctured way from Hans is maybe a better way if you use more than one rules with sunrise an sunset functions.
Best regards,
Chris
Hi Chris,
Thanks for your example.
But in your case, if sunrise is before 8.00, shutters do not open, do they ?
I'm going to try these rules:
I'll give you my feedback.
Bye.
Ben
Hi Ben,
the actionlist will executed if both timer conditions become true. If the sunrise is before 8:00, the second condition (Timer 8 to 12) will become true at 8 o'clock and then both conditions are true and the actionlist will be executed.
I haven't tested it but I think that it will function.
Best regards
Chris
Thanks Chris, you're right!
I'll test your solution.
Ben
Hi,
@Chris,
My first test succeeded!
Thanks again.
@Hans,
How to use sunset and sunrise variables inside à LUA script?
Do you think it's possible?
KR,
Ben