summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/ham
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs/ham')
-rw-r--r--makefu/2configs/ham/androidtv/adbshell.nix4
-rw-r--r--makefu/2configs/ham/androidtv/default.nix4
-rw-r--r--makefu/2configs/ham/calendar/nextcloud.nix8
-rw-r--r--makefu/2configs/ham/default.nix9
-rw-r--r--makefu/2configs/ham/google-muell.nix45
-rw-r--r--makefu/2configs/ham/multi/fliegen-couter.nix67
6 files changed, 87 insertions, 50 deletions
diff --git a/makefu/2configs/ham/androidtv/adbshell.nix b/makefu/2configs/ham/androidtv/adbshell.nix
index 0fadeeb05..c2844eb4e 100644
--- a/makefu/2configs/ham/androidtv/adbshell.nix
+++ b/makefu/2configs/ham/androidtv/adbshell.nix
@@ -9,11 +9,11 @@
buildPythonPackage rec {
pname = "adb_shell";
- version = "0.1.1";
+ version = "0.1.3";
src = fetchPypi {
inherit pname version;
- sha256 = "0a4mjrnw2lrhsakb1vjb5l6m3cr1ii7fibs7020nwv08cyx6pq6q";
+ sha256 = "16wb8n4fsh465fjlbsxi83xpi7xklaf28s9568bsb3nkyvfvl58h";
};
propagatedBuildInputs = [
diff --git a/makefu/2configs/ham/androidtv/default.nix b/makefu/2configs/ham/androidtv/default.nix
index 9899b2dd3..2a0bec484 100644
--- a/makefu/2configs/ham/androidtv/default.nix
+++ b/makefu/2configs/ham/androidtv/default.nix
@@ -6,11 +6,11 @@
buildPythonPackage rec {
pname = "androidtv";
- version = "0.0.39";
+ version = "0.0.41";
src = fetchPypi {
inherit pname version;
- sha256 = "06lrjj74g2f3pkhsn3c8h13mkykgqqf4g9q6x5yv23z6ghjnk2dz";
+ sha256 = "1nch08g47qjgdacl03w7kczx2gajx6nkazgxdzbgn1vghrg6x2zw";
};
propagatedBuildInputs = [
diff --git a/makefu/2configs/ham/calendar/nextcloud.nix b/makefu/2configs/ham/calendar/nextcloud.nix
new file mode 100644
index 000000000..0be23ad7b
--- /dev/null
+++ b/makefu/2configs/ham/calendar/nextcloud.nix
@@ -0,0 +1,8 @@
+let
+ cred = import <secrets/ham/nextcloud-calendar>;
+in
+{
+ platform = "caldav";
+ inherit (cred) username password;
+ url = "https://o.euer.krebsco.de/remote.php/dav";
+}
diff --git a/makefu/2configs/ham/default.nix b/makefu/2configs/ham/default.nix
index 2db4ad4de..c7e8733b7 100644
--- a/makefu/2configs/ham/default.nix
+++ b/makefu/2configs/ham/default.nix
@@ -15,6 +15,7 @@ let
kurzzeitwecker = import ./multi/kurzzeitwecker.nix;
firetv_restart = import ./multi/firetv_restart.nix;
the_playlist = import ./multi/the_playlist.nix;
+ fliegen-counter = import ./multi/fliegen-couter.nix;
# switch
# automation
# binary_sensor
@@ -28,10 +29,13 @@ in {
services.home-assistant = {
package = (upkgs.home-assistant.overrideAttrs (old: {
+ doCheck = false;
+ checkPhase = ":";
+ installCheckPhase = ":";
})).override {
extraPackages = ps: with ps; [
python-forecastio jsonrpc-async jsonrpc-websocket mpd2 pkgs.picotts
- (ps.callPackage ./androidtv {})
+ (callPackage ./androidtv {})
];
};
config = {
@@ -48,6 +52,7 @@ in {
conversation = {};
history = {};
logbook = {};
+ counter = fliegen-counter.counter;
logger = {
default = "info";
};
@@ -138,6 +143,7 @@ in {
++ the_playlist.sensor
++ zigbee.sensor ;
frontend = { };
+ calendar = [ (import ./calendar/nextcloud.nix) ];
# light = flurlicht.light;
http = { };
switch = [];
@@ -146,6 +152,7 @@ in {
++ kurzzeitwecker.automation
#++ flurlicht.automation
++ the_playlist.automation
+ ++ fliegen-counter.automation
++ zigbee.automation;
script =
{ }
diff --git a/makefu/2configs/ham/google-muell.nix b/makefu/2configs/ham/google-muell.nix
deleted file mode 100644
index c81eae201..000000000
--- a/makefu/2configs/ham/google-muell.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-{ config, lib, pkgs, buildPythonPackage, ... }:
-with import <stockholm/lib>;
-let
- pkg = pkgs.ampel;
- home = "/var/lib/ampel";
- sec = "${toString <secrets>}/ampel/google-muell.json";
- ampelsec = "${home}/google-muell.json";
- cred = "${toString <secrets>}/ampel/google-muell-creds.json";
- # TODO: generate this credential file locally
- ampelcred = "${home}/google-muell-creds.json";
- sleepval = "1800";
- # default-color = "18,63,40";
- default-color = "255,127,0";
- config_json = toFile "config.json" (toJSON {
- mq_hostname = "localhost";
- mq_port = 1883;
- mq_username = "sensor";
- mq_topic = "/ham/flurlicht/cmnd/MEM1";
- mq_password = replaceChars ["\n"] [""] (readFile "${toString <secrets>}/mqtt/sensor");
- });
-in {
- users.users.ampel = {
- uid = genid "ampel";
- createHome = true;
- isSystemUser = true;
- inherit home;
- };
- systemd.services.google-muell-ampel = {
- description = "Send led change to rgb cubes";
- after = [ "network-online.target" ];
- wantedBy = [ "multi-user.target" ];
- serviceConfig = {
- User = "ampel";
- ExecStartPre = pkgs.writeDash "copy-ampel-secrets" ''
- install -m600 -o ampel ${sec} ${ampelsec}
- install -m600 -o ampel ${cred} ${ampelcred}
- '';
- ExecStart = "${pkg}/bin/google-muell --config ${config_json} --default-color=${default-color} --client-secrets=${ampelsec} --credential-path=${ampelcred} --sleepval=${sleepval}";
- PermissionsStartOnly = true;
- Restart = "always";
- RestartSec = 10;
- PrivateTmp = true;
- };
- };
-}
diff --git a/makefu/2configs/ham/multi/fliegen-couter.nix b/makefu/2configs/ham/multi/fliegen-couter.nix
new file mode 100644
index 000000000..d5c180e03
--- /dev/null
+++ b/makefu/2configs/ham/multi/fliegen-couter.nix
@@ -0,0 +1,67 @@
+# uses:
+# sensor.btn1_click
+# sensor.btn2_click
+let
+ hlib = import ../lib;
+ fly_swat = for: btn: method: incr: {
+ alias = "Increment ${method} for ${for}";
+ trigger = {
+ platform = "state";
+ entity_id = "sensor.${btn}_click";
+ to = method;
+ };
+ action = builtins.genList (cnt: {
+ service = "counter.increment";
+ data.entity_id = "counter.${for}_fliegen";
+ }) incr;
+ };
+in {
+ counter = {
+ felix_fliegen = {};
+ misa_fliegen = {};
+ };
+ automation = [
+ (fly_swat "misa" "btn1" "single" 1)
+ (fly_swat "misa" "btn1" "double" 2)
+ (fly_swat "misa" "btn1" "triple" 3)
+ (fly_swat "felix" "btn2" "single" 1)
+ (fly_swat "felix" "btn2" "double" 2)
+ (fly_swat "felix" "btn2" "triple" 3)
+ {
+ alias = "Send Fly Counter Update";
+ trigger = [
+ {
+ platform = "state";
+ entity_id = "counter.felix_fliegen";
+ }
+ {
+ platform = "state";
+ entity_id = "counter.misa_fliegen";
+ #above = -1;
+ }
+ ];
+ action = {
+ service = "mqtt.publish";
+ data_template = { # gauge-style
+ payload = "{{ trigger.to_state.state }}";
+ topic = "${hlib.prefix}/flycounter/{{ trigger.to_state.object_id }}";
+ };
+ };
+ }
+ {
+ alias = "Reset Fly counters on midnight";
+ trigger = {
+ platform = "time";
+ at = "01:00:00";
+ };
+ action = [
+ { service = "counter.reset";
+ data.entity_id = "counter.misa_fliegen";
+ }
+ { service = "counter.reset";
+ data.entity_id = "counter.felix_fliegen";
+ }
+ ];
+ }
+ ];
+}