balkon: zamiana sterowania lampkami z sonoffa na shelly

This commit is contained in:
2019-11-21 19:02:01 +01:00
parent 0830553a71
commit 8e051fd17c
3 changed files with 32 additions and 10 deletions

View File

@@ -15,7 +15,7 @@ sonoff01
sonoff02 - lampka stół
sonoff03 - łazienka wiatrak
sonoff04 -
sonoff05 - lampki balkonowe
sonoff05 -
sonoff06 - przedpokój touch przy drzwiach
sonoff07 - wc wiatrak
d1mini01 - okap
@@ -24,6 +24,7 @@ d1mini03 - prototyp / pilot na kanapie
d1mini04 - odświeżacz
d1mini05 - wskazówka interneu
d1mini06 - schodowy przy salonie
shelly01 - oświetlenie balkonu
*/
/* moc sygnalu */
@@ -50,9 +51,8 @@ Number wSONOFF03 "Wifi s03 wiatrak [%d dB]" <wifi> (wifi) { mqtt="<[motherqtt:/s
Switch rSONOFF03 "Conn s03 [%s]" { mqtt="<[motherqtt:/sonoff03/status:state:MAP(espeasy_lwt.map)]" }
/* lampki balkonowe */
Switch sSONOFF05 "Lampki balkonowe" <whites> { mqtt=">[motherqtt:/sonoff05/gpio/12:command:ON:1],>[motherqtt:/sonoff05/gpio/12:command:OFF:0]" }
Number wSONOFF05 "Wifi s05 balkon [%d dB]" <wifi> (wifi) { mqtt="<[motherqtt:/sonoff05/sysinfo/wifi:state:default]" }
Switch sSONOFF05 "sonoff5" <whites> { mqtt=">[motherqtt:/sonoff05/gpio/12:command:ON:1],>[motherqtt:/sonoff05/gpio/12:command:OFF:0]" }
Number wSONOFF05 "Wifi s05 [%d dB]" <wifi> (wifi) { mqtt="<[motherqtt:/sonoff05/sysinfo/wifi:state:default]" }
Switch rSONOFF05 "Conn s05 [%s]" { mqtt="<[motherqtt:/sonoff05/lwt:state:MAP(espeasy_lwt.map)]" }
/* przedpokój - sonoff przy drzwiach wejściowych */
@@ -79,7 +79,7 @@ Switch rSONOFF07 "Conn s07 [%s]" { mqtt="<[motherqtt:/sonoff07/lwt:state:MAP(esp
relay 2 gpio5
*/
Switch sSONOFF08a "Sypialnia cottonballs" <whites> { mqtt=">[motherqtt:/sonoff08/gpio/12:command:ON:1],>[motherqtt:/sonoff08/gpio/12:command:OFF:0]" }
Switch sSONOFF08b "Sypialnia lampeczki" <whites> { mqtt=">[motherqtt:/sonoff08/gpio/5:command:ON:1],>[motherqtt:/sonoff08/gpio/5:command:OFF:0]" }
Switch sSONOFF08b "Sypialnia nawilżacz" <whites> { 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 dual [%d dB]" <wifi> (wifi) { mqtt="<[motherqtt:/sonoff08/sysinfo/wifi:state:default]" }
Switch rSONOFF08 "Conn s08 [%s]" { mqtt="<[motherqtt:/sonoff08/lwt:state:MAP(espeasy_lwt.map)]" }
@@ -146,3 +146,12 @@ Switch sD1MINI06LED "Przedpokój LED" <whites> { mqtt=">[motherqtt:/d1mini06/gpi
Switch sD1MINI06KEY "Włącznik hall przy salonie [%s]" { mqtt="<[motherqtt:/d1mini06/salon/switch:state:MAP(espeasy_onoff.map)]" } /* GPIO14 */
Number wD1MINI06 "Wifi d1m06 przedpokój [%d dB]" <wifi> (wifi) { mqtt="<[motherqtt:/d1mini06/wifi/:state:default]" }
Switch rD1MINI06 "Conn d1m06 [%s]" { mqtt="<[motherqtt:/d1mini06/lwt:state:MAP(espeasy_lwt.map)]" }
/* lampki balkonowe */
Switch sSHELLY01 "Lampki balkonowe" <whites> { mqtt=">[motherqtt:/shelly01/gpio/4:command:ON:1],>[motherqtt:/shelly01/gpio/4:command:OFF:0]" }
/*Switch sSHELLY01KEY "Włącznik hall przy drzwiach wejściowych [%s]" { mqtt="<[motherqtt:/shelly01/gpio/5:state:MAP(espeasy_onoff.map)]" }*/
Number wSHELLY01 "Wifi sh01 balkon [%d dB]" <wifi> (wifi) { mqtt="<[motherqtt:/shelly01/wifi/:state:default]" }
Switch rSHELLY01 "Conn sh01 [%s]" { mqtt="<[motherqtt:/shelly01/lwt:state:MAP(espeasy_lwt.map)]" }

View File

@@ -7,7 +7,7 @@ then
sSONOFF02.sendCommand(ON)
/* balkon */
sSONOFF05.sendCommand(OFF)
sSHELLY01.sendCommand(ON)
end
@@ -19,7 +19,7 @@ then
sSONOFF02.sendCommand(OFF)
/* balkon */
sSONOFF05.sendCommand(OFF)
sSHELLY01.sendCommand(OFF)
end
@@ -33,7 +33,7 @@ then
sD1MINI01_lampki_sufitowe.sendCommand(ON)
/* balkon */
sSONOFF05.sendCommand(ON)
sSHELLY01.sendCommand(ON)
end
/* HOLIDAY */
@@ -100,6 +100,7 @@ then
dSONOFF02LED.sendCommand(0)
end
rule "Zgaś stółlampkę, sufitowe i nablatowe wieczorem"
when
Time cron "0 15 22 * * ?"
@@ -113,7 +114,19 @@ then
sD1MINI02MOS.sendCommand(OFF)
/* balkon */
sSONOFF05.sendCommand(OFF)
sSHELLY01.sendCommand(OFF)
end
/* na wypadek rebootów sonoffa */
rule "Synchronizuj balkon & lampka po restarcie"
when
Item rSHELLY01 changed to ON or
Item rSONOFF02 changed to ON
then
logInfo("S02,SH01", "Reappeared, applying state balkon {}, lampka {}", sSHELLY01.state, sSONOFF02.state)
sSONOFF02.sendCommand(sSONOFF02.state.toString)
sSHELLY01.sendCommand(sSHELLY01.state.toString)
end
/*

View File

@@ -20,7 +20,7 @@ sitemap pbrk label="Domek"
Switch item=sD1MINI01_lampki_sufitowe
Switch item=sSONOFF01
Switch item=sSONOFF06
Switch item=sSONOFF05
Switch item=sSHELLY01
}