diff options
author | makefu <github@syntax-fehler.de> | 2022-01-30 23:51:32 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2022-01-30 23:51:32 +0100 |
commit | a312677a5822216459fcf7d7b17bbd4c84b51266 (patch) | |
tree | c5977340db496cb6ff866a8e229debf1bd6be4f0 /2configs/home/ham/automation/check-in.nix | |
parent | 509ff10d8512f02540b23fb0dd617ea46032b833 (diff) |
ma ham: commit open changes
Diffstat (limited to '2configs/home/ham/automation/check-in.nix')
-rw-r--r-- | 2configs/home/ham/automation/check-in.nix | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/2configs/home/ham/automation/check-in.nix b/2configs/home/ham/automation/check-in.nix new file mode 100644 index 000000000..21040b409 --- /dev/null +++ b/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!"); + } + ]; + } + ]; + } + ]; +} |