- Platform information: OpenHAB2
- Hardware: CPUArchitecture/RAM/storage RaspberryPi 4
- OS: what OS is used and which version Debian
- Java Runtime Environment: which java platform is used and what version
- openHAB version:2
Hi,
I’m a complete beginner here. I’ve also made some progress. I have understood what items and things are, I know the channels and sitemap and rules as well. All devices are set up and also communicate with my PaperUI, I have already managed with external help a rule (window open, then heating to 7 ° C; window closed, then heating to 20 ° C), which looks like this:
`rule "Badheizung auf Frostschutz"
when
Item FF_Bathroom_Window changed
then
if (FF_Bathroom_Window.state == OPEN) {
FF_Bathroom_Heating.sendCommand(7)
}
else {FF_Bathroom_Heating.sendCommand(20)
}
end`
But if I want to create the next rule, then I’ll come back to my limits.
I just want the socket (where the dehumidifier is attached to) to go off at below 55% and back on at over 60%:
Different attempts:
’
1)
Code:
rule “Entfeuchter”
when
Item C_HomeCinema_Humidity changed
then
if (C_HomeCinema_Humidity >= 60)
{C_HomeCinema_Socket1.sendCommand(on)}
else
if (C_HomeCinema_Humidity <= 58)
{C_HomeCinema_Socket1.sendCommand(off)}
end
Code:
rule “Entfeuchter”
when
Channel “zwave:device:36288293:node6:sensor_relhumidity” changed
then
if (C_HomeCinema_Humidity >= 60)
{C_HomeCinema_Socket1.sendCommand(ON)}
else
if (C_HomeCinema_Humidity <= 58)
{C_HomeCinema_Socket1.sendCommand(OFF)}
end
Code:
rule “Entfeuchter”
when
Channel “zwave:device:36288293:node6:sensor_relhumidity” triggered
then
if (C_HomeCinema_Humidity >= 60)
{C_HomeCinema_Socket1.sendCommand(ON)}
else
if (C_HomeCinema_Humidity <= 58)
{C_HomeCinema_Socket1.sendCommand(OFF)}
end
Code:
rule “Entfeuchter”
when
Channel “zwave:device:36288293:node6:sensor_relhumidity” triggered
then
if (Channel “zwave:device:36288293:node6:sensor_relhumidity” >= 60)
{C_HomeCinema_Socket1.sendCommand(ON)}
else
if (Channel “zwave:device:36288293:node6:sensor_relhumidity” <= 58)
{C_HomeCinema_Socket1.sendCommand(OFF)}
end
Das sind die beiden Items, die ich anspreche:
Code:
Switch C_HomeCinema_Socket1 “Steckdose” (C_HomeCinema, gPower) [“Switch”, “Switchable”] {channel=“zwave:device:36288293:node2:switch_binary”}
und
Code:
Number C_HomeCinema_Humidity “Luftfeuchtigkeit” (C_HomeCinema, gHumidity) ’
Where is my lathe in my mind? What am I doing wrong?
Thanks and regards,
Torsten