kuchnia: wprowadzenie wirtualnego stanu dla okapu

Normalne sterowanie okapem jest realizowane dimmerem (0-100%).
Wirtualny stan jest po to, żeby się sceny dobrze mapowały i do współpracy
HomeHabit.
This commit is contained in:
root
2018-12-02 18:34:50 +01:00
parent b4edfb2e43
commit 678699a1cd
5 changed files with 37 additions and 2 deletions

View File

@@ -12,6 +12,32 @@ example of switch https://community.openhab.org/t/examples-of-scenes/16411/5
*/
rule "Ustaw predkosc okapu z vOkap"
when
Item vOKAP_speed received command
then
logInfo("vOKAP", "got command {}", vOKAP_speed.state)
if (vOKAP_speed.state == 0) {
dOKAP_speed.sendCommand(0)
} else if (vOKAP_speed.state == 1) {
dOKAP_speed.sendCommand(30)
} else if (vOKAP_speed.state == 2) {
dOKAP_speed.sendCommand(60)
} else if (vOKAP_speed.state == 3) {
dOKAP_speed.sendCommand(100)
}
end
/* wyłączanie światła przed zmianą prędkości - tymczasowo,
póki nie zdebaguje czemu włączone światło blokuje sterowanie */
/* update - informacja o zmianie stanu
command - wymuszenie zmiany stanu (np. klikniecie w interfejsie) */
rule "Ustaw prędkość okapu"
when
Item dOKAP_speed received update
@@ -20,23 +46,27 @@ then
sD1MINI01_bieg1.sendCommand(OFF)
sD1MINI01_bieg2.sendCommand(OFF)
sD1MINI01_bieg3.sendCommand(OFF)
vOKAP_speed.postUpdate(0)
} else if (dOKAP_speed.state <= 32) {
/* od 1% do 32% -> bieg 1 */
sD1MINI01_bieg1.sendCommand(ON)
sD1MINI01_bieg2.sendCommand(OFF)
sD1MINI01_bieg3.sendCommand(OFF)
vOKAP_speed.postUpdate(1)
} else if (dOKAP_speed.state <= 66) {
/* 33% do 66% -> bieg 2 */
sD1MINI01_bieg1.sendCommand(OFF)
sD1MINI01_bieg2.sendCommand(ON)
sD1MINI01_bieg3.sendCommand(OFF)
vOKAP_speed.postUpdate(2)
} else {
/* powyzej 66% -> bieg max */
sD1MINI01_bieg1.sendCommand(OFF)
sD1MINI01_bieg2.sendCommand(OFF)
sD1MINI01_bieg3.sendCommand(ON)
vOKAP_speed.postUpdate(3)
}
end

View File

@@ -18,7 +18,7 @@ when
Time cron "0 50 05 * * ?" or
Time cron "0 20 15 ? * MON-FRI" or
Time cron "0 10/20 15-21 ? * MON-FRI" or
Time cron "0 0,20,40 8-22 ? * SAT,SUN"
Time cron "0 0,20,40 8-21 ? * SAT,SUN"
then
sD1MINI04_refresh.sendCommand(ON)
end