2019-03-06 15:42:27 +00:00
|
|
|
[
|
2019-04-04 07:50:16 +00:00
|
|
|
{ alias = "Turn on Fernseher on group home";
|
2019-03-06 15:42:27 +00:00
|
|
|
trigger = {
|
2019-04-04 20:53:57 +00:00
|
|
|
platform = "state";
|
2019-04-04 07:50:16 +00:00
|
|
|
entity_id = "group.team";
|
|
|
|
from = "not_home";
|
|
|
|
to = "home";
|
2019-04-17 18:46:58 +00:00
|
|
|
for.seconds = 30;
|
2019-03-06 15:42:27 +00:00
|
|
|
};
|
2019-04-17 18:46:58 +00:00
|
|
|
action = [
|
|
|
|
{
|
|
|
|
service = "homeassistant.turn_on";
|
|
|
|
entity_id = [
|
|
|
|
"switch.fernseher"
|
|
|
|
"switch.feuer"
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
service = "media_player.kodi_call_method";
|
|
|
|
data = {
|
|
|
|
entity_id = "media_player.kodi";
|
|
|
|
method = "Player.Open";
|
|
|
|
item.partymode = "music";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
service = "tts.google_say";
|
|
|
|
entity_id = "media_player.kodi";
|
|
|
|
data = {
|
|
|
|
message = "Willkommen in deinem Lieblingsbüro";
|
|
|
|
language = "de";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
{
|
|
|
|
service = "notify.telegrambot";
|
|
|
|
data = {
|
|
|
|
title = "Bureau Startup";
|
|
|
|
message = "Willkommen {{ trigger.platform }}";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2019-03-06 15:42:27 +00:00
|
|
|
}
|
2019-04-04 07:50:16 +00:00
|
|
|
{ alias = "Turn off Fernseher after last in group left";
|
2019-03-06 15:42:27 +00:00
|
|
|
trigger = [
|
|
|
|
{ # trigger when movement was detected at the time
|
2019-04-04 20:53:57 +00:00
|
|
|
platform = "state";
|
2019-04-04 07:50:16 +00:00
|
|
|
entity_id = "group.team";
|
|
|
|
from = "home";
|
|
|
|
to = "not_home";
|
2019-03-06 15:42:27 +00:00
|
|
|
}
|
2019-04-04 07:50:16 +00:00
|
|
|
{ # trigger at 18:00 no matter what
|
2019-03-06 15:42:27 +00:00
|
|
|
# to avoid 'everybody left before 18:00:00'
|
|
|
|
platform = "time";
|
|
|
|
at = "18:00:00";
|
|
|
|
}
|
|
|
|
];
|
2019-04-04 23:44:29 +00:00
|
|
|
action = [
|
|
|
|
{
|
|
|
|
service = "homeassistant.turn_off";
|
|
|
|
entity_id = [
|
|
|
|
"switch.fernseher"
|
|
|
|
"switch.feuer"
|
|
|
|
"light.status_felix"
|
|
|
|
"light.status_daniel"
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
service = "notify.telegrambot";
|
|
|
|
data = {
|
|
|
|
title = "Bureau Shutdown";
|
2019-04-17 18:46:58 +00:00
|
|
|
message = "All devices are turned off due to {{ trigger.platform }}";
|
2019-04-04 23:44:29 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2019-03-06 15:42:27 +00:00
|
|
|
condition =
|
|
|
|
{ condition = "and";
|
|
|
|
conditions = [
|
|
|
|
{
|
|
|
|
condition = "time";
|
|
|
|
before = "06:30:00"; #only turn off between 6:30 and 18:00
|
|
|
|
after = "18:00:00";
|
|
|
|
# weekday = [ "mon" "tue" "wed" "thu" "fri" ];
|
|
|
|
}
|
2019-04-04 07:50:16 +00:00
|
|
|
{ # if anybody is still there
|
2019-03-06 15:42:27 +00:00
|
|
|
condition = "state";
|
2019-04-04 07:50:16 +00:00
|
|
|
entity_id = "group.team";
|
|
|
|
state = "not_home";
|
2019-03-06 15:42:27 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
]
|