Sharpy
(Aaron Sharp)
January 4, 2018, 1:04pm
5
im still pretty new too all the text based stuff so its hard to understand i might aswell learn french lol thanks everyone for your help
could you please explain why you made the changes to the origianal code and why it wasent working and why it now would
To Access the State of any Item you must describe it in rule. -> item.state not only item
Sharpy
(Aaron Sharp)
January 4, 2018, 1:12pm
7
the .state was missing then i will try now and get back too you
1 Like
Sharpy
(Aaron Sharp)
January 4, 2018, 2:17pm
8
rule "Test KL 1:20PM Daily"
when
Time cron "0 22 13 1/1 * ? *"
then
if (BULB1DSKITCHEN_Brightness.state >= 20) {
BULB1DSKITCHEN_Brightness.sendCommand(20)
}
end
this rule worked thanks for that i only made changes to the cron so it would run now and changed also changed bulb as people were using lamp 1
Sharpy
(Aaron Sharp)
January 4, 2018, 7:51pm
9
is there a way to slowly fade the light from 100 to 10 over an hour or so period ?
KjetilA
(Kjetil Asdal)
January 4, 2018, 8:04pm
10
Maybe you can get some hints from this thread?
Does anyone have an idea on how i can set my lights to dim slowly over time. I have philips hue lights. What i want to do is make a 'goto sleep scene' and a 'waking up scene'.
an idea i have is to create timers, but that seems so much code. Does anyone have other ideas?
import org.openhab.model.script.actions.*
import org.joda.time.*
var Timer timer15
var Timer timer14
var Timer timer13
//etc.
rule "Goto to sleep"
when
Item SwGotoSleep changed
then
timer15 = createTimer(now.plusMinutes(1…
Sharpy
(Aaron Sharp)
January 4, 2018, 8:13pm
11
iv just looked throught there i will read it again see if i can make sense of it i was hoping for a simple command
like decrease brightness of lamp by -5 run by a cron time nothings ever simple lol
Sharpy
(Aaron Sharp)
January 5, 2018, 6:28pm
12
ok i have got my rule running the rule is still
rule "Dim LR Light @ 10:00PM Daily"
when
Time cron " 0 0 22 1/1 * ? *"
then
if (Lamp1_Brightness.state >= 20) {
Lamp1_Brightness.sendCommand(20)
}
end
could someone tell me how to add a only if to my rule i need the rule to run as long as Movie Mode is not Enabled
my movie mode trigger is called
Movie_Mode_Trigger changed from NULL to ON
rule "Dim LR Light @ 10:00PM Daily"
when
Time cron " 0 0 22 1/1 * ? *"
then
if (Movie_Mode_Trigger.state == OFF) {
if (Lamp1_Brightness.state >= 20) {
Lamp1_Brightness.sendCommand(20)
}
}
end
1 Like
Sharpy
(Aaron Sharp)
January 5, 2018, 6:35pm
14
Thanks for that i will add it into my rule now
Sharpy
(Aaron Sharp)
January 5, 2018, 6:53pm
15
i was recomended a text editior too help with creating rules with OH cant remember what its called any ideas ?
Sharpy
(Aaron Sharp)
January 5, 2018, 6:58pm
17
just found that myself waiting for install i just didnt think the one i was recomended was called that
Sharpy
(Aaron Sharp)
January 5, 2018, 7:04pm
19
what editor would you recomend
do you after enable the openhab eextension or set it as a default in studio code i have pasted a rule and its just white text not colored i have downloaded and installed the OH extention
Works when opening a rule thanks
I don’t know …
I use Atom on my Macbook…
At GitHub, we’re building the text editor we’ve always wanted: hackable to the core, but approachable on the first day without ever touching a config file. We can’t wait to see what you build with it.
There is no Packages especially for Openhab… but rule code is JavaScript …
Sharpy
(Aaron Sharp)
January 5, 2018, 7:26pm
21
it seems to work if you just create a blank txt document with append .rules i can live with that thanks for your help i have alot of light rules to sort now im doing lighs because the rules are simple
Sharpy
(Aaron Sharp)
January 5, 2018, 7:36pm
22
Can you add notes and descriptions to your rules
Sharpy
(Aaron Sharp)
January 5, 2018, 8:13pm
23
I have been using this command too turn off my hue colour light
sendCommand( BULB6LRMAIN1_Color, 63,3,0)
i would like to be able to add a only if light is not already set at 100 brightness that would be
63,3,100
but if somone changed the color of the bulb the first two numbers would be different so i cant use
if =63,3,100
is there a wildcard option like
if =*,*,100
Try this Code
rule "RGB"
when
Item your_item changed
then
var HSBType currentState
currentState = BULB6LRMAIN1_Color.state
var PercentType bright = currentState.getBrightness()
if (bright != 100) {
sendCommand( BULB6LRMAIN1_Color, 63,3,0)
}
end