shack/glados: announce message for keyholder
This commit is contained in:
parent
99e2d0e115
commit
dca15cd518
28
krebs/2configs/shack/glados/automation/announcement.j2
Normal file
28
krebs/2configs/shack/glados/automation/announcement.j2
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
Willkommen werter Keyholder {{ states("sensor.keyholder") }} in deinem Lieblingshackerspace.
|
||||||
|
|
||||||
|
Es ist {{states("sensor.temperature") | round(1) | replace('.',' Komma ')}} Grad {% if states("sensor.temperature")|float > 25 %}heiss{%elif states("sensor.temperature")|float > 15%}warm{%else%}kalt{%endif%} bei {% if states("sensor.humidity") | int <45 %}trockenen{% elif states("sensor.humidity") | int <65 %}angenehmen{%else%}feuchten{%endif%} {{states("sensor.humidity") | int }} Prozent Luftfeuchtigkeit.
|
||||||
|
|
||||||
|
{% if (states("sensor.fullstand_mate_1")|int == 0) and
|
||||||
|
states("sensor.fullstand_mate_2")|int == 0 %}ES IST MAHTECALYPSE, BEIDE MAHTESCHÄCHTE SIND LEER! {%if states("sensor.fullstand_mate_cola")| int == 0%} UND SOGAR DIE COLA IST ALLE. Ihr seid sowas von am Arsch!{%else%}Zum Glück gibt es noch Cola, Phew!{%endif%}
|
||||||
|
{% elif (states("sensor.fullstand_mate_1")|int + states("sensor.fullstand_mate_2")|int) < 5 %}
|
||||||
|
Der Mahtestand im Automaten ist mit {{states("sensor.fullstand_mate_1")|int + states("sensor.fullstand_mate_2")|int }} verbleibenden Flaschen kritisch!
|
||||||
|
{% else %}
|
||||||
|
Im Automaten sind noch {{states("sensor.fullstand_mate_1")|int + states("sensor.fullstand_mate_2")|int }} Flaschen Mahte und {{states("sensor.fullstand_mate_cola")}} Flaschen Cola.
|
||||||
|
{%endif%}
|
||||||
|
|
||||||
|
Die Wettervorhersage: {{states("sensor.dark_sky_hourly_summary")}} Aktuell {{states("sensor.dark_sky_summary")}} bei {{states("sensor.dark_sky_temperature") | round(1) | replace('.',' Komma ')}} Grad.
|
||||||
|
Der Stromverbrauch liegt bei {{ (( states("sensor.l1_power")|int + states("sensor.l2_power")|int + states("sensor.l3_power")|int ) / 1000 )| round(1) | replace('.',' Komma ')}} Kilowatt.
|
||||||
|
|
||||||
|
Im Fablab ist die Feinstaubbelastung {% if states("sensor.fablab_particulate_matter_2_5um_concentration") | float > 50 %}hoch!{%elif states("sensor.fablab_particulate_matter_2_5um_concentration") | float > 25 %}mäßig.{% else %}gering.{%endif%}
|
||||||
|
|
||||||
|
{% if is_state("binary_sensor.door_rzl",'on') and is_state("binary_sensor.door_entropia",'on') %}
|
||||||
|
Das Raumzeitlabor und Entropia haben geöffnet.
|
||||||
|
{% elif is_state("binary_sensor.door_rzl",'off') and is_state("binary_sensor.door_entropia",'off') %}
|
||||||
|
Das Raumzeitlabor und Entropia haben geschlossen.
|
||||||
|
{% elif is_state("binary_sensor.door_rzl",'on') and is_state("binary_sensor.door_entropia",'off') %}
|
||||||
|
Das Raumzeitlabor hat geöffnet und Entropia hat geschlossen.
|
||||||
|
{% elif is_state("binary_sensor.door_rzl",'off') and is_state("binary_sensor.door_entropia",'on') %}
|
||||||
|
Das Raumzeitlabor hat geschlossen und Entropia hat geöffnet.
|
||||||
|
{%endif%}
|
||||||
|
|
||||||
|
Die Glados Hackerspace Automation wünscht dir und allen Anwesenden einen produktiven und angenehmen Aufenthalt!
|
|
@ -2,12 +2,20 @@
|
||||||
# binary_sensor.portal_lock
|
# binary_sensor.portal_lock
|
||||||
# sensor.keyholder
|
# sensor.keyholder
|
||||||
# media_player.lounge
|
# media_player.lounge
|
||||||
|
|
||||||
|
# additional state required on:
|
||||||
|
# mpd.shack:
|
||||||
|
# playlist "ansage"
|
||||||
|
# playlist "lassulus"
|
||||||
|
# lounge.kiosk.shack:
|
||||||
|
# playlist "ansage"
|
||||||
|
|
||||||
let
|
let
|
||||||
glados = import ../lib;
|
glados = import ../lib;
|
||||||
in
|
in
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
alias = "Greet new keyholder for key exchange";
|
alias = "Bedanken bei Übernahme von Key";
|
||||||
initial_state = true;
|
initial_state = true;
|
||||||
trigger = {
|
trigger = {
|
||||||
platform = "state";
|
platform = "state";
|
||||||
|
@ -15,15 +23,22 @@ in
|
||||||
};
|
};
|
||||||
condition = {
|
condition = {
|
||||||
condition = "template";
|
condition = "template";
|
||||||
value_template = "{{ trigger.from_state.state != 'No Keyholder' }}";
|
value_template = "{{ (trigger.from_state.state != 'No Keyholder') and (trigger.from_state.state != 'No Keyholder') }}";
|
||||||
};
|
};
|
||||||
action = glados.say.kiosk "Danke {{trigger.to_state.state}} für das Übernehmen des Keys von {{trigger.from_state.state}}";
|
action = glados.say.kiosk "Danke {{ trigger.to_state.state }} für das Übernehmen des Keys von {{ trigger.from_state.state }}";
|
||||||
# action = [];
|
}
|
||||||
|
{
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
alias = "Start Music on portal lock on";
|
alias = "Start Music on portal lock on";
|
||||||
# TODO: use "power" trigger
|
|
||||||
trigger = {
|
trigger = {
|
||||||
platform = "state";
|
platform = "state";
|
||||||
entity_id = "binary_sensor.portal_lock";
|
entity_id = "binary_sensor.portal_lock";
|
||||||
|
@ -61,7 +76,7 @@ in
|
||||||
media_content_id = "ansage";
|
media_content_id = "ansage";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{ delay.seconds = 8; }
|
{ delay.seconds = 8.5; }
|
||||||
{
|
{
|
||||||
service = "media_player.volume_set";
|
service = "media_player.volume_set";
|
||||||
data = {
|
data = {
|
||||||
|
@ -74,7 +89,7 @@ in
|
||||||
data = {
|
data = {
|
||||||
entity_id = "media_player.lounge";
|
entity_id = "media_player.lounge";
|
||||||
media_content_type = "playlist";
|
media_content_type = "playlist";
|
||||||
media_content_id = "lassulus superradio";
|
media_content_id = "lassulus";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user