From 0b371833e9ef68fd891fac65a657d8e38b5b3fad Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 19 Apr 2020 21:24:52 +0200 Subject: ma ham: add the_playlist --- makefu/2configs/ham/default.nix | 2 ++ makefu/2configs/ham/multi/the_playlist.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 makefu/2configs/ham/multi/the_playlist.nix (limited to 'makefu/2configs/ham') diff --git a/makefu/2configs/ham/default.nix b/makefu/2configs/ham/default.nix index 53723299c..6b2867c2d 100644 --- a/makefu/2configs/ham/default.nix +++ b/makefu/2configs/ham/default.nix @@ -14,6 +14,7 @@ let #flurlicht = import ./multi/flurlicht.nix; kurzzeitwecker = import ./multi/kurzzeitwecker.nix; firetv_restart = import ./multi/firetv_restart.nix; + the_playlist = import ./multi/the_playlist.nix; # switch # automation # binary_sensor @@ -131,6 +132,7 @@ in { # https://www.home-assistant.io/cookbook/automation_for_rainy_days/ ] ++ ((import ./sensor/outside.nix) {inherit lib;}) + ++ the_playlist.sensor ++ zigbee.sensor ; frontend = { }; # light = flurlicht.light; diff --git a/makefu/2configs/ham/multi/the_playlist.nix b/makefu/2configs/ham/multi/the_playlist.nix new file mode 100644 index 000000000..aa5ce85dc --- /dev/null +++ b/makefu/2configs/ham/multi/the_playlist.nix @@ -0,0 +1,26 @@ +{ + sensor = [ + { platform = "rest"; + name = "pl"; + resource = "http://prism.r:8001/current"; + scan_interval = 30; + json_attributes = [ "name" "filename" "youtube" ]; + } + { platform = "template"; + sensors = { + the_playlist_song = { + friendly_name = "Current Song"; + value_template = ''{{ states.sensor.pl.attributes['name'] }}''; + }; + the_playlist_url = { + friendly_name = "Song Youtube URL"; + value_template = ''{{ states.sensor.pl.attributes['youtube'] }}''; + }; + the_playlist_filename = { + friendly_name = "Song Filename"; + value_template = ''{{ states.sensor.pl.attributes['filename'] }}''; + }; + }; + } + ]; +} -- cgit v1.2.3 From 91d94ddbb7ce6e211e79122da3e7f7a1193d582c Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 21 Apr 2020 21:35:17 +0200 Subject: ma ham/androidtv: bump python libs to correct version --- makefu/2configs/ham/androidtv/adbshell.nix | 4 ++-- makefu/2configs/ham/androidtv/default.nix | 4 ++-- makefu/2configs/ham/androidtv/purepythonadb.nix | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'makefu/2configs/ham') diff --git a/makefu/2configs/ham/androidtv/adbshell.nix b/makefu/2configs/ham/androidtv/adbshell.nix index f5b96c859..0fadeeb05 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.0.8"; + version = "0.1.1"; src = fetchPypi { inherit pname version; - sha256 = "01f9jinhfyjldg9793gz2i7gcd9xyx0a62r7a5ijssklcnn2rwnm"; + sha256 = "0a4mjrnw2lrhsakb1vjb5l6m3cr1ii7fibs7020nwv08cyx6pq6q"; }; propagatedBuildInputs = [ diff --git a/makefu/2configs/ham/androidtv/default.nix b/makefu/2configs/ham/androidtv/default.nix index 8f3bdc1f3..b7d397db4 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.34"; + version = "0.0.38"; src = fetchPypi { inherit pname version; - sha256 = "13078i2a9hglpv4ldycph5n5485np21vs6z2qn830hybmx8kfxsw"; + sha256 = "0ri1fnc63zashc667w2mlpb0c7ri3x6wnhnf54klb89v73pdnb8k"; }; propagatedBuildInputs = [ diff --git a/makefu/2configs/ham/androidtv/purepythonadb.nix b/makefu/2configs/ham/androidtv/purepythonadb.nix index d4e763b70..c9b1ff5e8 100644 --- a/makefu/2configs/ham/androidtv/purepythonadb.nix +++ b/makefu/2configs/ham/androidtv/purepythonadb.nix @@ -5,11 +5,11 @@ buildPythonPackage rec { pname = "pure-python-adb"; - version = "0.2.3.dev0"; + version = "0.2.2.dev0"; src = fetchPypi { inherit pname version; - sha256 = "88e5a4578435197799aa368fb1a5d87fe43e02a888cb7e85c2ad66173b383c89"; + sha256 = "1xigv6c8xyb4g852nr3smz0137rnp81jvlikza071y7rc6pdzwza"; }; meta = with lib; { @@ -18,4 +18,4 @@ buildPythonPackage rec { license = licenses.mit; # maintainers = [ maintainers. ]; }; -} \ No newline at end of file +} -- cgit v1.2.3 From 8fb99675fb4e813accee6c3258160f6cb7059cb8 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 21 Apr 2020 21:35:59 +0200 Subject: ma ham/the_playlist: init --- makefu/2configs/ham/default.nix | 3 ++ makefu/2configs/ham/multi/the_playlist.nix | 57 ++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) (limited to 'makefu/2configs/ham') diff --git a/makefu/2configs/ham/default.nix b/makefu/2configs/ham/default.nix index 6b2867c2d..ddcf65b5a 100644 --- a/makefu/2configs/ham/default.nix +++ b/makefu/2configs/ham/default.nix @@ -50,6 +50,8 @@ in { logger = { default = "info"; }; + rest_command = {} + // the_playlist.rest_command; tts = [ { platform = "google_translate"; language = "de"; @@ -142,6 +144,7 @@ in { ++ (import ./automation/firetv_restart.nix) ++ kurzzeitwecker.automation #++ flurlicht.automation + ++ the_playlist.automation ++ zigbee.automation; script = { } diff --git a/makefu/2configs/ham/multi/the_playlist.nix b/makefu/2configs/ham/multi/the_playlist.nix index aa5ce85dc..ad090938c 100644 --- a/makefu/2configs/ham/multi/the_playlist.nix +++ b/makefu/2configs/ham/multi/the_playlist.nix @@ -1,9 +1,66 @@ +# Inputs: +# binary_sensor.playlist_button_good +# binary_sensor.playlist_button_bad + +# outputs +# rest_command +# automation +# sensor { + rest_command = { + good_song = { + url = "http://prism.r:8001/good"; + method = "POST"; + }; + bad_song = { + url = "http://prism.r:8001/skip"; + method = "POST"; + }; + }; + automation = [ + { + alias = "playlist song publish"; + trigger = { + #platform = "event"; + #event_data.entity_id = "sensor.the_playlist_song"; + platform = "state"; + entity_id = "sensor.the_playlist_song"; + }; + action = { + service = "mqtt.publish"; + data = { + topic = "/ham/the_playlist/song"; + payload_template = "{{ states.sensor.the_playlist_song.state }}"; + }; + }; + } + { + alias = "playlist upvote on button"; + trigger = { + platform = "state"; + entity_id = "binary_sensor.playlist_button_good"; + from = "off"; + to = "on"; + }; + action.service = "rest_command.good_song"; + } + { + alias = "playlist downvote on button"; + trigger = { + platform = "state"; + entity_id = "binary_sensor.playlist_button_bad"; + from = "off"; + to = "on"; + }; + action.service = "rest_command.bad_song"; + } + ]; sensor = [ { platform = "rest"; name = "pl"; resource = "http://prism.r:8001/current"; scan_interval = 30; + value_template = "1"; json_attributes = [ "name" "filename" "youtube" ]; } { platform = "template"; -- cgit v1.2.3 From 84172b9484e3e0544cc9b9e0cd7455bb23d8259c Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 21 May 2020 10:57:25 +0200 Subject: ma ham/androidtv: bump dependency from 0.0.37 to 0.0.38 --- makefu/2configs/ham/androidtv/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'makefu/2configs/ham') diff --git a/makefu/2configs/ham/androidtv/default.nix b/makefu/2configs/ham/androidtv/default.nix index b7d397db4..9899b2dd3 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.38"; + version = "0.0.39"; src = fetchPypi { inherit pname version; - sha256 = "0ri1fnc63zashc667w2mlpb0c7ri3x6wnhnf54klb89v73pdnb8k"; + sha256 = "06lrjj74g2f3pkhsn3c8h13mkykgqqf4g9q6x5yv23z6ghjnk2dz"; }; propagatedBuildInputs = [ -- cgit v1.2.3 From 6eb00a342fc674b698ed0296391364e773113cfd Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 21 May 2020 10:58:00 +0200 Subject: ma home-assistant: requires empty config to start up ui --- makefu/2configs/ham/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu/2configs/ham') diff --git a/makefu/2configs/ham/default.nix b/makefu/2configs/ham/default.nix index ddcf65b5a..2db4ad4de 100644 --- a/makefu/2configs/ham/default.nix +++ b/makefu/2configs/ham/default.nix @@ -35,6 +35,7 @@ in { ]; }; config = { + config = {}; input_select = zigbee.input_select; # dict timer = zigbee.timer // kurzzeitwecker.timer; # dict homeassistant = { -- cgit v1.2.3 From 2f244cf3a85c82a57d34b42e3aaf80162bdf65a7 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 21 May 2020 10:58:53 +0200 Subject: ma zigbee2mqtt: start up after network is available --- makefu/2configs/ham/zigbee2mqtt/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu/2configs/ham') diff --git a/makefu/2configs/ham/zigbee2mqtt/default.nix b/makefu/2configs/ham/zigbee2mqtt/default.nix index 7c55326f9..84d32c872 100644 --- a/makefu/2configs/ham/zigbee2mqtt/default.nix +++ b/makefu/2configs/ham/zigbee2mqtt/default.nix @@ -17,4 +17,5 @@ volumes = ["/var/lib/zigbee2mqtt:/app/data"]; }; state = [ "/var/lib/zigbee2mqtt/configuration.yaml" "/var/lib/zigbee2mqtt/state.json" ]; + systemd.services.docker-zigbee2mqtt.after = [ "home-assistant.service" "docker.service" "network-online.target" ]; } -- cgit v1.2.3