From 4ab5210444e87627b47d215bd3e2f846fee07437 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 15 Mar 2021 21:32:29 +0100 Subject: ma krops: always build fast --- makefu/krops.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/makefu/krops.nix b/makefu/krops.nix index 12c003b24..697039720 100644 --- a/makefu/krops.nix +++ b/makefu/krops.nix @@ -86,6 +86,7 @@ in { # usage: $(nix-build --no-out-link --argstr name HOSTNAME -A deploy) deploy = pkgs.krops.writeDeploy "${name}-deploy" { source = source { test = false; }; + fast = true; target = "root@${target}/var/src"; buildTarget = if target == buildTarget then "root@${target}/var/src" else "root@${buildTarget}/tmp/"; }; -- cgit v1.2.3 From 53351c89441ed7843472b7292949180d491614b1 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 17 Mar 2021 20:02:55 +0100 Subject: ma home: move zigbee2mqtt out of ham --- makefu/1systems/omo/config.nix | 3 +- makefu/2configs/home/ham/zigbee2mqtt/default.nix | 91 ---------------- makefu/2configs/home/ham/zigbee2mqtt/hass.nix | 130 ----------------------- makefu/2configs/home/ham/zigbee2mqtt/osram.nix | 14 --- makefu/2configs/home/zigbee2mqtt/default.nix | 91 ++++++++++++++++ makefu/2configs/home/zigbee2mqtt/hass.nix | 130 +++++++++++++++++++++++ makefu/2configs/home/zigbee2mqtt/osram.nix | 14 +++ 7 files changed, 237 insertions(+), 236 deletions(-) delete mode 100644 makefu/2configs/home/ham/zigbee2mqtt/default.nix delete mode 100644 makefu/2configs/home/ham/zigbee2mqtt/hass.nix delete mode 100644 makefu/2configs/home/ham/zigbee2mqtt/osram.nix create mode 100644 makefu/2configs/home/zigbee2mqtt/default.nix create mode 100644 makefu/2configs/home/zigbee2mqtt/hass.nix create mode 100644 makefu/2configs/home/zigbee2mqtt/osram.nix diff --git a/makefu/1systems/omo/config.nix b/makefu/1systems/omo/config.nix index a04593715..d44980ce7 100644 --- a/makefu/1systems/omo/config.nix +++ b/makefu/1systems/omo/config.nix @@ -93,10 +93,11 @@ in { - + + { makefu.ps3netsrv = { enable = true; diff --git a/makefu/2configs/home/ham/zigbee2mqtt/default.nix b/makefu/2configs/home/ham/zigbee2mqtt/default.nix deleted file mode 100644 index 6ccf8b241..000000000 --- a/makefu/2configs/home/ham/zigbee2mqtt/default.nix +++ /dev/null @@ -1,91 +0,0 @@ -{config, pkgs, lib, ...}: - -let - dataDir = "/var/lib/zigbee2mqtt"; - sec = import ; - internal-ip = "192.168.1.11"; - webport = 8521; -in - { - # symlink the zigbee controller - #services.udev.extraRules = '' - # SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="cc2531", MODE="0660", GROUP="dialout" - #''; - - # /dev/serial/by-id/usb-Silicon_Labs_slae.sh_cc2652rb_stick_-_slaesh_s_iot_stuff_00_12_4B_00_21_CC_45_BD-if00-port0 - services.udev.extraRules = '' - SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="cc2531", MODE="0660", GROUP="dialout" - ''; - - services.zigbee2mqtt = { - enable = true; - inherit dataDir; - config = { - permit_join = true; - serial.port = "/dev/cc2531"; - homeassistant = true; - mqtt = { - server = "mqtt://omo.lan:1883"; - base_topic = "/ham/zigbee"; - user = sec.mqtt.username; - password = sec.mqtt.password; - include_device_information = true; - client_id = "zigbee2mqtt"; - }; - frontend = { - port = webport; - }; - advanced = { - log_level = "debug"; - log_output = [ "console" ]; - last_seen = "ISO_8601"; - elapsed = true; - reporting = true; # TODO test if it is better with groups - pan_id = 6755; - inherit (sec.zigbee) network_key; - }; - map_options.graphviz.colors = { - fill = { - enddevice = "#fff8ce" ; - coordinator = "#e04e5d"; - router = "#4ea3e0"; - }; - font = { - coordinator= "#ffffff"; - router = "#ffffff"; - enddevice = "#000000"; - }; - line = { - active = "#009900"; - inactive = "#994444"; - }; - }; - }; - }; - - services.nginx.recommendedProxySettings = true; - services.nginx.virtualHosts."zigbee" = { - serverAliases = [ "zigbee.lan" ]; - locations."/".proxyPass = "http://localhost:${toString webport}"; - locations."/api".proxyPass = "http://localhost:${toString webport}"; - locations."/api".proxyWebsockets = true; - extraConfig = '' - if ( $server_addr != "${internal-ip}" ) { - return 403; - } - ''; - }; - - state = [ "${dataDir}/devices.yaml" "${dataDir}/state.json" ]; - - systemd.services.zigbee2mqtt = { - # override automatic configuration.yaml deployment - environment.ZIGBEE2MQTT_DATA = dataDir; - #serviceConfig.ExecStartPre = lib.mkForce "${pkgs.coreutils}/bin/true"; - after = [ - "home-assistant.service" - "mosquitto.service" - "network-online.target" - ]; - }; -} diff --git a/makefu/2configs/home/ham/zigbee2mqtt/hass.nix b/makefu/2configs/home/ham/zigbee2mqtt/hass.nix deleted file mode 100644 index faf864ba6..000000000 --- a/makefu/2configs/home/ham/zigbee2mqtt/hass.nix +++ /dev/null @@ -1,130 +0,0 @@ -# provides: -# switch -# automation -# binary_sensor -# sensor -# input_select -# timer -let - inherit (import ../lib) zigbee; - prefix = zigbee.prefix; -in -{ - services.home-assistant.config = { - sensor = - - [ - # Sensor for monitoring the bridge state - { - platform = "mqtt"; - name = "Zigbee2mqtt Bridge state"; - state_topic = "${prefix}/bridge/state"; - icon = "mdi:router-wireless"; - } - # Sensor for Showing the Zigbee2mqtt Version - { - platform = "mqtt"; - name = "Zigbee2mqtt Version"; - state_topic = "${prefix}/bridge/config"; - value_template = "{{ value_json.version }}"; - icon = "mdi:zigbee"; - } - # Sensor for Showing the Coordinator Version - { - platform = "mqtt"; - name = "Coordinator Version"; - state_topic = "${prefix}/bridge/config"; - value_template = "{{ value_json.coordinator }}"; - icon = "mdi:chip"; - } - ]; - switch = [ - { - platform = "mqtt"; - name = "Zigbee2mqtt Main join"; - state_topic = "${prefix}/bridge/config/permit_join"; - command_topic = "${prefix}/bridge/config/permit_join"; - payload_on = "true"; - payload_off = "false"; - } - ]; - automation = [ - { - alias = "Zigbee2mqtt Log Level"; - initial_state = "on"; - trigger = { - platform = "state"; - entity_id = "input_select.zigbee2mqtt_log_level"; - }; - action = [ - { - service = "mqtt.publish"; - data = { - payload_template = "{{ states('input_select.zigbee2mqtt_log_level') }}"; - topic = "${prefix}/bridge/config/log_level"; - }; - } - ]; - } - # Automation to start timer when enable join is turned on - { - id = "zigbee_join_enabled"; - alias = "Zigbee Join Enabled"; - trigger = - { - platform = "state"; - entity_id = "switch.zigbee2mqtt_main_join"; - to = "on"; - }; - action = - { - service = "timer.start"; - entity_id = "timer.zigbee_permit_join"; - }; - } - # # Automation to stop timer when switch turned off and turn off switch when timer finished - { - id = "zigbee_join_disabled"; - alias = "Zigbee Join Disabled"; - trigger = [ - { - platform = "event"; - event_type = "timer.finished"; - event_data.entity_id = "timer.zigbee_permit_join"; - } - { - platform = "state"; - entity_id = "switch.zigbee2mqtt_main_join"; - to = "off"; - } - ]; - action = [ - { service = "timer.cancel"; - data.entity_id = "timer.zigbee_permit_join"; - } - { service = "switch.turn_off"; - entity_id = "switch.zigbee2mqtt_main_join"; - } - ]; - } - ]; - input_select.zigbee2mqtt_log_level = - { - name = "Zigbee2mqtt Log Level"; - options = [ - "debug" - "info" - "warn" - "error" - ]; - initial = "info"; - icon = "mdi:format-list-bulleted"; - }; - - timer.zigbee_permit_join = - { - name = "Zigbee Time remaining"; - duration = 120; - }; - }; -} diff --git a/makefu/2configs/home/ham/zigbee2mqtt/osram.nix b/makefu/2configs/home/ham/zigbee2mqtt/osram.nix deleted file mode 100644 index d1bf2b296..000000000 --- a/makefu/2configs/home/ham/zigbee2mqtt/osram.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - - -availability_topic: /ham/zigbee/bridge/state -command_topic: /ham/zigbee/flur_arbeitszimmer_osram2/set - - - platform: "mqtt" - state_topic: "zigbee2mqtt/" - availability_topic: "zigbee2mqtt/bridge/state" - payload_on: true - payload_off: false - value_template: "{{ value_json.battery_low}}" - device_class: "battery" -} diff --git a/makefu/2configs/home/zigbee2mqtt/default.nix b/makefu/2configs/home/zigbee2mqtt/default.nix new file mode 100644 index 000000000..6ccf8b241 --- /dev/null +++ b/makefu/2configs/home/zigbee2mqtt/default.nix @@ -0,0 +1,91 @@ +{config, pkgs, lib, ...}: + +let + dataDir = "/var/lib/zigbee2mqtt"; + sec = import ; + internal-ip = "192.168.1.11"; + webport = 8521; +in + { + # symlink the zigbee controller + #services.udev.extraRules = '' + # SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="cc2531", MODE="0660", GROUP="dialout" + #''; + + # /dev/serial/by-id/usb-Silicon_Labs_slae.sh_cc2652rb_stick_-_slaesh_s_iot_stuff_00_12_4B_00_21_CC_45_BD-if00-port0 + services.udev.extraRules = '' + SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="cc2531", MODE="0660", GROUP="dialout" + ''; + + services.zigbee2mqtt = { + enable = true; + inherit dataDir; + config = { + permit_join = true; + serial.port = "/dev/cc2531"; + homeassistant = true; + mqtt = { + server = "mqtt://omo.lan:1883"; + base_topic = "/ham/zigbee"; + user = sec.mqtt.username; + password = sec.mqtt.password; + include_device_information = true; + client_id = "zigbee2mqtt"; + }; + frontend = { + port = webport; + }; + advanced = { + log_level = "debug"; + log_output = [ "console" ]; + last_seen = "ISO_8601"; + elapsed = true; + reporting = true; # TODO test if it is better with groups + pan_id = 6755; + inherit (sec.zigbee) network_key; + }; + map_options.graphviz.colors = { + fill = { + enddevice = "#fff8ce" ; + coordinator = "#e04e5d"; + router = "#4ea3e0"; + }; + font = { + coordinator= "#ffffff"; + router = "#ffffff"; + enddevice = "#000000"; + }; + line = { + active = "#009900"; + inactive = "#994444"; + }; + }; + }; + }; + + services.nginx.recommendedProxySettings = true; + services.nginx.virtualHosts."zigbee" = { + serverAliases = [ "zigbee.lan" ]; + locations."/".proxyPass = "http://localhost:${toString webport}"; + locations."/api".proxyPass = "http://localhost:${toString webport}"; + locations."/api".proxyWebsockets = true; + extraConfig = '' + if ( $server_addr != "${internal-ip}" ) { + return 403; + } + ''; + }; + + state = [ "${dataDir}/devices.yaml" "${dataDir}/state.json" ]; + + systemd.services.zigbee2mqtt = { + # override automatic configuration.yaml deployment + environment.ZIGBEE2MQTT_DATA = dataDir; + #serviceConfig.ExecStartPre = lib.mkForce "${pkgs.coreutils}/bin/true"; + after = [ + "home-assistant.service" + "mosquitto.service" + "network-online.target" + ]; + }; +} diff --git a/makefu/2configs/home/zigbee2mqtt/hass.nix b/makefu/2configs/home/zigbee2mqtt/hass.nix new file mode 100644 index 000000000..faf864ba6 --- /dev/null +++ b/makefu/2configs/home/zigbee2mqtt/hass.nix @@ -0,0 +1,130 @@ +# provides: +# switch +# automation +# binary_sensor +# sensor +# input_select +# timer +let + inherit (import ../lib) zigbee; + prefix = zigbee.prefix; +in +{ + services.home-assistant.config = { + sensor = + + [ + # Sensor for monitoring the bridge state + { + platform = "mqtt"; + name = "Zigbee2mqtt Bridge state"; + state_topic = "${prefix}/bridge/state"; + icon = "mdi:router-wireless"; + } + # Sensor for Showing the Zigbee2mqtt Version + { + platform = "mqtt"; + name = "Zigbee2mqtt Version"; + state_topic = "${prefix}/bridge/config"; + value_template = "{{ value_json.version }}"; + icon = "mdi:zigbee"; + } + # Sensor for Showing the Coordinator Version + { + platform = "mqtt"; + name = "Coordinator Version"; + state_topic = "${prefix}/bridge/config"; + value_template = "{{ value_json.coordinator }}"; + icon = "mdi:chip"; + } + ]; + switch = [ + { + platform = "mqtt"; + name = "Zigbee2mqtt Main join"; + state_topic = "${prefix}/bridge/config/permit_join"; + command_topic = "${prefix}/bridge/config/permit_join"; + payload_on = "true"; + payload_off = "false"; + } + ]; + automation = [ + { + alias = "Zigbee2mqtt Log Level"; + initial_state = "on"; + trigger = { + platform = "state"; + entity_id = "input_select.zigbee2mqtt_log_level"; + }; + action = [ + { + service = "mqtt.publish"; + data = { + payload_template = "{{ states('input_select.zigbee2mqtt_log_level') }}"; + topic = "${prefix}/bridge/config/log_level"; + }; + } + ]; + } + # Automation to start timer when enable join is turned on + { + id = "zigbee_join_enabled"; + alias = "Zigbee Join Enabled"; + trigger = + { + platform = "state"; + entity_id = "switch.zigbee2mqtt_main_join"; + to = "on"; + }; + action = + { + service = "timer.start"; + entity_id = "timer.zigbee_permit_join"; + }; + } + # # Automation to stop timer when switch turned off and turn off switch when timer finished + { + id = "zigbee_join_disabled"; + alias = "Zigbee Join Disabled"; + trigger = [ + { + platform = "event"; + event_type = "timer.finished"; + event_data.entity_id = "timer.zigbee_permit_join"; + } + { + platform = "state"; + entity_id = "switch.zigbee2mqtt_main_join"; + to = "off"; + } + ]; + action = [ + { service = "timer.cancel"; + data.entity_id = "timer.zigbee_permit_join"; + } + { service = "switch.turn_off"; + entity_id = "switch.zigbee2mqtt_main_join"; + } + ]; + } + ]; + input_select.zigbee2mqtt_log_level = + { + name = "Zigbee2mqtt Log Level"; + options = [ + "debug" + "info" + "warn" + "error" + ]; + initial = "info"; + icon = "mdi:format-list-bulleted"; + }; + + timer.zigbee_permit_join = + { + name = "Zigbee Time remaining"; + duration = 120; + }; + }; +} diff --git a/makefu/2configs/home/zigbee2mqtt/osram.nix b/makefu/2configs/home/zigbee2mqtt/osram.nix new file mode 100644 index 000000000..d1bf2b296 --- /dev/null +++ b/makefu/2configs/home/zigbee2mqtt/osram.nix @@ -0,0 +1,14 @@ +{ + + +availability_topic: /ham/zigbee/bridge/state +command_topic: /ham/zigbee/flur_arbeitszimmer_osram2/set + + - platform: "mqtt" + state_topic: "zigbee2mqtt/" + availability_topic: "zigbee2mqtt/bridge/state" + payload_on: true + payload_off: false + value_template: "{{ value_json.battery_low}}" + device_class: "battery" +} -- cgit v1.2.3 From 7351675feb9d1fca70d583d0fc6601137ea08a0f Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 17 Mar 2021 20:03:16 +0100 Subject: ma bureautomation: prototype philosophische-tuer --- .../automation/philosophische-tuer.nix | 128 ++++++++++----------- 1 file changed, 59 insertions(+), 69 deletions(-) diff --git a/makefu/2configs/bureautomation/automation/philosophische-tuer.nix b/makefu/2configs/bureautomation/automation/philosophische-tuer.nix index 9ccb81348..8c3fed6de 100644 --- a/makefu/2configs/bureautomation/automation/philosophische-tuer.nix +++ b/makefu/2configs/bureautomation/automation/philosophische-tuer.nix @@ -16,93 +16,83 @@ let sha256 = "0bm0697fyf6s05c6yw6y25cyck04rlxj1dgazkq8mfqk6756v2bq"; }; samples = user: lib.mapAttrsToList - (file: _: ''"${prefix}/${name}/${user}/${file}"'') + (file: _: ''"${prefix}/${user}/${file}"'') (builtins.readDir (toString ( recordrepo+ "/recordings/${user}"))); random_tuerspruch = ''{{'' + (lib.concatStringsSep "," ((samples "Felix") ++ (samples "Sofia") ++ (samples "Markus"))) + ''| random}}''; # TODO read from derivation in { - systemd.tmpfiles.rules = [ - "d ${audiodir} - hass hass - -" - ]; - systemd.services.copy-philosophische-tuersounds = { description = "copy philosophische tuer"; wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "oneshot"; - User = "hass"; - WorkingDirectory = audiodir; ExecStart = pkgs.writeDash "update-samples" '' - cp -vr ${recordrepo} ${audiodir} + rm -rf "${audiodir}" + cp -vr "${recordrepo}/recordings" "${audiodir}" ''; }; }; - - services.home-assistant.config.media_extractor = { }; - services.home-assistant.config.script."philosophische_tuer" = { - alias = "Durchsage der philosophischen Tür"; - sequence = [ - { service = "media_player.play_media"; - data = { - entity_id = "media_player.mpd"; - media_content_type = "playlist"; - media_content_id = "ansage"; + services.home-assistant.config = { + media_extractor = { }; + script."philosophische_tuer" = { + alias = "Durchsage der philosophischen Tür"; + sequence = [ + { service = "media_player.play_media"; + data = { + entity_id = "media_player.mpd"; + media_content_type = "playlist"; + media_content_id = "ansage"; + }; + } + { delay.seconds = 5; } + { service = "media_extractor.play_media"; + entity_id = "media_player.mpd"; + data_template = { + media_content_id = random_tuerspruch; + media_content_type = "MUSIC"; + }; + } + ]; + }; + automation = + [ + { + alias = "Tür offen seit ${toString short_threshold} sekunden"; + trigger = + { platform = "state"; + entity_id = sensor; + to = "on"; + for.seconds = 60; }; + action = [ + { service = "homeassistant.turn_on"; + entity_id = "script.philosophische_tuer"; + } + ]; } - { delay.seconds = 5; } - { service = "media_extractor.play_media"; - entity_id = "media_player.mpd"; - data_template = { - media_content_id = random_tuerspruch; - media_content_type = "MUSIC"; + { + alias = "Tür offen seit ${toString long_threshold} minuten"; + trigger = + { platform = "state"; + entity_id = sensor; + to = "on"; + for.minutes = long_threshold; }; + + action = [ + { service = "homeassistant.turn_on"; + entity_id = "script.philosophische_tuer" ; + } + { service = "tts.google_say"; + entity_id = "media_player.mpd"; + data_template = { + message = "BEEP BOOP - Die Tür ist schon seit ${toString long_threshold} Minuten offen! Student Nummer {{ range(1,500) | random }}, bitte schliesse die Tür"; + language = "de"; + }; + } + ]; } ]; }; - services.home-assistant.config.automation = - [ - { - alias = "Tür offen seit ${toString short_threshold} sekunden"; - trigger = - { platform = "state"; - entity_id = sensor; - to = "on"; - for.seconds = 60; - }; - condition = { }; - action = [ - { service = "homeassistant.turn_on"; - entity_id = [ - "script.philosophische_tuer" - ]; - } - ]; - } - { - alias = "Tür offen seit ${toString long_threshold} minuten"; - trigger = - { platform = "state"; - entity_id = sensor; - to = "on"; - for.minutes = long_threshold; - }; - condition = { }; - - action = [ - { service = "homeassistant.turn_on"; - entity_id = [ - "script.philosophische_tuer" - ]; - } - { service = "tts.google_say"; - entity_id = "media_player.mpd"; - data_template = { - message = "BEEP BOOP - Die Tür ist schon seit ${toString long_threshold} Minuten offen! Student Nummer {{ range(1,500) | random }}, bitte schliesse die Tür"; - language = "de"; - }; - } - ]; - } - ]; } -- cgit v1.2.3 From 4a137b66b5e6f64194c008e2585b97c1c8432d08 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 17 Mar 2021 20:03:53 +0100 Subject: ma wbob.r: disable kalauerbot --- makefu/1systems/wbob/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefu/1systems/wbob/config.nix b/makefu/1systems/wbob/config.nix index b70b48449..f99e493bf 100644 --- a/makefu/1systems/wbob/config.nix +++ b/makefu/1systems/wbob/config.nix @@ -50,7 +50,7 @@ in { # new hass entry point - + # now runs in thales # # #mpd is only used for TTS, this is the web interface -- cgit v1.2.3 From 3c2c66901119ab003f2cab80d0352c0e9f3d4d65 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 17 Mar 2021 20:04:13 +0100 Subject: ma bureautomation: fix runtime issues --- makefu/2configs/bureautomation/default.nix | 133 ++++----------------- .../bureautomation/device_tracker/openwrt.nix | 1 - makefu/2configs/bureautomation/sensor/outside.nix | 13 +- 3 files changed, 28 insertions(+), 119 deletions(-) diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix index 7ac90f5c5..7eb297879 100644 --- a/makefu/2configs/bureautomation/default.nix +++ b/makefu/2configs/bureautomation/default.nix @@ -56,7 +56,11 @@ in { package = (unstable.home-assistant.overrideAttrs (old: { doInstallCheck = false; })).override { - extraPackages = p: [ p.APScheduler ]; + extraPackages = p: [ + # TODO: put somewhere else + (p.callPackage {}) + (p.callPackage {}) + p.APScheduler ]; }; autoExtraComponents = true; config = { @@ -119,13 +123,13 @@ in { name = "wbob-kodi"; host = kodi-host; } - { - platform = "telegram"; - name = "telegrambot"; - chat_id = builtins.elemAt - (builtins.fromJSON (builtins.readFile - )).allowed_chat_ids 0; - } + #{ + # platform = "telegram"; + # name = "telegrambot"; + # chat_id = builtins.elemAt + # (builtins.fromJSON (builtins.readFile + # )).allowed_chat_ids 0; + #} ]; media_player = [ { platform = "kodi"; @@ -136,7 +140,7 @@ in { } ]; - sensor = [{ platform = "version"; }]; # pyhaversion + # sensor = [{ platform = "version"; }]; # pyhaversion @@ -158,113 +162,16 @@ in { api_key = builtins.readFile ; language = "de-de"; } - { platform = "picotts"; - language = "de-DE"; - } + #{ platform = "picotts"; + # language = "de-DE"; + #} ]; recorder = {}; sun = {}; - telegram_bot = [ - (builtins.fromJSON - (builtins.readFile )) - ]; - group = - { default_view = - { view = "yes"; - entities = [ - "group.sensors" - "group.camera" - "group.outside" - "group.team" - "group.nachtlicht" - "group.switches" - "group.aramark" - ]; - }; - automation = []; - - switches = [ - "switch.bauarbeiterlampe" - "switch.blitzdings" - "switch.fernseher" - "switch.feuer" - "switch.frosch_blasen" - "light.status_felix" - # "light.status_daniel" - # "light.buslicht" - ]; - team = [ - "person.thorsten" - #"device_tracker.thorsten_phone" - "person.felix" - "person.ecki" - "person.daniel" - # "person.carsten" - "person.thierry" - "person.frank" - "person.emeka" - "person.tancrede" - #"device_tracker.felix_phone" - #"device_tracker.ecki_tablet" - #"device_tracker.daniel_phone" - #"device_tracker.carsten_phone" - #"device_tracker.thierry_phone" - #"device_tracker.frank_phone" - #"device_tracker.emeka_phone" - # "person.thorsten" - # "person.felix" - # "person.ecki" - # "person.daniel" - ]; - camera = [ - "camera.Baumarkt" - "camera.Autobahn_Heilbronn" - "camera.Autobahn_Singen" - "camera.puppies" - "camera.poorly_drawn_lines" - "camera.xkcd" - ]; - nachtlicht = [ - "switch.nachtlicht_a" - "switch.nachtlicht_b" - "switch.nachtlicht_c" - "switch.nachtlicht_d" - ]; - Aramark = [ - "binary_sensor.pommes" - "sensor.menu_1" - "sensor.menu_1_text" - "sensor.menu_1_preis" - "sensor.menu_2" - "sensor.menu_2_text" - "sensor.menu_2_preis" - "sensor.aktion" - "sensor.aktion_text" - "sensor.aktion_preis" - "sensor.mercato" - "sensor.mercato_text" - "sensor.mercato_preis" - ]; - sensors = [ - "media_player.kodi" - "timer.felix_10h" - "timer.frank_10h" - "sensor.easy2_dht22_humidity" - "sensor.easy2_dht22_temperature" - "sensor.air_quality" - # "binary_sensor.aramark_pommes" - # "binary_sensor.redbutton" - ]; - outside = [ - # "sensor.ditzingen_pm10" - # "sensor.ditzingen_pm25" - "sensor.dark_sky_temperature" - "sensor.dark_sky_humidity" - "sensor.dark_sky_uv_index" - # "sensor.dark_sky_pressure" - "sensor.dark_sky_hourly_summary" - ]; - }; + #telegram_bot = [ + # (builtins.fromJSON + # (builtins.readFile )) + #]; # only for automation # feedreader.urls = [ "http://www.heise.de/security/rss/news-atom.xml" ]; # we don't use imports because the expressions do not merge in diff --git a/makefu/2configs/bureautomation/device_tracker/openwrt.nix b/makefu/2configs/bureautomation/device_tracker/openwrt.nix index 6b0144129..b597548ef 100644 --- a/makefu/2configs/bureautomation/device_tracker/openwrt.nix +++ b/makefu/2configs/bureautomation/device_tracker/openwrt.nix @@ -12,7 +12,6 @@ consider_home = 300; # 5 minutes timeout new_device_defaults = { track_new_devices = true; - hide_if_away = false; }; } ]; diff --git a/makefu/2configs/bureautomation/sensor/outside.nix b/makefu/2configs/bureautomation/sensor/outside.nix index b5d25ecd3..e7b4d9a7c 100644 --- a/makefu/2configs/bureautomation/sensor/outside.nix +++ b/makefu/2configs/bureautomation/sensor/outside.nix @@ -20,10 +20,13 @@ units = "si" ; scan_interval = "00:30:00"; } - { platform = "luftdaten"; - name = "Ditzingen"; - sensorid = "5341"; - monitored_conditions = [ "P1" "P2" ]; - } ]; + services.home-assistant.config.luftdaten = { + sensor_id = "26237"; + show_on_map = true; + sensors.monitored_conditions = [ + "P1" + "P2" + ]; + }; } -- cgit v1.2.3 From 4f30fddc4aa02289d38b00de9bb7b36ce290a8db Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 17 Mar 2021 20:04:30 +0100 Subject: ma home/ham: pull out zigbee2mqtt --- makefu/2configs/home/ham/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/makefu/2configs/home/ham/default.nix b/makefu/2configs/home/ham/default.nix index e164b177f..33e406e0b 100644 --- a/makefu/2configs/home/ham/default.nix +++ b/makefu/2configs/home/ham/default.nix @@ -14,11 +14,10 @@ in { imports = [ ./nginx.nix ./mqtt.nix - ./zigbee2mqtt ./signal-rest # hass config - ./zigbee2mqtt/hass.nix + ../zigbee2mqtt/hass.nix # ./multi/flurlicht.nix ./multi/kurzzeitwecker.nix ./multi/the_playlist.nix -- cgit v1.2.3 From 7d262220b81686cfe082642d08cb1ddea021fef8 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 17 Mar 2021 20:04:50 +0100 Subject: ma storj: expose web-ui --- makefu/2configs/storj/client.nix | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/makefu/2configs/storj/client.nix b/makefu/2configs/storj/client.nix index e37e2ce23..5e6753403 100644 --- a/makefu/2configs/storj/client.nix +++ b/makefu/2configs/storj/client.nix @@ -1,4 +1,8 @@ { lib, ... }: +let + port = "14002"; +internal-ip = "192.168.1.11"; +in { networking.firewall.allowedTCPPorts = [ 28967 ]; virtualisation.oci-containers.containers.storj-storagenode = { @@ -6,7 +10,7 @@ ports = [ # TODO: omo ip "0.0.0.0:28967:28967" - "127.0.0.1:14002:14002" + "127.0.0.1:${port}:${port}" ]; environment = { # SETUP = "true"; # must be run only once ... @@ -24,4 +28,18 @@ StandardOutput = lib.mkForce "journal"; StandardError = lib.mkForce "journal"; }; + + services.nginx.virtualHosts."storj" = { + serverAliases = [ + "storj.lan" + ]; + + locations."/".proxyPass = "http://localhost:${port}"; + locations."/".proxyWebsockets = true; + extraConfig = '' + if ( $server_addr != "${internal-ip}" ) { + return 403; + } + ''; + }; } -- cgit v1.2.3 From 758660945c712b645e755e9101a9fd3d8a325c91 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 18 Mar 2021 22:08:23 +0100 Subject: ma git: add oof --- makefu/2configs/git/cgit-retiolum.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/makefu/2configs/git/cgit-retiolum.nix b/makefu/2configs/git/cgit-retiolum.nix index 3e3ef09a8..114febe8b 100644 --- a/makefu/2configs/git/cgit-retiolum.nix +++ b/makefu/2configs/git/cgit-retiolum.nix @@ -36,6 +36,7 @@ let cgit.desc = "Build new Stockholm hosts"; }; cac-api = { }; + oof = { }; euer_blog = { }; ampel = { }; europastats = { }; -- cgit v1.2.3