summaryrefslogtreecommitdiffstats
path: root/makefu
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-04-19 21:24:52 +0200
committermakefu <github@syntax-fehler.de>2020-04-19 21:24:52 +0200
commit0b371833e9ef68fd891fac65a657d8e38b5b3fad (patch)
treec5c9e35f73713fc518f43fc9837e5a24c255917f /makefu
parent2dfadc18518900d48bd367c18d894a91b7bf2a77 (diff)
ma ham: add the_playlist
Diffstat (limited to 'makefu')
-rw-r--r--makefu/2configs/ham/default.nix2
-rw-r--r--makefu/2configs/ham/multi/the_playlist.nix26
2 files changed, 28 insertions, 0 deletions
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'] }}'';
+ };
+ };
+ }
+ ];
+}