summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2020-03-23 10:15:42 +0100
committerlassulus <lassulus@lassul.us>2020-03-23 10:15:42 +0100
commit8c27f12f86096f06e56333125eb6c713aece34ed (patch)
tree83d29ab23719468ff6e8d31f29963dd449edbef2
parentcab3be8a19d445d3292454099dbc1ca97bca60c5 (diff)
parent8e3cd9fcffc473706a3ebafa5cb80f7a75c29aa5 (diff)
Merge remote-tracking branch 'gum/master'
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--krebs/0tests/data/secrets/hass/darksky.apikey1
-rw-r--r--krebs/2configs/shack/glados/automation/hass-restart.nix3
-rw-r--r--krebs/2configs/shack/glados/automation/shack-startup.nix82
-rw-r--r--krebs/2configs/shack/glados/default.nix47
-rw-r--r--krebs/2configs/shack/glados/lib/default.nix119
-rw-r--r--krebs/2configs/shack/glados/multi/rollos.nix13
-rw-r--r--krebs/2configs/shack/glados/multi/schlechte_luft.nix14
-rw-r--r--krebs/2configs/shack/glados/sensors/darksky.nix21
-rw-r--r--krebs/2configs/shack/glados/sensors/hass.nix5
-rw-r--r--krebs/2configs/shack/glados/sensors/mate.nix16
-rw-r--r--krebs/2configs/shack/glados/sensors/power.nix7
-rw-r--r--krebs/2configs/shack/glados/sensors/sensemap.nix6
-rw-r--r--krebs/2configs/shack/glados/sensors/spaceapi.nix52
-rw-r--r--krebs/2configs/shack/glados/sensors/unifi.nix6
-rw-r--r--krebs/2configs/shack/glados/switch/power.nix32
-rw-r--r--krebs/2configs/shack/muellshack.nix5
-rw-r--r--krebs/2configs/shack/node-light.nix6
-rw-r--r--krebs/3modules/makefu/default.nix11
-rw-r--r--krebs/3modules/makefu/sshd/omo.pub2
-rw-r--r--makefu/1systems/gum/config.nix18
-rw-r--r--makefu/1systems/omo/config.nix40
-rw-r--r--makefu/1systems/omo/hw/omo.nix11
-rw-r--r--makefu/1systems/omo/source.nix1
-rw-r--r--makefu/1systems/x/config.nix4
-rw-r--r--makefu/2configs/bureautomation/automation/daily-news.nix20
-rw-r--r--makefu/2configs/bureautomation/automation/quotes.nix4
-rw-r--r--makefu/2configs/bureautomation/automation/schlechteluft.nix3
-rw-r--r--makefu/2configs/bureautomation/camera/stuttgart.nix26
-rw-r--r--makefu/2configs/bureautomation/default.nix21
-rw-r--r--makefu/2configs/bureautomation/deps/aresponses.nix38
-rw-r--r--makefu/2configs/bureautomation/multi/10h_timers.nix59
-rw-r--r--makefu/2configs/bureautomation/multi/daily-standup.nix4
-rw-r--r--makefu/2configs/bureautomation/multi/frosch.nix6
-rw-r--r--makefu/2configs/bureautomation/multi/mittagessen.nix6
-rw-r--r--makefu/2configs/bureautomation/person/team.nix19
-rw-r--r--makefu/2configs/bureautomation/puppy-proxy.nix5
-rw-r--r--makefu/2configs/bureautomation/script/multi_blink.nix12
-rw-r--r--makefu/2configs/bureautomation/stream/puppies.nix4
-rw-r--r--makefu/2configs/default.nix5
-rw-r--r--makefu/2configs/deployment/board.euer.krebsco.de.nix15
-rw-r--r--makefu/2configs/deployment/docker/archiveteam-warrior.nix39
-rw-r--r--makefu/2configs/deployment/gecloudpad/default.nix43
-rw-r--r--makefu/2configs/deployment/gecloudpad/gecloudpad.nix24
-rw-r--r--makefu/2configs/deployment/rss.euer.krebsco.de.nix14
-rw-r--r--makefu/2configs/ham/androidtv/adbshell.nix38
-rw-r--r--makefu/2configs/ham/androidtv/default.nix30
-rw-r--r--makefu/2configs/ham/androidtv/purepythonadb.nix21
-rw-r--r--makefu/2configs/ham/automation/firetv_restart.nix33
-rw-r--r--makefu/2configs/ham/default.nix152
-rw-r--r--makefu/2configs/ham/google-muell.nix (renamed from makefu/2configs/homeautomation/google-muell.nix)0
-rw-r--r--makefu/2configs/ham/lib/default.nix44
-rw-r--r--makefu/2configs/ham/mqtt.nix (renamed from makefu/2configs/homeautomation/mqtt.nix)0
-rw-r--r--makefu/2configs/ham/multi/flurlicht.nix57
-rw-r--r--makefu/2configs/ham/multi/kurzzeitwecker.nix132
-rw-r--r--makefu/2configs/ham/multi/zigbee2mqtt.nix129
-rw-r--r--makefu/2configs/ham/sensor/outside.nix20
-rw-r--r--makefu/2configs/ham/zigbee2mqtt/default.nix20
-rw-r--r--makefu/2configs/home-manager/mail.nix18
-rw-r--r--makefu/2configs/home-manager/zsh.nix61
-rw-r--r--makefu/2configs/homeautomation/default.nix305
-rw-r--r--makefu/2configs/hw/bluetooth.nix6
-rw-r--r--makefu/2configs/hw/cc2531.nix10
-rw-r--r--makefu/2configs/main-laptop.nix9
-rw-r--r--makefu/2configs/minimal.nix6
-rw-r--r--makefu/2configs/mqtt.nix2
-rw-r--r--makefu/2configs/nginx/rompr.nix1
-rw-r--r--makefu/2configs/nur.nix6
-rw-r--r--makefu/2configs/sickbeard/cheetah3.nix25
-rw-r--r--makefu/2configs/sickbeard/debug.patch91
-rw-r--r--makefu/2configs/sickbeard/sickgear.nix14
-rw-r--r--makefu/2configs/stats/arafetch.nix4
-rw-r--r--makefu/2configs/stats/external/aralast.nix5
-rw-r--r--makefu/2configs/tools/extra-gui.nix1
-rw-r--r--makefu/2configs/tools/mobility.nix3
-rw-r--r--makefu/2configs/tools/studio.nix2
-rw-r--r--makefu/5pkgs/cc-tool/default.nix32
-rw-r--r--makefu/5pkgs/custom/hydra-check/default.nix19
-rw-r--r--makefu/5pkgs/custom/liveproxy/default.nix30
-rw-r--r--makefu/5pkgs/default.nix2
-rw-r--r--makefu/5pkgs/libcoap/default.nix27
-rw-r--r--makefu/5pkgs/pico2wave/default.nix51
-rw-r--r--makefu/5pkgs/studio-link/default.nix21
-rw-r--r--makefu/krops.nix8
84 files changed, 1634 insertions, 692 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3ff991aa4..4a7a4e605 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -8,7 +8,7 @@ before_script:
# prepare git fetching of secrets
- echo "$gitlab_deploy_privkey" > ~/.ssh/gitlab_deploy.key
- chmod 600 ~/.ssh/gitlab_deploy.key
- - ssh-keyscan -H 'ssh.git.shackspace.de' >> ~/.ssh/known_hosts
+ - echo "$ssh_git_shackspace_serverkey" >> ~/.ssh/known_hosts
# import secret key for secrets
- echo "$secrets_gpg_key" | gpg --import
deployment test:
diff --git a/krebs/0tests/data/secrets/hass/darksky.apikey b/krebs/0tests/data/secrets/hass/darksky.apikey
new file mode 100644
index 000000000..4932cd639
--- /dev/null
+++ b/krebs/0tests/data/secrets/hass/darksky.apikey
@@ -0,0 +1 @@
+LOL
diff --git a/krebs/2configs/shack/glados/automation/hass-restart.nix b/krebs/2configs/shack/glados/automation/hass-restart.nix
index e87354978..1b380204d 100644
--- a/krebs/2configs/shack/glados/automation/hass-restart.nix
+++ b/krebs/2configs/shack/glados/automation/hass-restart.nix
@@ -6,12 +6,13 @@
platform = "homeassistant";
event = "start";
};
+ # trigger good/bad air
action = [
{ service = "light.turn_on";
data = {
entity_id = "light.fablab_led";
effect = "Rainbow";
- color_name = "yellow";
+ color_name = "purple";
};
}
];
diff --git a/krebs/2configs/shack/glados/automation/shack-startup.nix b/krebs/2configs/shack/glados/automation/shack-startup.nix
new file mode 100644
index 000000000..35314923b
--- /dev/null
+++ b/krebs/2configs/shack/glados/automation/shack-startup.nix
@@ -0,0 +1,82 @@
+# needs:
+# binary_sensor.portal_lock
+# sensor.keyholder
+# media_player.lounge
+let
+ glados = import ../lib;
+in
+[
+ {
+ alias = "Greet new keyholder for key exchange";
+ initial_state = true;
+ trigger = {
+ platform = "state";
+ entity_id = "sensor.keyholder";
+ };
+ condition = {
+ condition = "template";
+ value_template = "{{ trigger.from_state.state != 'No Keyholder' }}";
+ };
+ action = glados.say.kiosk "Danke {{trigger.to_state.state}} für das Übernehmen des Keys von {{trigger.from_state.state}}";
+ # action = [];
+ }
+
+ {
+ alias = "Start Music on portal lock on";
+ # TODO: use "power" trigger
+ trigger = {
+ platform = "state";
+ entity_id = "binary_sensor.portal_lock";
+ to = "on";
+ for.seconds = 30;
+ };
+ condition = {
+ condition = "and";
+ conditions =
+ [
+ { # only start if a keyholder opened the door and if the lounge mpd is currently not playing anything
+ condition = "template";
+ value_template = "{{ state('sensor.keyholder') != 'No Keyholder' }}";
+ }
+ {
+ condition = "state";
+ entity_id = "media_player.lounge";
+ state = "idle";
+ }
+ ];
+ };
+ action = [
+ {
+ service = "media_player.volume_set";
+ data = {
+ entity_id = "media_player.lounge";
+ volume_level = 1.0;
+ };
+ }
+ {
+ service = "media_player.play_media";
+ data = {
+ entity_id = "media_player.lounge";
+ media_content_type = "playlist";
+ media_content_id = "ansage";
+ };
+ }
+ { delay.seconds = 8; }
+ {
+ service = "media_player.volume_set";
+ data = {
+ entity_id = "media_player.lounge";
+ volume_level = 0.6;
+ };
+ }
+ {
+ service = "media_player.play_media";
+ data = {
+ entity_id = "media_player.lounge";
+ media_content_type = "playlist";
+ media_content_id = "lassulus superradio";
+ };
+ }
+ ];
+ }
+]
diff --git a/krebs/2configs/shack/glados/default.nix b/krebs/2configs/shack/glados/default.nix
index e48a54551..920f2ed2f 100644
--- a/krebs/2configs/shack/glados/default.nix
+++ b/krebs/2configs/shack/glados/default.nix
@@ -39,7 +39,7 @@ in {
'';
})).override {
extraPackages = ps: with ps; [
- python-forecastio jsonrpc-async jsonrpc-websocket mpd2
+ python-forecastio jsonrpc-async jsonrpc-websocket mpd2 pkgs.picotts
];
};
autoExtraComponents = true;
@@ -76,6 +76,8 @@ in {
client_id = "home-assistant";
keepalive = 60;
protocol = 3.1;
+ discovery = true; #enable esphome discovery
+ discovery_prefix = "homeassistant";
birth_message = {
topic = "glados/hass/status/LWT";
payload = "Online";
@@ -89,21 +91,34 @@ in {
retain = true;
};
};
- switch = wasser.switch;
- light = badair.light;
+ switch =
+ wasser.switch
+ ++ (import ./switch/power.nix)
+ ;
+ light = [];
media_player = [
{ platform = "mpd";
+ name = "lounge";
host = "lounge.mpd.shack";
}
+ { platform = "mpd";
+ name = "kiosk";
+ host = "lounge.kiosk.shack";
+ }
];
sensor =
- (import ./sensors/hass.nix)
- ++ (import ./sensors/power.nix)
+ (import ./sensors/power.nix)
+ ++ (import ./sensors/mate.nix)
+ ++ (import ./sensors/darksky.nix { inherit lib;})
++ shackopen.sensor
- ++ badair.sensor;
+ ;
+ air_quality = (import ./sensors/sensemap.nix );
- binary_sensor = shackopen.binary_sensor;
+ binary_sensor =
+ shackopen.binary_sensor
+ ++ (import ./sensors/spaceapi.nix)
+ ;
camera = [];
@@ -117,19 +132,27 @@ in {
#conversation = {};
history = {};
logbook = {};
+ logger = {
+ default = "info";
+ };
recorder = {};
tts = [
{ platform = "google_translate";
+ service_name = "say";
language = "de";
+ cache = true;
+ time_memory = 57600;
+ }
+ { platform = "picotts";
+ language = "de-DE";
+ service_name = "pico";
}
- #{ platform = "picotts";
- # language = "de-DE";
- #}
];
sun = {};
- automation = wasser.automation
- ++ badair.automation
+ automation = wasser.automation
+ ++ badair.automation
+ ++ (import ./automation/shack-startup.nix)
++ (import ./automation/hass-restart.nix);
device_tracker = [];
diff --git a/krebs/2configs/shack/glados/lib/default.nix b/krebs/2configs/shack/glados/lib/default.nix
index 6737af842..6d2b7749b 100644
--- a/krebs/2configs/shack/glados/lib/default.nix
+++ b/krebs/2configs/shack/glados/lib/default.nix
@@ -2,89 +2,48 @@ let
prefix = "glados";
in
{
- esphome =
+
+ say = let
+ # returns a list of actions to be performed on an mpd to say something
+ tts = { message, entity }:
+ [
+ {
+ service = "media_player.turn_on";
+ data.entity_id = "media_player.${entity}";
+ }
+ { service = "media_player.play_media";
+ data = {
+ entity_id = "media_player.${entity}";
+ media_content_type = "playlist";
+ media_content_id = "ansage";
+ };
+ }
+ {
+ service = "media_player.turn_on";
+ data.entity_id = "media_player.${entity}";
+ }
+ { delay.seconds = 8; }
+ { service = "tts.say";
+ entity_id = "media_player.${entity}";
+ data_template = {
+ inherit message;
+ language = "de";
+ };
+ }
+ ];
+ in
{
- temp = {host, topic ? "temperature" }:
- {
- platform = "mqtt";
- name = "${host} Temperature";
- device_class = "temperature";
- unit_of_measurement = "°C";
- icon = "mdi:thermometer";
- state_topic = "${prefix}/${host}/sensor/${topic}/state";
- availability_topic = "${prefix}/${host}/status";
- payload_available = "online";
- payload_not_available = "offline";
- };
- hum = {host, topic ? "humidity" }:
- {
- platform = "mqtt";
- unit_of_measurement = "%";
- icon = "mdi:water-percent";
- device_class = "humidity";
- name = "${host} Humidity";
- state_topic = "${prefix}/${host}/sensor/${topic}/state";
- availability_topic = "${prefix}/${host}/status";
- payload_available = "online";
- payload_not_available = "offline";
+ lounge = message: tts {
+ inherit message;
+ entity = "lounge";
};
- # copied from "homeassistant/light/fablab_led/led_ring/config"
- led = {host, topic ? "led", name ? host}:
- { # name: fablab_led
- # topic: led_ring
- platform = "mqtt";
- inherit name;
- schema = "json";
- brightness = true;
- rgb = true;
- effect = true;
- effect_list = [ # TODO: may be different
- "Random"
- "Strobe"
- "Rainbow"
- "Color Wipe"
- "Scan"
- "Twinkle"
- "Fireworks"
- "Addressable Flicker"
- "None"
- ];
- state_topic = "${prefix}/${host}/light/${topic}/state";
- command_topic = "${prefix}/${host}/light/${topic}/command";
- availability_topic = "${prefix}/${host}/status";
- payload_available = "online";
- payload_not_available = "offline";
- qos = 1;
+ herrenklo = message: tts {
+ inherit message;
+ entity = "herrenklo";
};
- # Feinstaub
- dust_25m = { host, name ? "${host} < 2.5µm", topic ? "particulate_matter_25m_concentration" }:
- {
- platform = "mqtt";
- unit_of_measurement = "µg/m³";
- icon = "mdi:chemical-weapon";
- inherit name;
- state_topic = "${prefix}/${host}/sensor/${topic}/state";
- availability_topic = "${prefix}/${host}/status";
- };
- dust_100m = {host, name ? "${host} < 10µm", topic ? "particulate_matter_100m_concentration" }:
- {
- platform = "mqtt";
- unit_of_measurement = "µg/m³";
- icon = "mdi:chemical-weapon";
- inherit name;
- state_topic = "${prefix}/${host}/sensor/${topic}/state";
- availability_topic = "${prefix}/${host}/status";
- };
- switch = {host, name ? "${host} Button", topic ? "btn" }:
- # host: ampel
- # name: Button 1
- # topic: btn1
- {
- inherit name;
- platform = "mqtt";
- state_topic = "${prefix}/${host}/sensor/${topic}/state";
- command_topic = "${prefix}/${host}/switch/${topic}/state";
- availability_topic = "${prefix}/${host}/status";
+ kiosk = message: tts {
+ inherit message;
+ entity = "kiosk";
};
};
tasmota =
diff --git a/krebs/2configs/shack/glados/multi/rollos.nix b/krebs/2configs/shack/glados/multi/rollos.nix
new file mode 100644
index 000000000..1febad525
--- /dev/null
+++ b/krebs/2configs/shack/glados/multi/rollos.nix
@@ -0,0 +1,13 @@
+let
+ glados = import ../lib;
+in
+{
+ # LED
+ light = [