From 7661181528df06f3b7e15128c1efcb6ac1854f31 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 9 Feb 2019 23:19:53 +0100 Subject: ma google-muell: bump to latest version, use new config --- makefu/2configs/homeautomation/google-muell.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'makefu/2configs/homeautomation/google-muell.nix') diff --git a/makefu/2configs/homeautomation/google-muell.nix b/makefu/2configs/homeautomation/google-muell.nix index 235cc154..5870f298 100644 --- a/makefu/2configs/homeautomation/google-muell.nix +++ b/makefu/2configs/homeautomation/google-muell.nix @@ -3,13 +3,20 @@ with import ; let pkg = pkgs.ampel; home = "/var/lib/ampel"; - sec = "${toString }/google-muell.json"; + sec = "${toString }/ampel/google-muell.json"; ampelsec = "${home}/google-muell.json"; - cred = "${toString }/google-muell-creds.json"; + cred = "${toString }/ampel/google-muell-creds.json"; # TODO: generate this credential file locally ampelcred = "${home}/google-muell-creds.json"; - esp = "192.168.8.204"; sleepval = "1800"; + default-color = "244,220,66"; + 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 }/mqtt/sensor"); + }); in { users.users.ampel = { uid = genid "ampel"; @@ -27,7 +34,7 @@ in { install -m600 -o ampel ${sec} ${ampelsec} install -m600 -o ampel ${cred} ${ampelcred} ''; - ExecStart = "${pkg}/bin/google-muell --esp=${esp} --client-secrets=${ampelsec} --credential-path=${ampelcred} --sleepval=${sleepval}"; + 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; -- cgit v1.2.3 From 7e9a2417ba27a19d6db0a87b075b9d55a237931a Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 6 Mar 2019 16:42:52 +0100 Subject: ma homeautomation: update google-muell --- makefu/2configs/homeautomation/google-muell.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'makefu/2configs/homeautomation/google-muell.nix') diff --git a/makefu/2configs/homeautomation/google-muell.nix b/makefu/2configs/homeautomation/google-muell.nix index 5870f298..c81eae20 100644 --- a/makefu/2configs/homeautomation/google-muell.nix +++ b/makefu/2configs/homeautomation/google-muell.nix @@ -9,7 +9,8 @@ let # TODO: generate this credential file locally ampelcred = "${home}/google-muell-creds.json"; sleepval = "1800"; - default-color = "244,220,66"; + # default-color = "18,63,40"; + default-color = "255,127,0"; config_json = toFile "config.json" (toJSON { mq_hostname = "localhost"; mq_port = 1883; -- cgit v1.2.3