LET ME PUT THIS CLEAR I DO NOT WANT YOU ALL TO DO MY WORK FOR ME IM TRYING TO LEARN
Could you all please send me some example rules with explanation I’m trying to learn how to build my own text based rules (it seems like PAPERUI can’t do some things needed)
i have already read through the rule docu (theres alot to take in there)
And need too start somewhere but haven’t a clue
Please send simple rules with notes explaining how they work and what they do
I would like them easy to edit so I can try them in my setup and edit and add from there
Rule 1) A dim light to 50 at 8pm but only if it’s already above 50 brightness (i have done this rule in paperui doeset seem too work)
i have already had a read off the rules section and to be honest there was that much information there it was just overwhelming
what i need is example rules
like something changes so turn off something
if i had example rules and i edited them to work with my setup i could see how they run learn some more and keep reading the link you sent me once i actually understand whats happening
thanks again opus but they seem like complicated rules (i cant code big blocks of text like that scare and confuse people who arnt used too it it might aswell be in german or something)
im after a starter simple rule too play with and learn from could you send me one of your simple rules
eg
button press light turns on
or its some time of day dim light to whaterer but only if whatever
Normally an Item (in this case as switch or button) would be linked to a Thing (the light), that way the press on that Item would turn the ligth on directly. No rule needed!
rule “Basic rule”
when
Item TestSwitch changed
then
sendCommand(LigthSwitch, ON)
end
rule "MY FIRST RULE"
when
Item Movie_Mode_Trigger changed
then
if (mySwitch.state == ON) {
sendCommand(Light1_Brightness, 50)
sendCommand(Light2_Brightness, 0)
}
end
I agree that a list of simple sample rules would help a lot of beginners. The OH1 examples are too overwhelming at first.
rule "MY SECOND RULE"
when
Item Movie_Mode_Trigger changed
then
if (Light1_Brightness => 50) {
sendCommand(Light1_Brightness, 50)
sendCommand(Light2_Brightness, 0)
}
end
when movie mode is pressed it checks to see if the brightness is above 50 if it is it lowers lamp 1 to 50 and turns lamp 2 off ?
could you also explain why there are now {} brackets in your rule but the other rule didnt
Using the {} brackets is just the syntax (like in the German language, every noun beginning with a capital letter).
In this case the brackets contains the list of things that need to be done if the if-then clause is met.
if (this is true) {
do all this stuff within the brackets
}
Your more than or equal to to should be >=. . This is explained here
Rule "Do something at 2.00pm or 14:00)"
when
Time cron "0 0 14 1/1 * ? *"
then
...Do stuff...
end
You do not need to know how to make the cron expression for the time.
On cronmaker.com, you select your time (and other things like whether you want it to happen everyday or, for example, just at weekends), and then click Generate Cron expression. The resultant Cron format is the one to paste into your rule.
Don’t forget the quotation marks around the Cron expression as in my example.