summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs/home')
-rw-r--r--makefu/2configs/home/ham/automation/check-in.nix88
-rw-r--r--makefu/2configs/home/ham/automation/fenster_auf.nix91
-rw-r--r--makefu/2configs/home/ham/automation/firetv_restart.nix37
-rw-r--r--makefu/2configs/home/ham/automation/flurlicht.nix59
-rw-r--r--makefu/2configs/home/ham/automation/giesskanne.nix99
-rw-r--r--makefu/2configs/home/ham/automation/ladestecker_timer.nix24
-rw-r--r--makefu/2configs/home/ham/automation/lichter_dimmen.nix135
-rw-r--r--makefu/2configs/home/ham/automation/light_buttons.nix53
-rw-r--r--makefu/2configs/home/ham/automation/moodlight.nix46
-rw-r--r--makefu/2configs/home/ham/automation/pflanzen_giessen_erinnerung.nix43
-rw-r--r--makefu/2configs/home/ham/automation/shutdown_button.nix48
-rw-r--r--makefu/2configs/home/ham/automation/urlaub.nix60
-rw-r--r--makefu/2configs/home/ham/automation/wohnzimmer_rf_fernbedienung.nix151
-rw-r--r--makefu/2configs/home/ham/calendar/nextcloud.nix41
-rw-r--r--makefu/2configs/home/ham/default.nix177
-rw-r--r--makefu/2configs/home/ham/deps/dwdwfsapi.nix38
-rw-r--r--makefu/2configs/home/ham/deps/pykodi.nix37
-rw-r--r--makefu/2configs/home/ham/device_tracker/openwrt.nix13
-rw-r--r--makefu/2configs/home/ham/device_tracker/tile.nix10
-rw-r--r--makefu/2configs/home/ham/lib/cheat-sheet.nix42
-rw-r--r--makefu/2configs/home/ham/lib/default.nix134
-rw-r--r--makefu/2configs/home/ham/light/arbeitszimmer.nix33
-rw-r--r--makefu/2configs/home/ham/light/schlafzimmer.nix14
-rw-r--r--makefu/2configs/home/ham/light/tint_arbeitszimmer.nix281
-rw-r--r--makefu/2configs/home/ham/light/tint_wohnzimmer.nix298
-rw-r--r--makefu/2configs/home/ham/light/wohnzimmer.nix31
-rw-r--r--makefu/2configs/home/ham/media/firetv.nix32
-rw-r--r--makefu/2configs/home/ham/media/remote_sound_arbeitszimmer.nix107
-rw-r--r--makefu/2configs/home/ham/media/remote_sound_wohnzimmer.nix107
-rw-r--r--makefu/2configs/home/ham/media/sonos.nix8
-rw-r--r--makefu/2configs/home/ham/mqtt.nix31
-rw-r--r--makefu/2configs/home/ham/multi/fliegen-couter.nix71
-rw-r--r--makefu/2configs/home/ham/multi/flurlicht.nix57
-rw-r--r--makefu/2configs/home/ham/multi/kurzzeitwecker.nix136
-rw-r--r--makefu/2configs/home/ham/multi/the_playlist.nix86
-rw-r--r--makefu/2configs/home/ham/nginx.nix15
-rw-r--r--makefu/2configs/home/ham/person/default.nix20
-rw-r--r--makefu/2configs/home/ham/sensor/outside.nix25
-rw-r--r--makefu/2configs/home/ham/signal-rest/default.nix6
-rw-r--r--makefu/2configs/home/ham/signal-rest/hass.nix20
-rw-r--r--makefu/2configs/home/ham/signal-rest/pkg.nix25
-rw-r--r--makefu/2configs/home/ham/signal-rest/service.nix18
-rw-r--r--makefu/2configs/home/ham/tts/google.nix18
-rw-r--r--makefu/2configs/home/ham/zigbee2mqtt.nix130
-rw-r--r--makefu/2configs/home/jellyfin.nix10
-rw-r--r--makefu/2configs/home/metube.nix38
-rw-r--r--makefu/2configs/home/music.nix31
-rw-r--r--makefu/2configs/home/photoprism.nix147
-rw-r--r--makefu/2configs/home/ps4srv.nix17
-rw-r--r--makefu/2configs/home/tonie.nix68
-rw-r--r--makefu/2configs/home/zigbee2mqtt/default.nix90
-rw-r--r--makefu/2configs/home/zigbee2mqtt/osram.nix14
52 files changed, 0 insertions, 3410 deletions
diff --git a/makefu/2configs/home/ham/automation/check-in.nix b/makefu/2configs/home/ham/automation/check-in.nix
deleted file mode 100644
index d589a697..00000000
--- a/makefu/2configs/home/ham/automation/check-in.nix
+++ /dev/null
@@ -1,88 +0,0 @@
-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.office;
-in
-{
- services.home-assistant.config.input_boolean.felix_at_work.name = "Felix auf Arbeit";
- services.home-assistant.config.script.start_office_radio.sequence =
- [
- { service = "media_player.play_media";
- data = {
- media_content_id = "http://radio.lassul.us:8000/radio.mp3";
- media_content_type = "music";
- };
- target.entity_id = "media_player.office";
- }
- ];
- services.home-assistant.config.automation =
- [
- { service = "media_player.play_media";
- data = {
- media_content_id = "http://radio.lassul.us:8000/radio.mp3";
- media_content_type = "music";
- };
- target.entity_id = "media_player.office";
- }
- { 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") ++
- [
- { service = "media_player.play_media";
- data = {
- media_content_id = "http://radio.lassul.us:8000/radio.mp3";
- media_content_type = "music";
- };
- target.entity_id = "media_player.office";
- }
- ];
- }
- {
- 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/fenster_auf.nix b/makefu/2configs/home/ham/automation/fenster_auf.nix
deleted file mode 100644
index fa2052be..00000000
--- a/makefu/2configs/home/ham/automation/fenster_auf.nix
+++ /dev/null
@@ -1,91 +0,0 @@
-{ lib, ... }:
-#uses:
-# notify.signal
-# binary_sensor.badezimmer_fenster_contact
-# binary_sensor.dusche_fenster_contact
-let
- min = 20;
- fenster_offen = name: entity:
- { alias = "${name} seit ${toString min} Minuten offen";
- trigger = [
- {
- platform = "state";
- entity_id = entity;
- to = "on";
- for.minutes = min;
- }
- ];
- condition = [
- { condition = "state";
- entity_id = "input_boolean.ist_sommer";
- state = "off";
- }
- ];
- action =
- [
- {
- service = "notify.signal_home";
- data_template = {
- message = "${name} seit ${toString min} Minuten offen und draussen ist es gerade {{states.sensor.dark_sky_temperature.state}}°C bei {{states.sensor.dark_sky_humidity.state}}% Luftfeuchte";
- };
- }
- {
- service = "input_boolean.turn_on";
- target.entity_id = "input_boolean.${lib.toLower name}_lang_offen";
- }
- ];
- };
- fenster_geschlossen_lang = name: entity:
- { alias = "${name} wieder geschlossen";
- trigger = [
- {
- platform = "state";
- entity_id = entity;
- to = "off";
- for.seconds = 10;
- }
- ];
- condition = [
- { condition = "state";
- entity_id = "input_boolean.${lib.toLower name}_lang_offen";
- state = "on";
- }
- ];
- action =
- [
- {
- service = "notify.signal_home";
- data = {
- message= "${name} ist wieder geschlossen, Danke!";
- };
- }
- {
- service = "input_boolean.turn_off";
- target.entity_id = "input_boolean.${lib.toLower name}_lang_offen";
- }
- ];
- };
-in {
- services.home-assistant.config = {
- sensor = [
- { platform = "season"; type = "meteorological";}
- ];
-
- input_boolean = {
- badezimmerfenster_lang_offen.name = "Badezimmer lange offen";
- duschfenster_lang_offen.name = "Duschfenster lange offen";
- ist_sommer = {
- name = "Es ist Sommer";
- initial = true; # TODO
- };
- };
-
- automation = [
- (fenster_geschlossen_lang "Badezimmerfenster" "binary_sensor.badezimmer_fenster_contact")
- (fenster_geschlossen_lang "Duschfenster" "binary_sensor.dusche_fenster_contact")
-
- (fenster_offen "Badezimmerfenster" "binary_sensor.badezimmer_fenster_contact")
- (fenster_offen "Duschfenster" "binary_sensor.dusche_fenster_contact")
- ];
- };
-}
diff --git a/makefu/2configs/home/ham/automation/firetv_restart.nix b/makefu/2configs/home/ham/automation/firetv_restart.nix
deleted file mode 100644
index 12e0e845..00000000
--- a/makefu/2configs/home/ham/automation/firetv_restart.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-let
- cmd = command: {
- service = "androidtv.adb_command";
- data = {
- entity_id = "media_player.firetv_stick";
- inherit command;
- };
- };
- sec = seconds: { delay.seconds = seconds; };
-in
-{
- services.home-assistant.config.automation =
- [
- {
- alias = "Nightly reboot of firetv";
- trigger = {
- platform = "time";
- at = "03:00:00";
- };
- action = [
- (cmd "reboot")
- (sec 90) # go to my music because apparently select_source does not seem to always work
- (cmd "HOME")
- (sec 2)
- (cmd "DOWN")
- (sec 2)
- (cmd "DOWN")
- (sec 2)
- (cmd "ENTER")
- (sec 4)
- (cmd "RIGHT")
- (sec 2)
- (cmd "RIGHT")
- ];
- }
- ];
-}
diff --git a/makefu/2configs/home/ham/automation/flurlicht.nix b/makefu/2configs/home/ham/automation/flurlicht.nix
deleted file mode 100644
index aa62ab9e..00000000
--- a/makefu/2configs/home/ham/automation/flurlicht.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-let
- nachtlicht = [ "light.flur_statuslight" "light.wohnzimmer_status_led" ];
-
- # flurlicht an
- lightcond = name: conditions: rgb_color: brightness:
- {
- inherit conditions;
- sequence = {
- service = "light.turn_on";
- target.entity_id = nachtlicht;
- data = {
- inherit rgb_color brightness;
- };
- };
- };
-in
-{
- services.home-assistant.config.automation =
- [
- { alias = "Nachtlicht trigger";
- trigger = [
- { platform = "sun"; event = "sunset"; }
- { platform = "sun"; event = "sunrise"; }
- { platform = "state"; entity_id = [
- "calendar.kehrwoche_kehrwoche"
- "binary_sensor.badezimmer_fenster_contact"
- "binary_sensor.dusche_fenster_contact"
- ];
- }
- ];
- action =
- [
- { choose = [
- (lightcond "Badezimmer Fenster Auf"
- { condition = "state"; entity_id = "binary_sensor.badezimmer_fenster_contact"; state = "on"; }
- [ 64 207 255 ] 255 # helblau
- )
- (lightcond "Duschenster auf"
- { condition = "state"; entity_id = "binary_sensor.dusche_fenster_contact"; state = "on"; }
- [ 64 207 255 ] 255 # helblau
- )
- (lightcond "Nachtlicht"
- { condition = "state"; entity_id = "sun.sun"; state = "below_horizon"; }
- [ 255 190 0 ] 90 # red
- )
- (lightcond "Kehrwoche"
- { condition = "state"; entity_id = "calendar.kehrwoche_kehrwoche"; state = "on"; }
- [ 204 0 255 ] 128 # pink
- )
- ];
- default = {
- service = "light.turn_off";
- entity_id = nachtlicht;
- };
- }
- ];
- }
- ];
-}
diff --git a/makefu/2configs/home/ham/automation/giesskanne.nix b/makefu/2configs/home/ham/automation/giesskanne.nix
deleted file mode 100644
index 400e553e..00000000
--- a/makefu/2configs/home/ham/automation/giesskanne.nix
+++ /dev/null
@@ -1,99 +0,0 @@
-# uses:
-# switch.crafting_giesskanne_relay
-let
- cam = {
- name = "chilicam";
- camera = "camera.espcam_02";
- light = "light.espcam_02_light";
- seconds = 90; # default shutoff to protect the LED from burning out
- };
- seconds = 60*5; # time for giesskanne - 5 minutes
- pump = "switch.arbeitszimmer_giesskanne_relay";
- light = "switch.terrasse_plug_relay";
-
- # sensor = "sensor.statistics_for_sensor_crafting_brotbox_soil_moisture";
-in
-{
- services.home-assistant.config =
- {
- #sensor = map ( entity_id: {
- # platform = "statistics";
- # name = "Statistics for ${entity_id}";
- # inherit entity_id;
- # max_age.minutes = "60";
- # sampling_size = 1000;
- # }) [ "sensor.crafting_brotbox_soil_moisture" ];
-
- automation =
- [
-
- ##### brotbox
- { alias = "Water the plant for ${toString seconds} seconds and turn on the light";
- trigger = [
- { # trigger at 23:15 no matter what
- # TODO: retry or run only if switch.wasser is available
- platform = "sun";
- event = "sunrise";
- }
- ];
- action =
- [
-
- { # now turn on the pumping services
- # i do not start hte pump and light before the snapshot because i do
- # not know how long it takes (do not want to water the plants for too long)
- service = "homeassistant.turn_on";
- entity_id = [ pump light ];
- }
- { delay.seconds = seconds; }
- {
- service = "homeassistant.turn_off";
- entity_id = [ pump cam.light ];
- }
- { # TODO: we could also create a recording with camera.record
- service = "camera.snapshot";
- data = {
- entity_id = cam.camera;
- # TODO: create /var/lib/hass/cam/ - now being done manually
- filename = "/var/lib/hass/cam/${cam.name}_{{ now().strftime('%Y%m%d-%H%M%S') }}.jpg";
- };
- }
- ];
- }
- { alias = "Turn off the light at sunset";
- trigger = [
- {
- platform = "sun";
- event = "sunset";
- # offset = "+02:00:00";
- }
- ];
- action =
- [
- {
- service = "homeassistant.turn_off";
- entity_id = [ light ];
- }
- ];
- }
-
- { alias = "Always turn off water after ${toString (seconds * 2)}s";
- trigger = [
- {
- platform = "state";
- entity_id = pump;
- to = "on";
- for.seconds = seconds*2;
- }
- ];
- action =
- [
- {
- service = "homeassistant.turn_off";
- entity_id = [ pump ];
- }
- ];
- }
- ];
- };
-}
diff --git a/makefu/2configs/home/ham/automation/ladestecker_timer.nix b/makefu/2configs/home/ham/automation/ladestecker_timer.nix
deleted file mode 100644
index 8e877129..00000000
--- a/makefu/2configs/home/ham/automation/ladestecker_timer.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-let
- relay = "switch.terrasse_plug_relay";
- timeout = "300";
-in {
- services.home-assistant.config.automation = [
- { alias = "Always turn off Charging station after ${toString (timeout)}m";
- trigger = [
- {
- platform = "state";
- entity_id = relay;
- to = "on";
- for.minutes = timeout;
- }
- ];
- action =
- [
- {
- service = "homeassistant.turn_off";
- entity_id = [ relay ];
- }
- ];
- }
- ];
-}
diff --git a/makefu/2configs/home/ham/automation/lichter_dimmen.nix b/makefu/2configs/home/ham/automation/lichter_dimmen.nix
deleted file mode 100644
index 4303cdfa..00000000
--- a/makefu/2configs/home/ham/automation/lichter_dimmen.nix
+++ /dev/null
@@ -1,135 +0,0 @@
-# This module maps the RF433 Remote Control to zigbee and wifi lights
-let
- rf_turn_off = code: light:
- {
- alias = "Turn off ${light} via rf code ${code}";
- trigger = {
- platform = "event";
- event_type = "esphome.rf_code_received";
- event_data.code = code;
- };
- action = {
- service = "light.turn_off";
- data.entity_id = light;
- };
- };
- rf_turn_on = code: light:
- {
- alias = "Turn on ${light} via rf code ${code}";
- trigger = {
- platform = "event";
- event_type = "esphome.rf_code_received";
- event_data.code = code;
- };
- action = {
- service = "light.turn_on";
- data.entity_id = light;
- };
- };
- rf_state = code: light: halfbright:
- let
- maxbright = 255;
- transition = 0.2; # seconds
- in
- # this function implements a simple state machine based on the state and brightness of the light (light must support brightness
- {
- alias = "Cycle through states of ${light} via rf code ${code}";
- trigger = {
- platform = "event";
- event_type = "esphome.rf_code_received";
- event_data.code = code;
- };
- action = {
- choose = [
- {
- # state 0: off to half
- conditions = {
- condition = "template";
- value_template = ''{{ states("${light}") == "off" }}'';
- };
- sequence = [
- {
- service = "light.turn_on";
- data = {
- entity_id = light;
- brightness = halfbright;
- };
- }
- ];
- }
- {
- # state 1: half to full
- conditions = {
- condition = "template";
- value_template = ''{{ states('${light}') == 'on' and ( ${toString (halfbright - 1)} <= state_attr("${light}","brightness") <= ${toString (halfbright + 1)})}}'';
- };
- sequence = [
- {
- service = "light.turn_on";
- data = {
- entity_id = light;
- brightness = maxbright;
- };
- }
- ];
- }
- {
- # state 2: full to off
- conditions = {
- condition = "template";
- # TODO: it seems like the devices respond with brightness-1 , maybe off-by-one somewhere?
- value_template = ''{{ states("${light}") == "on" and state_attr("${light}","brightness") >= ${toString (maxbright - 1)}}}'';
- };
- sequence = [
- {
- service = "light.turn_off";
- data = {
- entity_id = light;
- };
- }
- ];
- }
- ];
- # default: on to off
- # this works because state 0 checks for "state == off"
- default = [{
- service = "light.turn_off";
- data = {
- entity_id = light;
- };
- }];
- };
- }
-;
- rf_toggle = code: light:
- {
- alias = "Toggle ${light} via rf code ${code}";
- trigger = {
- platform = "event";
- event_type = "esphome.rf_code_received";
- event_data.code = code;
- };
- action = {
- service = "light.toggle";
- data.entity_id = light;
- };
- };
-in
-{
- services.home-assistant.config.automation = [
- (rf_toggle "400551" "light.wohnzimmer_fernseher_led_strip") # A
- (rf_state "401151" "light.wohnzimmer_stehlampe_osram" 128) # B
- (rf_state "401451" "light.wohnzimmer_komode_osram" 128) # C
- (rf_state "401511" "light.wohnzimmer_schrank_osram" 128) # D
-
- # OFF Lane
- (rf_turn_off "400554" "all") # A
- (rf_toggle "401154" "light.wohnzimmer_fenster_lichterkette_licht") # B
- (rf_toggle "401454" "light.wohnzimmer_fernsehwand_led") # C
- # (rf_toggle "401514" "") # D
- ];
- # "400554" # A OFF
- # "401154" # B OFF
- # "401454" # C OFF
- # "401514" # D OFF
-}
diff --git a/makefu/2configs/home/ham/automation/light_buttons.nix b/makefu/2configs/home/ham/automation/light_buttons.nix
deleted file mode 100644
index 1892917c..00000000
--- a/makefu/2configs/home/ham/automation/light_buttons.nix
+++ /dev/null
@@ -1,53 +0,0 @@
-
-let
- inherit (import ../lib) btn_cycle_light;
-in {
- services.home-assistant.config.automation = [
- # (btn_cycle_light "light.arbeitszimmerbeleuchtung" "arbeitszimmer_btn1")
- (btn_cycle_light "light.schlafzimmer_komode_osram" "schlafzimmer_btn2" 128)
- {
- alias = "toggle keller";
- trigger = {
- platform = "state";
- entity_id = "sensor.keller_btn1_click";
- to = "single";
- };
- action = {
- service = "light.toggle";
- #entity_id = lights;
- data = {
- entity_id = "light.keller_osram";
- brightness = 255;
- };
- };
- }
- {
- alias = "low brightness keller with doubleclick";
- trigger = {
- platform = "state";
- entity_id = "sensor.keller_btn1_click";
- to = "double";
- };
- action = {
- service = "light.toggle";
- data = {
- entity_id = "light.keller_osram";
- brightness = 50;
- };
- };
- }
- # (btn_cycle_light "light.wohnzimmerbeleuchtung" "wohnzimmer_btn3")
- {
- alias = "Turn of all lights via schlafzimmer_btn2 double click";
- trigger = {
- platform = "state";
- entity_id = "sensor.schlafzimmer_btn2_click";
- to = "double";
- };
- action = {
- service = "light.turn_off";
- entity_id = "all";
- };
- }
- ];
-}
diff --git a/makefu/2configs/home/ham/automation/moodlight.nix b/makefu/2configs/home/ham/automation/moodlight.nix
deleted file mode 100644
index d0e33685..00000000
--- a/makefu/2configs/home/ham/automation/moodlight.nix
+++ /dev/null
@@ -1,46 +0,0 @@
-# uses:
-
-let
- wohnzimmer = "light.wohnzimmer_fenster_lichterkette_licht";
- arbeitszimmer = "light.box_led_status";
- final_off = "01:00";
-
- turn_on = entity_id: at: extra:
- { alias = "Turn on ${entity_id} at ${at}";
- trigger = [
- { platform = "time"; inherit at; }
- ];
- action =
- [
- ({ service = "light.turn_on";
- data = {
- inherit entity_id;
-
- } // extra;
- })
- ];
- };
-in
-{
- services.home-assistant.config =
- {
- automation =
- [
- # (turn_on wohnzimmer "17:30")
- (turn_on arbeitszimmer "9:00" { effect = "Slow Random Twinkle";})
-
- { alias = "Always turn off the lights at ${final_off}";
- trigger = [
- { platform = "time"; at = final_off; }
- ];
- action =
- [
- {
- service = "light.turn_off";
- entity_id = [ wohnzimmer arbeitszimmer];
- }
- ];
- }
- ];
- };
-}
diff --git a/makefu/2configs/home/ham/automation/pflanzen_gi