Files
openhab/rules/kuchnia.okap.rules

43 lines
949 B
Plaintext
Raw Normal View History

2018-07-01 21:48:20 +02:00
/*
example of switch https://community.openhab.org/t/examples-of-scenes/16411/5
*/
/*
Ustawienia wynikające ze scen:
0="OFF", 30="Bieg 1", 60="Bieg 2", 100="Bieg max"]
Ustawienia wynikające z Alexy:
procenty od 0 do 100
2018-07-01 21:48:20 +02:00
*/
rule "Ustaw prędkość okapu"
when
Item dOKAP_speed received update
2018-07-01 21:48:20 +02:00
then
if (dOKAP_speed.state == 0) {
sD1MINI01_bieg1.sendCommand(OFF)
sD1MINI01_bieg2.sendCommand(OFF)
sD1MINI01_bieg3.sendCommand(OFF)
} else if (dOKAP_speed.state <= 32) {
/* od 1% do 32% -> bieg 1 */
sD1MINI01_bieg1.sendCommand(ON)
sD1MINI01_bieg2.sendCommand(OFF)
sD1MINI01_bieg3.sendCommand(OFF)
} else if (dOKAP_speed.state <= 66) {
/* 33% do 66% -> bieg 2 */
sD1MINI01_bieg1.sendCommand(OFF)
sD1MINI01_bieg2.sendCommand(ON)
sD1MINI01_bieg3.sendCommand(OFF)
} else {
/* powyzej 66% -> bieg max */
sD1MINI01_bieg1.sendCommand(OFF)
sD1MINI01_bieg2.sendCommand(OFF)
sD1MINI01_bieg3.sendCommand(ON)
2018-07-01 21:48:20 +02:00
}
end