From 3f5b8e0e5fb18c7ca325c80a0d77065fd9d8f747 Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Tue, 3 Sep 2019 21:59:32 +0200 Subject: [PATCH] Restored car lock sensor --- binary_sensor/car.yaml | 19 +++++++++++++++++++ script/speech_engine.yaml | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/binary_sensor/car.yaml b/binary_sensor/car.yaml index d509c49b..a1976bc1 100644 --- a/binary_sensor/car.yaml +++ b/binary_sensor/car.yaml @@ -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 ###################################################################### diff --git a/script/speech_engine.yaml b/script/speech_engine.yaml index 583e8c5f..f83dc07b 100644 --- a/script/speech_engine.yaml +++ b/script/speech_engine.yaml @@ -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" %} -- 2.47.3