summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/media
diff options
context:
space:
mode:
Diffstat (limited to 'makefu/2configs/home/ham/media')
-rw-r--r--makefu/2configs/home/ham/media/arbeitszimmer_matrix.nix14
-rw-r--r--makefu/2configs/home/ham/media/schlafzimmer_music_remote.nix50
2 files changed, 29 insertions, 35 deletions
diff --git a/makefu/2configs/home/ham/media/arbeitszimmer_matrix.nix b/makefu/2configs/home/ham/media/arbeitszimmer_matrix.nix
index bd36f02cd..26fec370f 100644
--- a/makefu/2configs/home/ham/media/arbeitszimmer_matrix.nix
+++ b/makefu/2configs/home/ham/media/arbeitszimmer_matrix.nix
@@ -32,10 +32,12 @@ in
services.home-assistant.config.automation =
[
{ alias = "Arbeitszimmer Matrix music action";
+ mode = "queued";
trigger = [
{
platform = "state";
entity_id = all_buttons;
+ to = "on"; # ignore 'unavailable'
}
];
action =
@@ -59,17 +61,11 @@ in
}
)
- (remote_action "b9"
- ((say "Guter Song {{ states.sensor.the_playlist_song.state }}") ++ [
- { service = "rest_command.good_song"; }
- ]))
+ (remote_action "b9" [ { service = "rest_command.good_song"; } ])
+ (remote_action "b10" [ { service = "rest_command.bad_song"; } ])
- (remote_action "b10"
- ((say "Schlechter Song {{ states.sensor.the_playlist_song.state }}") ++ [
- { service = "rest_command.bad_song"; }
- ]))
(remote_action "3"
- ((say "Starte Lassulus Super Radio") ++ [
+ ((say "Starte Lass") ++ [
{ service = "media_player.play_media";
data = {
media_content_id = "http://radio.lassul.us:8000/radio.mp3";
diff --git a/makefu/2configs/home/ham/media/schlafzimmer_music_remote.nix b/makefu/2configs/home/ham/media/schlafzimmer_music_remote.nix
index 55b1fd8f5..438ce6bda 100644
--- a/makefu/2configs/home/ham/media/schlafzimmer_music_remote.nix
+++ b/makefu/2configs/home/ham/media/schlafzimmer_music_remote.nix
@@ -3,7 +3,8 @@ let
remote = "sensor.schlafzimmer_music_remote_action";
hlib = import ../lib;
step = 0.03;
- room = "bedroom";
+ #room = "bedroom";
+ room = "living_room";
#room = "office";
player = "media_player.${room}";
@@ -68,6 +69,7 @@ in
services.home-assistant.config.automation =
[
{ alias = "Schlafzimmer music action";
+ mode = "queued";
trigger = [
{
platform = "state";
@@ -79,20 +81,27 @@ in
action =
[
{ choose = [
- (remote_action "on" { #also called by hold right and left
- service = "media_player.media_play";
- target.entity_id = player;
- })
- (remote_action "off"
- {
- service = "media_player.volume_mute";
+ (remote_action "on"
+ ((say "Starte Essensmusik") ++ [
+ { service = "media_player.play_media";
+ data = {
+ media_content_id = "https://listen.openstream.co/4457/audio.mp3";
+ media_content_type = "music";
+ };
target.entity_id = player;
- data.is_volume_muted = ''{{ not state_attr('${player}' , 'is_volume_muted') }}'';
}
+ ]))
+ (remote_action "off"
+ [
+ {
+ service = "media_player.media_stop";
+ target.entity_id = player;
+ }
+ ]
)
(remote_action "arrow_right_hold"
- ((say "Starte Lassulus Super Radio") ++ [
+ ((say "Starte Lass") ++ [
{ service = "media_player.play_media";
data = {
media_content_id = "http://radio.lassul.us:8000/radio.mp3";
@@ -101,7 +110,7 @@ in
target.entity_id = player;
}
]))
- (remote_action "arrow_left_hold"
+ (remote_action "arrow_left_hold"
((say "Starte Deep House Music") ++ [
{ service = "media_player.play_media";
data = {
@@ -111,12 +120,7 @@ in
target.entity_id = player;
}
]))
- #(remote_action "arrow_left_release" {
-
- #})
- #(remote_action "arrow_left_release" {
-
- #})
+
# TODO: choose random kindermusik?
(remote_action "brightness_move_up"
((say "Starte Liam Album") ++ [
@@ -130,14 +134,8 @@ in
}
])
)
- (remote_action "brightness_move_down"
- ((say "Stoppe Musik") ++ [
- {
- service = "media_player.media_stop";
- target.entity_id = player;
- }
- ])
- )
+ #(remote_action "brightness_move_down"
+ #)
(remote_action "arrow_right_click" {
service = "media_player.volume_set";
@@ -157,4 +155,4 @@ in
}
];
-} \ No newline at end of file
+}