Autowarm (CLOSED)

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

the .state was missing then i will try now and get back too you

1 Like
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

is there a way to slowly fade the light from 100 to 10 over an hour or so period ?

Maybe you can get some hints from this thread?

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

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

Thanks for that i will add it into my rule now

i was recomended a text editior too help with creating rules with OH cant remember what its called any ideas ?

just found that myself waiting for install i just didnt think the one i was recomended was called that

https://docs.openhab.org/configuration/editors.html

Here are all listed :slight_smile:

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…

There is no Packages especially for Openhab… but rule code is JavaScript …

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

Can you add notes and descriptions to your rules

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 :slight_smile:

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