kanapa: zmiana sonoffa basic na dual

Do drugiego gniazdka podłączona lampka po prawej, która
odbija się w ekranie.
Przestawienie zielonego przycisku prototypu do przełączania
tylko prawej lampki, nie obu.

Przy okazji też zmiana w konfiguracji ha-bridge, żeby Echo dobrze
gasiło.
This commit is contained in:
2021-04-10 15:23:23 +02:00
parent f1994418ba
commit 2b93151b6d
7 changed files with 46 additions and 10 deletions

View File

@@ -18,6 +18,8 @@ sonoff04 -
sonoff05 - lampki sufitowe
sonoff06 - przedpokój touch przy drzwiach
sonoff07 - wc wiatrak
sonoff08 - dual sypialnia
sonoff09 - dual kanapowe
d1mini01 - okap
d1mini02 - blat ledki
d1mini03 - prototyp / pilot na kanapie
@@ -85,6 +87,18 @@ Switch sSONOFF08_ext "Sypialnia przycisk" { mqtt="<[motherqtt:/sonoff08/button/e
Number wSONOFF08 "Wifi s08 sypialnia [%d dB]" <wifi> (wifi) { mqtt="<[motherqtt:/sonoff08/sysinfo/wifi:state:default]" }
Switch rSONOFF08 "Conn s08 sypialnia [%s]" { mqtt="<[motherqtt:/sonoff08/lwt:state:MAP(espeasy_lwt.map)]" }
/* MQTT chwilowo ma problemy jakies */
/*Switch sSONOFF09a "Kanapa Asia" <whites> { mqtt=">[motherqtt:/sonoff09/gpio/12:command:ON:1],>[motherqtt:/sonoff09/gpio/12:command:OFF:0]" }
Switch sSONOFF09b "Kanapa Tomek" <whites> { mqtt=">[motherqtt:/sonoff09/gpio/5:command:ON:1],>[motherqtt:/sonoff09/gpio/5:command:OFF:0]" }
*/
Switch sSONOFF09a "Kanapa Asia" <whites> { http=">[ON:GET:http://sonoff09.pipebreaker.pl/?cmd=GPIO,12,1] >[OFF:GET:http://sonoff09.pipebreaker.pl/?cmd=GPIO,12,0]" }
Switch sSONOFF09b "Kanapa Tomek" <whites> { http=">[ON:GET:http://sonoff09.pipebreaker.pl/?cmd=GPIO,5,1] >[OFF:GET:http://sonoff09.pipebreaker.pl/?cmd=GPIO,5,0]" }
Switch sSONOFF09b_expected "Kanapa Tomek spodziewana"
Switch sSONOFF09_ext "Kanapa przycisk" { mqtt="<[motherqtt:/sonoff09/button/ext:state:MAP(espeasy_onoff.map)]" }
Number wSONOFF09 "Wifi s09 kanapa [%d dB]" <wifi> (wifi) { mqtt="<[motherqtt:/sonoff09/sysinfo/wifi:state:default]" }
Switch rSONOFF09 "Conn s09 kanapa [%s]" { mqtt="<[motherqtt:/sonoff09/lwt:state:MAP(espeasy_lwt.map)]" }
/* d1mini w okapie */
Dimmer dOKAP_speed <fan>
Number vOKAP_speed <fan> /* wirtualny przelacznik na potrzeby HomeHabit */

View File

@@ -3,10 +3,10 @@ rule "d1m03 przełączaj zielone"
when
Item sD1MINI03_button_green received update
then
if (sSONOFF01.state == ON) {
sSONOFF01.sendCommand(OFF)
if (sSONOFF09b.state == ON) {
sSONOFF09b.sendCommand(OFF)
} else {
sSONOFF01.sendCommand(ON)
sSONOFF09b.sendCommand(ON)
}
end
@@ -36,11 +36,11 @@ end
rule "d1mini03 synchronizuj kolorki"
when
Item sSONOFF01 received update or
Item sSONOFF09b received update or
Item Mpd_quodlibet_StartStop received update or
Item sSONOFF02 received update
then
sD1MINI03_light_green.sendCommand(sSONOFF01.state.toString())
sD1MINI03_light_green.sendCommand(sSONOFF09b.state.toString())
sD1MINI03_light_yellow.sendCommand(Mpd_quodlibet_StartStop.state.toString())

View File

@@ -0,0 +1,9 @@
/* Lampki kanapowe po stronie Asi działają jako master */
rule "Synchronizuj prawe kanapowe z lewymi"
when
Item sSONOFF09a received update
then
sSONOFF09b.send_update(sSONOFF09a.state)
end

View File

@@ -4,7 +4,10 @@ rule "Gramy!"
when
Item Kodi_State changed to Play
then
/* cottonballs */
sOWFS01.sendCommand(OFF)
/* prawe kanapowe */
sSONOFF09b.sendCommand(OFF)
Mpd_quodlibet_StartStop_expected.postUpdate(Mpd_quodlibet_StartStop.state)
Mpd_quodlibet_StartStop.sendCommand(OFF)
@@ -24,6 +27,7 @@ then
/* ponizsze generuje w linijce z ifem: The name '<XFeatureCallImplCustom> == <XFeatureCallImplCustom>' cannot be resolved to an item or type.
var OnOffType preQL = Mpd_quodlibet_StartStop_expected.state */
var preQL = Mpd_quodlibet_StartStop_expected.state.toString()
var preCL = sSONOFF09b_expected.state.toString() /* prawe couchlight */
logInfo("niegramy", "Restore QL to {}", preQL)
/* Mpd_quodlibet_StartStop.sendCommand(preQL.toString())*/
@@ -44,6 +48,11 @@ then
sendCommand(sOWFS01, ON)
}
logInfo("niegramy", "Restore Right Couchlights to {}", preCL)
if (preCL = "ON") {
sSONOFF09b.sendCommand(ON)
}
sBCacheWriteback.sendCommand(OFF)
end

View File

@@ -48,10 +48,10 @@ then
if (wClouds.state > 90.0) {
logInfo("stollampka", "Powyżej 90% chmur, zapalam")
sSONOFF02.sendCommand(ON)
/* sSONOFF02.sendCommand(ON) */
sSONOFF02_expected.postUpdate(ON)
sSONOFF01.sendCommand(ON)
sSONOFF09a.sendCommand(ON)
}
end
@@ -88,10 +88,11 @@ then
dSONOFF02LED.sendCommand(1023)
Thread::sleep(500)
sSONOFF02.sendCommand(ON)
/* sSONOFF02.sendCommand(ON) */
sSONOFF02_expected.postUpdate(ON)
sSONOFF01.sendCommand(ON)
sSONOFF09a.sendCommand(ON)
end

View File

@@ -10,7 +10,8 @@ sitemap pbrk label="Domek"
Switch item=sOWFS02
Switch item=sSONOFF02
Switch item=sSONOFF05
Switch item=sSONOFF01
Switch item=sSONOFF09a
Switch item=sSONOFF09b
Switch item=sSONOFF06
Switch item=sSHELLY01
}

View File

@@ -16,6 +16,7 @@ sitemap pbrk label="Szczegóły techniczne"
Switch item=rSONOFF06
Switch item=rSONOFF07
Switch item=rSONOFF08
Switch item=rSONOFF09
Switch item=rD1MINI01
Switch item=rD1MINI02
Switch item=rD1MINI03
@@ -31,6 +32,7 @@ sitemap pbrk label="Szczegóły techniczne"
Frame label="Spodziewane stany (automatyka)" {
Switch item=Mpd_quodlibet_StartStop_expected
Switch item=sOWFS01_expected
Switch item=sSONOFF09b_expected
/* Switch item=sSONOFF02_expected */
}