From 8442b1a3842855ed0a9187177f6c8f80adcb8cce Mon Sep 17 00:00:00 2001 From: ccostan Date: Wed, 31 Jan 2018 22:17:09 -0500 Subject: [PATCH] #307 and a little something extra. --- packages/minecraft.yaml | 29 ++++++++++++++++++++++++----- packages/network.yaml | 9 +++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/packages/minecraft.yaml b/packages/minecraft.yaml index c79c0f10..2d6e802a 100755 --- a/packages/minecraft.yaml +++ b/packages/minecraft.yaml @@ -16,14 +16,33 @@ sensor: name: Bear Stone server: !secret minecraft #------------------------------------------- -# group: -# finance: -# entities: -# - sensor.tesla -# - sensor.bitcoin +group: + Minecraft: + entities: + - sensor.bear_stone ############################################################################## ### Automations - Detect when things are not right. Like any Good Watchdog. ############################################################################## #automation: #Tweets pushed out to twitter. +automation: + - alias: Someone on the MC server! + trigger: + - platform: state + entity_id: sensor.bear_stone + + condition: + - condition: template + value_template: > + {% if not is_state('sensor.bear_stone', '0/10') %} + false + {% else %} + true + {% endif %} + + action: + - service: script.notify_engine + data_template: + value1: "The following users are online: {{ states.sensor.bear_stone.attributes.users_online }}" + who: 'carlo' diff --git a/packages/network.yaml b/packages/network.yaml index 12f4001c..fbbd895e 100755 --- a/packages/network.yaml +++ b/packages/network.yaml @@ -148,6 +148,15 @@ automation: - sensor.network - binary_sensor.carlowink + condition: + - condition: template + value_template: > + {% if not is_state('sensor.network_detail', ' ') %} + false + {% else %} + true + {% endif %} + action: - service: script.notify_engine data_template: