summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/automation
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2022-01-30 23:51:32 +0100
committermakefu <github@syntax-fehler.de>2022-01-30 23:51:32 +0100
commit965a6c96c3b7216bf8ca1b985f8bece6c73213c4 (patch)
tree546b554bb339859a2fb182d4b9df8c21db5fc085 /makefu/2configs/home/ham/automation
parenta721b7ad9b605dc90fa731b2f9a176f2238dc82f (diff)
ma ham: commit open changes
Diffstat (limited to 'makefu/2configs/home/ham/automation')
-rw-r--r--makefu/2configs/home/ham/automation/check-in.nix62
-rw-r--r--makefu/2configs/home/ham/automation/flurlicht.nix31
-rw-r--r--makefu/2configs/home/ham/automation/shutdown_button.nix48
-rw-r--r--makefu/2configs/home/ham/automation/urlaub.nix8
-rw-r--r--makefu/2configs/home/ham/automation/wohnzimmer_rf_fernbedienung.nix2
5 files changed, 141 insertions, 10 deletions
diff --git a/makefu/2configs/home/ham/automation/check-in.nix b/makefu/2configs/home/ham/automation/check-in.nix
new file mode 100644
index 00000000..21040b40
--- /dev/null
+++ b/makefu/2configs/home/ham/automation/check-in.nix
@@ -0,0 +1,62 @@
+let
+ button = "binary_sensor.arbeitszimmer_onebutton_button";
+ light = "light.arbeitszimmer_onebutton_led";
+ at_work = "input_boolean.felix_at_work";
+ lib = import ../lib;
+ say = lib.say.living_room;
+in
+{
+ services.home-assistant.config.input_boolean.felix_at_work.name = "Felix auf Arbeit";
+ services.home-assistant.config.automation =
+ [
+ { alias = "Push Check-in Button Felix with button";
+ trigger = [
+ {
+ platform = "state";
+ entity_id = button;
+ to = "on";
+ for.seconds = 1;
+ }
+ ];
+ condition = [
+ ];
+ action =
+ [
+ { choose = [
+ {
+ conditions = {
+ condition = "state";
+ entity_id = at_work;
+ state = "off";
+ };
+ sequence = [
+ { service = "light.turn_on";
+ target.entity_id = light;
+ data.brightness = 200;
+ }
+ { service = "homeassistant.turn_on";
+ entity_id = at_work;
+ }
+ ] ++ (say "Willkommen auf Arbeit");
+ }
+ {
+ conditions = {
+ condition = "state";
+ entity_id = at_work;
+ state = "on";
+ };
+ sequence = [
+ { service = "light.turn_off";
+ target.entity_id = light;
+ }
+ { service = "homeassistant.turn_off";
+ entity_id = at_work;
+ }
+ ] ++ (say "Endlich ist Pappa fertig mit arbeit!");
+ }
+ ];
+ }
+ ];
+ }
+ ];
+}
diff --git a/makefu/2configs/home/ham/automation/flurlicht.nix b/makefu/2configs/home/ham/automation/flurlicht.nix
index d4002254..c26f7e3e 100644
--- a/makefu/2configs/home/ham/automation/flurlicht.nix
+++ b/makefu/2configs/home/ham/automation/flurlicht.nix
@@ -1,5 +1,7 @@
let
- licht = "light.flur_statuslight";
+ licht = [ "light.flur_statuslight" "light.wohnzimmer_status_led" ];
+ kehrwoche_color = [ 204 0 255 ]; # pink
+ nachtlicht_color = [ 255 190 0 ]; # ein dunkles rot
in
{
services.home-assistant.config.automation =
@@ -16,22 +18,39 @@ in
target.entity_id = licht;
data = {
brightness = 87;
- rgbw_color = [ 255 190 0 0 ]; # ein dunkles rot
+ rgb_color = nachtlicht_color;
#effect = "None";
};
}
];
}
- { alias = "Nachtlicht in Flur aus";
+ { alias = "Nachtlicht in Flur aus, Kehrwoche an";
trigger = {
platform = "sun";
event = "sunrise";
};
action =
[
- {
- service = "light.turn_off";
- entity_id = licht;
+ { choose = [
+ {
+ conditions = {
+ condition = "state";
+ entity_id = "calendar.kehrwoche_kehrwoche";
+ state = "on";
+ };
+ sequence = {
+ service = "light.turn_on";
+ target.entity_id = licht;
+ data = {
+ brightness = 190;
+ rgb_color = kehrwoche_color; # pink
+ };
+ };
+ }];
+ default = {
+ service = "light.turn_off";
+ entity_id = licht;
+ };
}
];
}
diff --git a/makefu/2configs/home/ham/automation/shutdown_button.nix b/makefu/2configs/home/ham/automation/shutdown_button.nix
new file mode 100644
index 00000000..4c12be27
--- /dev/null
+++ b/makefu/2configs/home/ham/automation/shutdown_button.nix
@@ -0,0 +1,48 @@
+let
+ btn = "sensor.arbeitszimmer_btn1_action";
+ all_lights = [
+ # Wohnzimmer
+ "light.wled"
+ "light.wled_2"
+ "light.wohnzimmer_komode_osram"
+ "light.wohnzimmer_schrank_osram"
+ "light.wohnzimmer_fenster_lichterkette_licht"
+
+ # Arbeitszimmer
+ "light.wled_3"
+ "light.wled_4"
+ "light.arbeitszimmer_schrank_dimmer"
+ "light.arbeitszimmer_pflanzenlicht"
+ "light.wohnzimmer_stehlampe_osram"
+
+ # Keller
+ "light.keller_osram"
+ ];
+ all_media_player = [
+ "media_player.living_room"
+ "media_player.office"
+ ];
+in {
+ services.home-assistant.config.automation =
+ [
+ { alias = "Wohnung shutdown single click";
+ trigger = [
+ {
+ platform = "state";
+ entity_id = btn;
+ to = "on";
+ }
+ ];
+ condition = [ ];
+ action = [
+ {
+ service = "home_assistant.turn_off";
+ target.entity_id = all_lights;
+ }
+ { service = "media_player.media_stop";
+ target.entity_id = all_media_player;
+ }
+ ];
+ }
+ ];
+}
diff --git a/makefu/2configs/home/ham/automation/urlaub.nix b/makefu/2configs/home/ham/automation/urlaub.nix
index a6b9be96..50294514 100644
--- a/makefu/2configs/home/ham/automation/urlaub.nix
+++ b/makefu/2configs/home/ham/automation/urlaub.nix
@@ -5,8 +5,9 @@
let
schranklicht = "light.wohnzimmer_schrank_osram";
- fernsehlicht = "light.wohnzimmer_fernseher_led_strip";
- final_off = "01:00";
+ weihnachtslicht = "light.wohnzimmer_fenster_lichterkette_licht";
+ fernsehlicht = "light.wled";
+ final_off = "00:37";
turn_on = entity_id: at:
{ alias = "Turn on ${entity_id} at ${at}";
@@ -25,6 +26,7 @@ in
automation =
[
(turn_on schranklicht "17:30")
+ (turn_on weihnachtslicht "17:30")
(turn_on fernsehlicht "19:00")
{ alias = "Always turn off the urlaub lights at ${final_off}";
@@ -35,7 +37,7 @@ in
[
{
service = "light.turn_off";
- entity_id = [ schranklicht fernsehlicht ];
+ entity_id = [ schranklicht weihnachtslicht fernsehlicht ];
}
];
}
diff --git a/makefu/2configs/home/ham/automation/wohnzimmer_rf_fernbedienung.nix b/makefu/2configs/home/ham/automation/wohnzimmer_rf_fernbedienung.nix
index 31d9b163..b67dacb1 100644
--- a/makefu/2configs/home/ham/automation/wohnzimmer_rf_fernbedienung.nix
+++ b/makefu/2configs/home/ham/automation/wohnzimmer_rf_fernbedienung.nix
@@ -135,7 +135,7 @@ in
data.entity_id = [
"light.wohnzimmer_fernseher_led_strip" "light.wohnzimmer_stehlampe_osram"
"light.wohnzimmer_komode_osram" "light.wohnzimmer_schrank_osram"
- "light.wohnzimmer_fenster_lichterkette_licht" "light.wohnzimmer_fernsehwand_led"
+ "light.wohnzimmer_fenster_lichterkette_licht" "light.wled"
];
};
})