]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Restored car lock sensor
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 3 Sep 2019 19:59:32 +0000 (21:59 +0200)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 3 Sep 2019 19:59:32 +0000 (21:59 +0200)
binary_sensor/car.yaml
script/speech_engine.yaml

index d509c49b6825c6899fcc16b5e5baef48bc480aa1..a1976bc1c23b6fcc7d1cd19208e3c7217449d307 100644 (file)
@@ -1,3 +1,22 @@
+######################################################################
+# Binary Sensor: Doors Lock
+######################################################################
+
+- platform: template
+  sensors:
+    ff590mr_locked:
+      friendly_name: Vettura Bloccata
+      entity_id: lock.ff590mr_lock
+      value_template: >-
+        {{ is_state('lock.ff590mr_lock', 'locked') }}
+      icon_template: >-
+        {% if is_state('lock.ff590mr_lock', 'locked') %}
+          mdi:lock
+        {% else %}
+          mdi:lock-open
+        {% endif %}
+      device_class: lock
+
 ######################################################################
 # Binary Sensor: Doors Closed
 ######################################################################
index 583e8c5f5c0a3ea2ffb6bbb5026ef2605684d5f1..f83dc07b64af6700cd3c03ce81a3276ac2fe3343 100644 (file)
@@ -106,7 +106,7 @@ speech_engine:
             {% else %}
               {% set car_position = "fuori" %}
             {% endif %}
-            {% if is_state('lock.ff590mr_lock', 'locked') %}
+            {% if is_state('binary_sensor.ff590mr_locked', 'off') %}
               {% set car_lock = "chiusa" %}
             {% else %}
               {% set car_lock = "aperta" %}