From f951d48906e91ac8cd4e34b86848ae4414c5cd91 Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Sat, 8 Apr 2017 22:43:06 -0400 Subject: [PATCH] Tweaking garage door sensor --- sensors/smartthings.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sensors/smartthings.yaml b/sensors/smartthings.yaml index 822564c..e84da5a 100644 --- a/sensors/smartthings.yaml +++ b/sensors/smartthings.yaml @@ -1,6 +1,10 @@ -- platform: mqtt - name: "Garage Door" - state_topic: "smartthings/Garage Door/contact" - qos: 0 - unit_of_measurement: "" - value_template: '{{ value.x }}' +- platform: template + sensors: + garage_door: + unit_of_measurement: '%' + value_template: >- + {%- if states.cover.garage_door } + {{ states.cover.garage_door }} + {% else %} + {{ states.sensor.garage_door.state }} + {%- endif %}