2022-01-30 22:51:32 +00:00
|
|
|
let
|
|
|
|
button = "binary_sensor.arbeitszimmer_onebutton_button";
|
|
|
|
light = "light.arbeitszimmer_onebutton_led";
|
|
|
|
at_work = "input_boolean.felix_at_work";
|
|
|
|
lib = import ../lib;
|
2022-06-06 19:07:52 +00:00
|
|
|
say = lib.say.office;
|
2022-01-30 22:51:32 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
services.home-assistant.config.input_boolean.felix_at_work.name = "Felix auf Arbeit";
|
2022-06-10 19:37:49 +00:00
|
|
|
services.home-assistant.config.script.start_office_radio.sequence =
|
|
|
|
[
|
|
|
|
{ service = "media_player.play_media";
|
|
|
|
data = {
|
|
|
|
media_content_id = "http://radio.lassul.us:8000/radio.mp3";
|
|
|
|
media_content_type = "music";
|
|
|
|
};
|
|
|
|
target.entity_id = "media_player.office";
|
|
|
|
}
|
|
|
|
];
|
2022-01-30 22:51:32 +00:00
|
|
|
services.home-assistant.config.automation =
|
|
|
|
[
|
2022-06-10 19:37:49 +00:00
|
|
|
{ service = "media_player.play_media";
|
|
|
|
data = {
|
|
|
|
media_content_id = "http://radio.lassul.us:8000/radio.mp3";
|
|
|
|
media_content_type = "music";
|
|
|
|
};
|
|
|
|
target.entity_id = "media_player.office";
|
|
|
|
}
|
2022-01-30 22:51:32 +00:00
|
|
|
{ alias = "Push Check-in Button Felix with button";
|
|
|
|
trigger = [
|
|
|
|
{
|
|
|
|
platform = "state";
|
|
|
|
entity_id = button;
|
|
|
|
to = "on";
|
|
|
|
for.seconds = 1;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
condition = [
|
|
|
|
];
|
|
|
|
action =
|
|
|
|
[
|
|
|
|
{ choose = [
|
|
|
|
{
|
|
|
|
conditions = {
|
|
|
|
condition = "state";
|
|
|
|
entity_id = at_work;
|
|
|
|
state = "off";
|
|
|
|
};
|
|
|
|
sequence = [
|
|
|
|
{ service = "light.turn_on";
|
|
|
|
target.entity_id = light;
|
|
|
|
data.brightness = 200;
|
|
|
|
}
|
|
|
|
{ service = "homeassistant.turn_on";
|
|
|
|
entity_id = at_work;
|
|
|
|
}
|
2022-06-06 19:07:52 +00:00
|
|
|
] ++ (say "Willkommen auf Arbeit") ++
|
|
|
|
[
|
|
|
|
{ service = "media_player.play_media";
|
|
|
|
data = {
|
2022-06-10 19:37:49 +00:00
|
|
|
media_content_id = "http://radio.lassul.us:8000/radio.mp3";
|
2022-06-06 19:07:52 +00:00
|
|
|
media_content_type = "music";
|
|
|
|
};
|
|
|
|
target.entity_id = "media_player.office";
|
|
|
|
}
|
|
|
|
];
|
2022-01-30 22:51:32 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
conditions = {
|
|
|
|
condition = "state";
|
|
|
|
entity_id = at_work;
|
|
|
|
state = "on";
|
|
|
|
};
|
|
|
|
sequence = [
|
|
|
|
{ service = "light.turn_off";
|
|
|
|
target.entity_id = light;
|
|
|
|
}
|
|
|
|
{ service = "homeassistant.turn_off";
|
|
|
|
entity_id = at_work;
|
|
|
|
}
|
|
|
|
] ++ (say "Endlich ist Pappa fertig mit arbeit!");
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|