]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Fixed car sensors (door, window and lock)
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Fri, 7 Jun 2019 20:11:00 +0000 (22:11 +0200)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Fri, 7 Jun 2019 20:11:00 +0000 (22:11 +0200)
binary_sensor/car.yaml
components/mercedesme.yaml
configuration.yaml
customizations/car.yaml
ui-lovelace.yaml

index e6da6be5c2b0f4c56050eefd17bf77bb172f5700..d245235de9881f727730c3f3d727b96f6f85d0e0 100644 (file)
       friendly_name: Porte
       entity_id: sensor.ff590mr_lock
       value_template: >-
-        {{ not is_state_attr('sensor.ff590mr_lock', 'frontLeftDoorClosed', 'true') 
-           and is_state_attr('sensor.ff590mr_lock', 'frontRightDoorClosed', 'true')
-           and is_state_attr('sensor.ff590mr_lock', 'rearLeftDoorClosed', 'true')
-           and is_state_attr('sensor.ff590mr_lock', 'rearRightDoorClosed', 'true') }}
+        {{ is_state('binary_sensor.ff590mr_door_front_left', 'on') and
+           is_state('binary_sensor.ff590mr_door_front_right', 'on') and
+           is_state('binary_sensor.ff590mr_door_rear_left', 'on') and
+           is_state('binary_sensor.ff590mr_door_rear_right', 'on') }}
       icon_template: >-
-        {% if is_state_attr('sensor.ff590mr_lock', 'frontLeftDoorClosed', 'true') 
-           and is_state_attr('sensor.ff590mr_lock', 'frontRightDoorClosed', 'true')
-           and is_state_attr('sensor.ff590mr_lock', 'rearLeftDoorClosed', 'true')
-           and is_state_attr('sensor.ff590mr_lock', 'rearRightDoorClosed', 'true') %}
+        {% if is_state('binary_sensor.ff590mr_door_front_left', 'on') and
+           is_state('binary_sensor.ff590mr_door_front_right', 'on') and
+           is_state('binary_sensor.ff590mr_door_rear_left', 'on') and
+           is_state('binary_sensor.ff590mr_door_rear_right', 'on') %}
           mdi:car-door
         {% else %}
           mdi:car-door
         {% endif %}
       device_class: opening
 
+######################################################################
+# Binary Sensor: Windows Closed
+######################################################################
+
+- platform: template
+  sensors:
+    ff590mr_windows_closed_2:
+      friendly_name: Finestrini
+      entity_id: binary_sensor.ff590mr_windows_closed
+      value_template: >-
+        {{ is_state('binary_sensor.ff590mr_window_front_left', 'on') and
+           is_state('binary_sensor.ff590mr_window_front_right', 'on') and
+           is_state('binary_sensor.ff590mr_window_rear_left', 'on') and
+           is_state('binary_sensor.ff590mr_window_rear_right', 'on') }}
+      icon_template: >-
+        {% if is_state('binary_sensor.ff590mr_window_front_left', 'on') and
+           is_state('binary_sensor.ff590mr_window_front_right', 'on') and
+           is_state('binary_sensor.ff590mr_window_rear_left', 'on') and
+           is_state('binary_sensor.ff590mr_window_rear_right', 'on') %}
+          mdi:window-open
+        {% else %}
+          mdi:window-closed
+        {% endif %}      
+      device_class: opening
+
+
 ######################################################################
 # Binary Sensor: Window Front Left
 ######################################################################
index 614ad85a73d665e6e13da38e5aa3ed2a250be0e2..c3ff54b2dbad12b87b79e35decb9ff292c96add4 100644 (file)
@@ -4,8 +4,8 @@
 
 username: !secret mb_user
 password: !secret mb_password
-pin: !secret mb_pin            # need to open the lock, please use the Mercedes web or app to set-up the pin
-country_code: IT               # two digts country code
-accept_lang: it_IT             # four digits country code
-save_car_details: false        # save a json to the HA config directory with the features and states, please use this for debug only 
+pin: !secret mb_pin
+country_code: IT
+accept_lang: it_IT
+save_car_details: false
 #scan_interval: 120
index 6274e41d02798655fb1ba44242cfc985a4b3c1d4..7c14aeec54b2579eb4f4ca62f5ed434fbbe9d25d 100644 (file)
@@ -149,7 +149,6 @@ maxcube: !include components/eq3max.yaml
 google_assistant: !include components/google_assistant.yaml
 
 # Mercedes Me
-#mbwebbeta: !include components/mercedesme.yaml
 mercedesmeapi: !include components/mercedesme.yaml
 
 # Weather
index 79c18f83dc094d259495a1e6e1d596f460c91583..ad059e5d0c09fea85a7b3f09085edf473ecf1711 100644 (file)
@@ -4,28 +4,27 @@
 
 # Binary Sensors
 binary_sensor.ff590mr_engine_light_warning:
-  friendly_name: Allarme Generale
+  friendly_name: Stato Generale
   device_class: problem
   icon: mdi:hazard-lights
-  # warningbrakefluid, warningcoolantlevellow, warningwashwater
+  # warningbrakefluid, warningwashwater, warningcoolantlevellow, warninglowbattery
 binary_sensor.ff590mr_park_brake_status:
   friendly_name: Freno a mano
   device_class: plug
   icon: mdi:car-brake-parking
+  # preWarningBrakeLiningWear
 binary_sensor.ff590mr_tire_warning:
   friendly_name: Allarme Pneumatici
   device_class: problem
   icon: mdi:car-tire-alert
-  # lastTirepressureTimestamp
-  # tireWarningRollup
-  # tirewarningsrdk
-  # tirepressureFrontLeft, tirepressureFrontRight, tirepressureRearLeft, tirepressureRearRight 
+  # tirepressureRearLeft, tirepressureRearRight, tirepressureFrontRight, tirepressureFrontLeft, 
+  # tirewarningsrdk, tirewarningsprwtireMarkerFrontRight, tireMarkerFrontLeft, tireMarkerRearLeft, tireMarkerRearRight, 
+  # tireWarningRollup, lastTirepressureTimestamp
 binary_sensor.ff590mr_windows_closed:
   friendly_name: Finestrini
   device_class: opening
   icon: mdi:window-closed
-  #icon: mdi:car-door
-  # windowstatusfrontleft, windowstatusfrontright, windowstatusrearleft, windowstatusrearright
+  # windowstatusrearleft, windowstatusrearright, windowstatusfrontright, windowstatusfrontleft
 
 # Lock
 lock.ff590mr_lock:
@@ -39,16 +38,11 @@ sensor.ff590mr_fuel_level:
 sensor.ff590mr_lock:
   friendly_name: Veicolo
   icon: mdi:lock-open
-# doorsClosed
-# frontLeftDoorLocked, frontLeftDoorClosed, doorStateFrontLeft
-# frontRightDoorLocked, frontRightDoorClosed, doorStateFrontRight
-# rearLeftDoorLocked, rearLeftDoorClosed, doorStateRearLeft
-# rearRightDoorLocked, rearRightDoorClosed, doorStateRearRight
-# trunkStateRollup
-sensor.ff590mr_odometer_2:
+  # doorStateFrontLeft, doorStateFrontRight, doorStateRearLeft, doorStateRearRight, 
+  # frontLeftDoorLocked, frontRightDoorLocked, rearLeftDoorLocked, rearRightDoorLocked, 
+  # frontLeftDoorClosed, frontRightDoorClosed, rearLeftDoorClosed, rearRightDoorClosed, 
+  # doorsClosed, trunkStateRollup, sunroofstatus
+sensor.ff590mr_odometer:
   friendly_name: Km Percorsi
   icon: mdi:road-variant
-# liquidconsumptionreset, liquidconsumptionstart, liquidRangeSkipIndication
-# tanklevelpercent, tankReserveLamp
-# serviceintervaldays
-# distanceReset, distanceStart
+  # distanceReset, distanceStart, liquidconsumptionstart, liquidconsumptionreset, liquidRangeSkipIndication, serviceintervaldays, tanklevelpercent, tankReserveLamp
index c0da6363e757ef4de05a5600d87b551c0be485c3..620c5b618ddb2e3ccdd6ca304cd9aeb57a9dd8e8 100644 (file)
@@ -372,11 +372,10 @@ views:
       - sensor.ff590mr_odometer
       - sensor.ff590mr_fuel_level
 #      - binary_sensor.ff590mr_park_brake_status
-#      - binary_sensor.ff590mr_status_decklid
-      - binary_sensor.ff590mr_engine_light_warning
+#      - binary_sensor.ff590mr_engine_light_warning
       - binary_sensor.ff590mr_locked
       - binary_sensor.ff590mr_doors_closed
-      - binary_sensor.ff590mr_windows_closed
+      - binary_sensor.ff590mr_windows_closed_2
     cards:
       #- type: gauge
       #  title: "Livello Carburante"
@@ -395,15 +394,16 @@ views:
         show_header_toggle: false
         entities:
           - lock.ff590mr_lock
-          - binary_sensor.ff590mr_park_brake_status
           - binary_sensor.ff590mr_locked
           - binary_sensor.ff590mr_doors_closed
-          - binary_sensor.ff590mr_windows_closed
+          - binary_sensor.ff590mr_windows_closed_2
+          - binary_sensor.ff590mr_park_brake_status
           #- device_tracker.wdd1760081v167576
       - type: entities
         title: "Mercedes A200d: Allarmi"
         show_header_toggle: false
         entities:
+          - binary_sensor.ff590mr_engine_light_warning
           - binary_sensor.ff590mr_warning_brakefluid
           - binary_sensor.ff590mr_warning_washwater
           - binary_sensor.ff590mr_warning_coolantlevellow