summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/ham/media/schlafzimmer_music_remote.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2022-09-23 23:41:30 +0200
committermakefu <github@syntax-fehler.de>2022-09-23 23:41:30 +0200
commit3e8f855f60dfa5bf56ab3a1d1a54e0accccbd618 (patch)
tree85674a93388edfb7a0646b46aafc18d64d7aa0c6 /makefu/2configs/home/ham/media/schlafzimmer_music_remote.nix
parent2dfde5dc6d37fb5bab8a1b658cfe7e5b21f5a2f4 (diff)
ma ham: update
Diffstat (limited to 'makefu/2configs/home/ham/media/schlafzimmer_music_remote.nix')
-rw-r--r--makefu/2configs/home/ham/media/schlafzimmer_music_remote.nix50
1 files changed, 24 insertions, 26 deletions
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
+}