2020-01-23 22:52:39 +00:00
|
|
|
# needs:
|
|
|
|
# binary_sensor.portal_lock
|
|
|
|
# sensor.keyholder
|
|
|
|
# media_player.lounge
|
2020-06-17 07:09:09 +00:00
|
|
|
|
|
|
|
# additional state required on:
|
|
|
|
# mpd.shack:
|
|
|
|
# playlist "ansage"
|
|
|
|
# playlist "lassulus"
|
|
|
|
# lounge.kiosk.shack:
|
|
|
|
# playlist "ansage"
|
|
|
|
|
2020-01-23 22:52:39 +00:00
|
|
|
let
|
|
|
|
glados = import ../lib;
|
|
|
|
in
|
|
|
|
[
|
|
|
|
{
|
2020-06-17 07:09:09 +00:00
|
|
|
alias = "Bedanken bei Übernahme von Key";
|
2020-01-23 22:52:39 +00:00
|
|
|
initial_state = true;
|
|
|
|
trigger = {
|
|
|
|
platform = "state";
|
|
|
|
entity_id = "sensor.keyholder";
|
|
|
|
};
|
|
|
|
condition = {
|
|
|
|
condition = "template";
|
2020-06-17 07:09:09 +00:00
|
|
|
value_template = "{{ (trigger.from_state.state != 'No Keyholder') and (trigger.from_state.state != 'No Keyholder') }}";
|
2020-01-23 22:52:39 +00:00
|
|
|
};
|
2020-06-17 07:09:09 +00:00
|
|
|
action = glados.say.kiosk "Danke {{ trigger.to_state.state }} für das Übernehmen des Keys von {{ trigger.from_state.state }}";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
alias = "Keyholder Begrüßen wenn MPD hoch fährt";
|
|
|
|
initial_state = true;
|
|
|
|
trigger = {
|
|
|
|
platform = "state";
|
|
|
|
from = "unavailable";
|
|
|
|
entity_id = "media_player.kiosk";
|
|
|
|
};
|
|
|
|
action = glados.say.kiosk (builtins.readFile ./announcement.j2);
|
2020-01-23 22:52:39 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
alias = "Start Music on portal lock on";
|
|
|
|
trigger = {
|
|
|
|
platform = "state";
|
|
|
|
entity_id = "binary_sensor.portal_lock";
|
|
|
|
to = "on";
|
|
|
|
for.seconds = 30;
|
|
|
|
};
|
|
|
|
condition = {
|
|
|
|
condition = "and";
|
|
|
|
conditions =
|
|
|
|
[
|
|
|
|
{ # only start if a keyholder opened the door and if the lounge mpd is currently not playing anything
|
|
|
|
condition = "template";
|
|
|
|
value_template = "{{ state('sensor.keyholder') != 'No Keyholder' }}";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
condition = "state";
|
|
|
|
entity_id = "media_player.lounge";
|
|
|
|
state = "idle";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
action = [
|
|
|
|
{
|
|
|
|
service = "media_player.volume_set";
|
|
|
|
data = {
|
|
|
|
entity_id = "media_player.lounge";
|
|
|
|
volume_level = 1.0;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
service = "media_player.play_media";
|
|
|
|
data = {
|
|
|
|
entity_id = "media_player.lounge";
|
|
|
|
media_content_type = "playlist";
|
|
|
|
media_content_id = "ansage";
|
|
|
|
};
|
|
|
|
}
|
2020-06-17 07:09:09 +00:00
|
|
|
{ delay.seconds = 8.5; }
|
2020-01-23 22:52:39 +00:00
|
|
|
{
|
|
|
|
service = "media_player.volume_set";
|
|
|
|
data = {
|
|
|
|
entity_id = "media_player.lounge";
|
|
|
|
volume_level = 0.6;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
service = "media_player.play_media";
|
|
|
|
data = {
|
|
|
|
entity_id = "media_player.lounge";
|
|
|
|
media_content_type = "playlist";
|
2020-06-17 07:09:09 +00:00
|
|
|
media_content_id = "lassulus";
|
2020-01-23 22:52:39 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
]
|