diff options
Diffstat (limited to 'krebs/2configs/shack/glados')
-rw-r--r-- | krebs/2configs/shack/glados/automation/party-time.nix | 29 | ||||
-rw-r--r-- | krebs/2configs/shack/glados/default.nix | 16 | ||||
-rw-r--r-- | krebs/2configs/shack/glados/multi/schlechte_luft.nix | 37 | ||||
-rw-r--r-- | krebs/2configs/shack/glados/multi/wasser.nix | 13 |
4 files changed, 60 insertions, 35 deletions
diff --git a/krebs/2configs/shack/glados/automation/party-time.nix b/krebs/2configs/shack/glados/automation/party-time.nix new file mode 100644 index 000000000..dfa42d05c --- /dev/null +++ b/krebs/2configs/shack/glados/automation/party-time.nix @@ -0,0 +1,29 @@ +# Needs: +# sun.sunset +# switch.lounge_diskoschalter_relay +let + glados = import ../lib; + disko_schalter = "switch.lounge_diskoschalter_relay"; + player = "media_player.lounge"; +in +[ + { alias = "Party um 21 Uhr"; + trigger = { + platform = "sun"; + event = "sunset"; + }; + action = + ( glados.say.kiosk "Die Sonne geht unter. Und jetzt geht die Party im shack erst richtig los. Partybeleuchtung, aktiviert!" ) + ++ + [ + { + service = "homeassistant.turn_on"; + entity_id = disko_schalter; + } + { + service = "media_player.turn_on"; + data.entity_id = player; + } # TODO: also start playlist if nothing is running? + ]; + } +] diff --git a/krebs/2configs/shack/glados/default.nix b/krebs/2configs/shack/glados/default.nix index b6bcc8673..9bf90bca4 100644 --- a/krebs/2configs/shack/glados/default.nix +++ b/krebs/2configs/shack/glados/default.nix @@ -29,8 +29,7 @@ in { }; in { enable = true; - package = (pkgs.home-assistant.overrideAttrs (old: { - # TODO: find correct python package + package = (pkgs.home-assistant.overrideAttrs (old: { # TODO: find correct python package installCheckPhase = '' echo LOLLLLLLLLLLLLLL ''; @@ -70,6 +69,8 @@ in { # source = "hass"; # }; #}; + esphome = {}; + api = {}; mqtt = { broker = "localhost"; port = 1883; @@ -130,11 +131,9 @@ in { trusted_proxies = "127.0.0.1"; }; #conversation = {}; - history = {}; + # history = {}; #logbook = {}; - logger = { - default = "info"; - }; + logger.default = "info"; #recorder = {}; tts = [ { platform = "google_translate"; @@ -143,16 +142,13 @@ in { cache = true; time_memory = 57600; } - { platform = "picotts"; - language = "de-DE"; - service_name = "pico"; - } ]; sun = {}; automation = wasser.automation ++ badair.automation ++ (import ./automation/shack-startup.nix) + ++ (import ./automation/party-time.nix) ++ (import ./automation/hass-restart.nix); device_tracker = []; diff --git a/krebs/2configs/shack/glados/multi/schlechte_luft.nix b/krebs/2configs/shack/glados/multi/schlechte_luft.nix index 529454a41..31373d7b9 100644 --- a/krebs/2configs/shack/glados/multi/schlechte_luft.nix +++ b/krebs/2configs/shack/glados/multi/schlechte_luft.nix @@ -1,5 +1,7 @@ let glados = import ../lib; + feinstaub_sensor = "sensor.fablab_particulate_matter_2_5um_concentration"; + ledring = "light.fablab_led_ring"; in { automation = @@ -8,15 +10,15 @@ in trigger = [ { platform = "numeric_state"; - below = 25; - entity_id = "sensor.fablab_feinstaub_2_5um"; + entity_id = feinstaub_sensor; + below = 3; } ]; action = [ { service = "light.turn_on"; data = { - entity_id = "light.fablab_led"; + entity_id = ledring; effect = "Twinkle"; color_name = "green"; }; @@ -25,23 +27,18 @@ in } { alias = "mäßige Luft Fablab"; trigger = [ - #{ - # platform = "numeric_state"; - # above = 25; - # entity_id = "sensor.fablab_feinstaub_25m"; - #} { platform = "numeric_state"; - above = 25; - below = 50; - entity_id = "sensor.fablab_feinstaub_2_5um"; + above = 3; + below = 10; + entity_id = feinstaub_sensor; } ]; action = [ { service = "light.turn_on"; data = { - entity_id = "light.fablab_led"; + entity_id = ledring; effect = "Twinkle"; color_name = "yellow"; }; @@ -52,16 +49,16 @@ in trigger = [ { platform = "numeric_state"; - above = 50; - entity_id = "sensor.fablab_feinstaub_2_5um"; + above = 10; + entity_id = feinstaub_sensor; } ]; action = [ { service = "light.turn_on"; data = { - entity_id = "light.fablab_led"; - effect = "Twinkle"; + entity_id = ledring; + effect = "Fireworks"; color_name = "red"; }; } @@ -72,14 +69,14 @@ in { platform = "state"; to = "unavailable"; - entity_id = "sensor.fablab_feinstaub_2_5um"; + entity_id = feinstaub_sensor; } ]; action = [ { service = "light.turn_on"; data = { - entity_id = "light.fablab_led"; + entity_id = ledring; effect = "Rainbow"; color_name = "blue"; }; @@ -91,14 +88,14 @@ in { platform = "state"; from = "unavailable"; - entity_id = "light.fablab_led"; + entity_id = ledring; } ]; action = [ { service = "light.turn_on"; data = { - entity_id = "light.fablab_led"; + entity_id = ledring; effect = "Rainbow"; color_name = "orange"; }; diff --git a/krebs/2configs/shack/glados/multi/wasser.nix b/krebs/2configs/shack/glados/multi/wasser.nix index cdfe01405..0a7ffc41c 100644 --- a/krebs/2configs/shack/glados/multi/wasser.nix +++ b/krebs/2configs/shack/glados/multi/wasser.nix @@ -1,6 +1,9 @@ +# uses: +# switch.crafting_giesskanne_relay let glados = import ../lib; - seconds = 20; + seconds = 5; + wasser = "switch.crafting_giesskanne_relay"; in { switch = [ @@ -22,14 +25,14 @@ in { service = "homeassistant.turn_on"; entity_id = [ - "switch.wasser" + wasser ]; } { delay.seconds = seconds; } { service = "homeassistant.turn_off"; entity_id = [ - "switch.wasser" + wasser ]; } ]; @@ -38,7 +41,7 @@ in trigger = [ { platform = "state"; - entity_id = "switch.wasser"; + entity_id = wasser; to = "on"; for.seconds = seconds*2; } @@ -47,7 +50,7 @@ in [ { service = "homeassistant.turn_off"; - entity_id = [ "switch.wasser" ]; + entity_id = [ wasser ]; } ]; } |