I’m trying to set up a rule, so my IKEA Traadfri Bulbs are set to Brightness = 0, when I click a button that I’ve already created in my items file.
//This is the Rules file
//IKEA Tradfri
rule "Turn off IKEA Bulbs when Button1 is pressed in Hobbyrum"
when Item HR_Mainlight changed to ON
then
if (Hobbyrum_LED1_Bright.state == ON){
sendCommand(Hobbyrum_LED1_Bright, OFF)
} else {
sendCommand(Hobbyrum_LED1_Bright, ON)
}
end
Thanks for getting back to me. When you click on your button and your Bulbs turns off, does the Dimmer in your BasicUI or Habpanel also changes do 0.
When I use the above code (Some names have changed) nothing happens, when I click on the Switch. It simply stays on the same values.
Is it possible to trigger the dimmer state somehow? So if I turn off the LED1 as mentioned above, then the Dimmer will also turn down to 0?
.rules;
rule "Turn off Trådfri Bulbs left_IHC_Push"
when
Item left_IHC_PUSH changed to ON
then
if (Hobbyrum_LED1_switch.state == ON){
sendCommand(Hobbyrum_LED1_switch, OFF)
} else {
sendCommand(Hobbyrum_LED1_switch, ON)
}
end
That currently I’m playing around with myScenarios
rule "My Scenarios"
when
Item myScenarios changed
then
switch (myScenarios) {
case 0: {
Item1.sendCommand(OFF)
Item2.sendCommand(OFF)
Item3.sendCommand(OFF)
Item4.sendCommand(OFF)
}
case 1: {
Item1.sendCommand(ON)
Item2.sendCommand(ON)
Item3.sendCommand(ON)
Item4.sendCommand(ON)
}
case 2: {
Item1.sendCommand(OFF)
Item2.sendCommand(OFF)
Item3.sendCommand(ON)
Item4.sendCommand(ON)
}
case 3: {
Item1.sendCommand(ON)
Item2.sendCommand(ON)
Item3.sendCommand(OFF)
Item4.sendCommand(OFF)
}
default: {
logInfo("myScenarios","incorrect state: {}",myScenarios.state)
}
}
end
So that will be why you see the Number myScenarios “Scenario [%s]” in the traadfri.items file and also why you see the
Switch item=myScenarios mappings=[0=“OFF”,1=“ON”,2=“Morgen”,3=“Aften”] in my sitemap.
I’m guessing that it should be possible to do the same here? Just can’t get it to walk with the above commands you already gave me
Thats exactly what I want!!!
So I’m guessing you created a Dimmer and a Switch as a Dummy and then Linked the IKEA Bulb to those two?
For some reason I can’t edit the category when being on the webinterface - I’m doing it all through ssh.
Is it possible that I could see your item, rule and sitemap file perhaps?
Yeah it should be…
The only thing I don’t understand is, when I try to search for my IKEA Bulbs it only comes up with the 0220 color temperature. It doesn’t add the second one with the 0100. Did you also have to manually add that?