Hi, i am new to openhab.
i connect some dimmers via mqtt to openhab, it works fine.
now i want to make some scenes with rules, but the didnt response.
my item file:
Dimmer woonkamer_hanglamp "Hanglamp woonkamer" {mqtt=">[localbroker:home/0/woonkamer/lamp/hanglamp:command:*:default],<[localbroker:home/0/woonkamer/lamp/hanglamp/state:state:default"}
Dimmer woonkamer_spots "Spots woonkamer" {mqtt=">[localbroker:home/0/woonkamer/lamp/spots:command:*:default],<[localbroker:home/0/woonkamer/lamp/spots/state:state:default"}
Dimmer woonkamer_lamp_voor "Staande lamp woonkamer voor" {mqtt=">[localbroker:home/0/woonkamer/lamp/lampvoor:command:*:default],<[localbroker:home/0/woonkamer/lamp/lampvoor/state:state:default"}
Dimmer woonkamer_lamp_bank "Lamp bank woonkamer" {mqtt=">[localbroker:home/0/woonkamer/lamp/lampbank:command:*:default],<[localbroker:home/0/woonkamer/lamp/lampbank/state:state:default"}
Dimmer woonkamer_hanglamp_bureau "Hanglamp bureau woonkamer" {mqtt=">[localbroker:home/0/woonkamer/lamp/hanglampbureau:command:*:default],<[localbroker:home/0/woonkamer/lamp/hanglampbureau/state:state:default"}
Dimmer woonkamer_bureaulamp "Bureaulamp woonkamer" {mqtt=">[localbroker:home/0/woonkamer/lamp/bureaulamp:command:*:default],<[localbroker:home/0/woonkamer/lamp/bureaulamp/state:state:default"}
Dimmer keuken_tafel "keukenlamp" {mqtt=">[localbroker:home/0/keuken/lamp/keukenlamp:command:*:default],<[localbroker:home/0/keuken/lamp/keukenlamp/state:state:default"}
Dimmer keuken_aanrecht "lamp aanrecht" {mqtt=">[localbroker:home/0/keuken/lamp/aanrecht:command:*:default],<[localbroker:home/0/keuken/lamp/aanrecht/state:state:default"}
Number myScenes "Scene Number is [%s]"
my sitemap
sitemap default label="Begane grond"
{
Switch item=myScenes mappings=[0="0",1="1",2="2",3="3"]
Slider item=woonkamer_hanglamp label="Woonkamer hanglamp"
Slider item=woonkamer_spots label="Spots woonkamer"
Slider item=woonkamer_lamp_voor label="Staande lamp woonkamer voor"
Slider item=woonkamer_lamp_bank label="Lamp bank woonkamer"
Slider item=woonkamer_hanglamp_bureau label="Hanglamp bureau woonkamer"
Slider item=woonkamer_bureaulamp label="Bureaulamp woonkamer"
Slider item=keuken_tafel label="keukenlamp"
Slider item=keuken_aanrecht label="lamp aanrecht"
}
my rules:
rule "my scenes switch"
when
Item myScenes changed
then
switch (myScenes) {
case 0: {
woonkamer_hanglamp.sendCommand(OFF)
}
case 1: {
woonkamer_hanglamp.sendCommand(50)
}
case 2: {
woonkamer_hanglamp.sendCommand(70)
}
case 3: {
woonkamer_hanglamp.sendCommand(100)
}
default: {
logInfo("myScenes","incorrect state: {}",myScenes.state)
}
}
end
i dont now why it didnt work.
I hope someone can help me!