From 467b70d918e5fb4cb1c4af14e8a8bd00c7713182 Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Mon, 3 Apr 2017 15:13:13 -0400 Subject: [PATCH] Tweaking the apple tv sensor --- sensors/devices.yaml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/sensors/devices.yaml b/sensors/devices.yaml index 1d39e5b..fc7c3ef 100644 --- a/sensors/devices.yaml +++ b/sensors/devices.yaml @@ -23,12 +23,13 @@ appletv: friendly_name: 'Apple Tv' value_template: >- - {%- if is_state("device_tracker.appletv", "home") %} - Online - {% elif is_state("device_tracker.appletv", "playing") %} - Playing + {%- if is_state("media_player.appletv", "on") %} + On + {% elif is_state("media_player.appletv", "playing") %} + Playing {%- if states.media_player.appletv.attributes.media_title %} + - {{ states.media_player.appletv.attributes.media_title }} {% else %} - Offline + Off {%- endif %} xboxone: @@ -37,7 +38,14 @@ chromecast: friendly_name: 'Chromecast' - value_template: "{{ 'Online' if is_state('device_tracker.chromecast', 'home') else 'Offline' }}" + value_template: >- + {%- if is_state("media_player.chromecast_lr", "on") %} + On + {% elif is_state("media_player.chromecast_lr", "playing") %} + Playing + {% else %} + Off + {%- endif %} smartthings: friendly_name: 'SmartThings' @@ -45,7 +53,13 @@ samsungtv: friendly_name: 'Samsung Tv' - value_template: "{{ 'Online' if is_state('device_tracker.c4731ecec013', 'home') else 'Offline' }}" + value_template: >- + {%- if is_state("media_player.pn60e550_pn60e550", "on") %} + On + {% else %} + Off + {%- endif %} + honeywell: friendly_name: 'Honeywell'