I’m a newbie, please help
I created a rule. I need the rule to do the “sufit” after the command:
1: Assigned the value 877 to the variable “Mowa” (it works)
2: Switch Dioda1 turned the relay on or off (it doesn’t work)
My things
Bridge mqtt:broker:MosquittoMqttBroker “Mój MQTT Broker” [
host=“192.168.10.112”,
secure=false,
port=1883,
clientID=“OpenHAB2”,
username=“abc”,
password=“abc”
My things
Thing mqtt:topic:Dioda1 “Duży pokój” (mqtt:broker:MosquittoMqttBroker) {
Channels:
/* */ Type switch : power “Power Dioda1” [
commandTopic=“cmnd/Plytka186/POWER1”,
stateTopic=“stat/Plytka186/POWER1”,
on=“on”,
off=“off”
] }
My Sitemap
sitemap MojDom label=“Mój Dom”
{
Frame label=“Pokój 1”
{
Switch item=Dioda1 icon=“light”
Switch item=Dioda2 icon=“light”
Switch item=Dioda3 icon=“light”
Switch item=Dioda4 icon=“light”
Text item=StanLED1 icon=“light”
}
/* Switch - przełącznik */
Frame label=“Pokój 2”
{
Text item=Termometr1 label=“Temperatura Duży [%.1f °C]” icon=“temperature” valuecolor=[<20=“orange”,>22=“green”,>23=“red”,<=24=“blue”]
Text item=Wilgotnosc1 label=“Wilgotność Duży [%.1f %%]” icon=“Humidity”
}
Frame label=“Pokój 3”
{
Text item=Ampery icon=“light”
Text item=Odleglosc icon=“incline”
Text item=Mowa
}
}
My items
Switch Dioda1
“Wyłącznik LED1” {channel=“mqtt:topic:Dioda1:power”}
My rules
import java.lang.Object
import org.eclipse.smarthome.core.items.GenericItem
import org.eclipse.smarthome.core.library.items.StringItem
rule “przelacz sufit”
when
Item weather_common_id received command sufit
then
sendCommand(Mowa , 877)
Switch Dioda1 {mqtt=“>[broker:mqtt:topic:Dioda1:power]”}
end