diff --git a/items/wifi.items b/items/wifi.items index 1189824..a40b15c 100644 --- a/items/wifi.items +++ b/items/wifi.items @@ -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) { 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" { mqtt=">[motherqtt:/sonoff09/gpio/12:command:ON:1],>[motherqtt:/sonoff09/gpio/12:command:OFF:0]" } +Switch sSONOFF09b "Kanapa Tomek" { mqtt=">[motherqtt:/sonoff09/gpio/5:command:ON:1],>[motherqtt:/sonoff09/gpio/5:command:OFF:0]" } +*/ +Switch sSONOFF09a "Kanapa Asia" { 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" { 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) { 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 Number vOKAP_speed /* wirtualny przelacznik na potrzeby HomeHabit */ diff --git a/rules/d1mini03.prototyp.rules b/rules/d1mini03.prototyp.rules index 5794872..2554f32 100644 --- a/rules/d1mini03.prototyp.rules +++ b/rules/d1mini03.prototyp.rules @@ -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()) diff --git a/rules/salon.kanapowe.rules b/rules/salon.kanapowe.rules new file mode 100644 index 0000000..f14d062 --- /dev/null +++ b/rules/salon.kanapowe.rules @@ -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 + diff --git a/rules/salon.kodi.rules b/rules/salon.kodi.rules index e3e9330..c652f9c 100644 --- a/rules/salon.kodi.rules +++ b/rules/salon.kodi.rules @@ -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 ' == ' 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 diff --git a/rules/salon.lampka-stolowa.rules b/rules/salon.lampka-stolowa.rules index 42b21e1..7d97688 100644 --- a/rules/salon.lampka-stolowa.rules +++ b/rules/salon.lampka-stolowa.rules @@ -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 diff --git a/sitemaps/default.sitemap b/sitemaps/default.sitemap index 82a23e8..723a719 100644 --- a/sitemaps/default.sitemap +++ b/sitemaps/default.sitemap @@ -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 } diff --git a/sitemaps/tech.sitemap b/sitemaps/tech.sitemap index cb407d9..7136f0e 100644 --- a/sitemaps/tech.sitemap +++ b/sitemaps/tech.sitemap @@ -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 */ }