From c36fea7e2d1f1da89351341d44b8f27e8edf3e6d Mon Sep 17 00:00:00 2001 From: Tomasz Torcz Date: Wed, 3 Dec 2025 09:56:13 +0100 Subject: [PATCH] =?UTF-8?q?dobranoc:=20obej=C5=9Bcie=20nie=20dzia=C5=82aj?= =?UTF-8?q?=C4=85cej=20chwilowo=20aleksy,=20wy=C5=82=C4=85czanie=20wszystk?= =?UTF-8?q?iego?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- items/virtual.items | 4 ++++ rules/salon.dobranoc.rules | 43 ++++++++++++++++++++++++++++++++++++++ sitemaps/default.sitemap | 1 + 3 files changed, 48 insertions(+) create mode 100644 rules/salon.dobranoc.rules diff --git a/items/virtual.items b/items/virtual.items index e0dd70b..0d78041 100644 --- a/items/virtual.items +++ b/items/virtual.items @@ -5,3 +5,7 @@ Switch sHolidayVacancy "Jesteśmy poza domem" /* target przełączają bcache (writeback/writethrough), amdgpu (auto/low), cpu governor (schedutil, powersave) */ Switch sHighPerformance "Komputer w trybie wydajnym" { exec=">[ON:systemctl start power-balance.target] >[OFF:systemctl start power-conserve.target]" } +Switch sGoodnight "Dobranoc" { + expire="4s,command=OFF" +} + diff --git a/rules/salon.dobranoc.rules b/rules/salon.dobranoc.rules new file mode 100644 index 0000000..15b98a5 --- /dev/null +++ b/rules/salon.dobranoc.rules @@ -0,0 +1,43 @@ + +rule "Dobranoc" +when + Item sGoodnight received update ON +then + /* quodlibet */ + Mpd_quodlibet_StartStop.sendCommand(OFF) + Mpd_quodlibet_StartStop_expected.sendCommand(OFF) + + /* balkon */ + sSHELLY01.sendCommand(OFF) + + Thread::sleep(300) + + /* sufitowe */ + sSONOFF05.sendCommand(OFF) + + Thread::sleep(300) + + /* lampki pod tv */ + sOWFS01.sendCommand(OFF) + sOWFS01_expected.postUpdate(OFF) + + Thread::sleep(300) + + /* kanapowe */ + sSONOFF09a.sendCommand(OFF) + sSONOFF09b.sendCommand(OFF) + + Thread::sleep(300) + + /* blat */ + sD1MINI02MOS.sendCommand(OFF) + + /* nad stołem */ + sSHELLY02.sendCommand(OFF) + sSHELLY02_expected.sendCommand(OFF) + + Thread::sleep(300) + + /* przedpokój */ + sSONOFF06.sendCommand(OFF) +end diff --git a/sitemaps/default.sitemap b/sitemaps/default.sitemap index 0e9f9bd..b09fa11 100644 --- a/sitemaps/default.sitemap +++ b/sitemaps/default.sitemap @@ -2,6 +2,7 @@ sitemap pbrk label="Domek" { Frame { Text item=dtSunset_Time + Switch item=sGoodnight }