From 73a79886d64119dee0983a498ba6d9ca230a49a2 Mon Sep 17 00:00:00 2001 From: Tomasz Torcz Date: Wed, 3 Nov 2021 20:10:34 +0100 Subject: [PATCH] =?UTF-8?q?sypialnia:=20rozdzielenie=20o=C5=9Bwietlenia=20?= =?UTF-8?q?okna=20na=20dwa=20gniazdka?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- items/wifi.items | 2 +- rules/sypialnia.dual.rules | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/items/wifi.items b/items/wifi.items index 1bbb658..93f63b4 100644 --- a/items/wifi.items +++ b/items/wifi.items @@ -82,7 +82,7 @@ Switch rSONOFF07 "Conn s07 wiatrak wc [%s]" { mqtt="<[motherqtt:/sonoff07/lwt:st relay 2 gpio5 */ Switch sSONOFF08a "Sypialnia cottonballs" { mqtt=">[motherqtt:/sonoff08/gpio/12:command:ON:1],>[motherqtt:/sonoff08/gpio/12:command:OFF:0]" } -Switch sSONOFF08b "Sypialnia nawilżacz" { mqtt=">[motherqtt:/sonoff08/gpio/5:command:ON:1],>[motherqtt:/sonoff08/gpio/5:command:OFF:0]" } +Switch sSONOFF08b "Sypialnia gwiazdki" { mqtt=">[motherqtt:/sonoff08/gpio/5:command:ON:1],>[motherqtt:/sonoff08/gpio/5:command:OFF:0]" } Switch sSONOFF08_ext "Sypialnia przycisk" { mqtt="<[motherqtt:/sonoff08/button/ext:state:MAP(espeasy_onoff.map)]" } Number wSONOFF08 "Wifi s08 sypialnia [%d dB]" (wifi) { mqtt="<[motherqtt:/sonoff08/sysinfo/wifi:state:default]" } Switch rSONOFF08 "Conn s08 sypialnia [%s]" { mqtt="<[motherqtt:/sonoff08/lwt:state:MAP(espeasy_lwt.map)]" } diff --git a/rules/sypialnia.dual.rules b/rules/sypialnia.dual.rules index a892b4c..90bb135 100644 --- a/rules/sypialnia.dual.rules +++ b/rules/sypialnia.dual.rules @@ -29,11 +29,20 @@ when Item sSunset_Event received update ON then sSONOFF08a.sendCommand(ON) + sSONOFF08b.sendCommand(ON) end -rule "Zgaś lampki w sypialni wieczorem" +rule "Zgaś gwiazdki w sypialni wieczorem" when Time cron "0 00 22 * * ?" +then + sSONOFF08b.sendCommand(OFF) +end + +rule "Zgaś cottonballs w sypialni wieczorem" +when + Time cron "0 18 22 * * ?" then sSONOFF08a.sendCommand(OFF) end +