]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Starting migration to new mercedes api
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Fri, 7 Jun 2019 07:33:04 +0000 (09:33 +0200)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Fri, 7 Jun 2019 07:33:04 +0000 (09:33 +0200)
binary_sensor/car.yaml
components/mercedesme.yaml
configuration.yaml
customizations/car.yaml
logger.yaml
ui-lovelace.yaml

index e26d2210c62139d6fabfa53acc4557c9a1ed1f17..1fdc93d538f08c9f1229f2128f0cd04401680b8a 100644 (file)
         {% endif %}
 
 ######################################################################
-# Binary Sensor: Car Windows Lock
+# Binary Sensor: Doors Closed
 ######################################################################
 
 - platform: template
   sensors:
-    car_windows_lock:
-      friendly_name: Chiusura Finestrini
+    ff590mr_doors_closed:
+      friendly_name: Chiusura Porte
       device_class: lock
       entity_id: 
-        - sensor.ff590mr_window_front_left 
-        - sensor.ff590mr_window_front_right
-        - sensor.ff590mr_window_rear_left
-        - sensor.ff590mr_window_rear_right
+        - sensor.ff590mr_lock
       value_template: >-
-        {{ not (is_state('sensor.ff590mr_window_front_left', '2') 
-           and is_state('sensor.ff590mr_window_front_right', '2')
-           and is_state('sensor.ff590mr_window_rear_left', '2')
-           and is_state('sensor.ff590mr_window_rear_right', '2') ) }}
+        {{ 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') }}
       icon_template: >-
-        {% if is_state('sensor.ff590mr_window_front_left', '2') 
-           and is_state('sensor.ff590mr_window_front_right', '2')
-           and is_state('sensor.ff590mr_window_rear_left', '2')
-           and is_state('sensor.ff590mr_window_rear_right', '2') %}
-          mdi:window-closed
+        {% 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') %}
+          mdi:car-door
         {% else %}
-          mdi:window-open
-        {% endif %}
\ No newline at end of file
+          mdi:car-door
+        {% endif %}
+
+######################################################################
+# Binary Sensor: Decklid Status
+######################################################################
+
+- platform: template
+  sensors:
+    ff590mr_status_decklid:
+      friendly_name: Bagagliaio
+      device_class: opening
+      entity_id: sensor.ff590mr_lock
+      value_template: >-
+        {{ not is_state_attr('sensor.ff590mr_lock', 'trunkStateRollup', 'CLOSED_AND_LOCKED') }}
+      icon_template: >-
+        {% if is_state('sensor.ff590mr_lock', 'CLOSED_AND_LOCKED') %}
+          mdi:lock
+        {% else %}
+          mdi:lock-open
+        {% endif %}
+
+######################################################################
+# Binary Sensor: Warning Brake fluid
+######################################################################
+
+- platform: template
+  sensors:
+    ff590mr_warning_brakefluid:
+      friendly_name: Liquido freni
+      device_class: problem
+      entity_id: binary_sensor.ff590mr_engine_light_warning
+      value_template: >-
+        {{ is_state_attr('binary_sensor.ff590mr_engine_light_warning', 'warningbrakefluid', 'true') }}
+
+######################################################################
+# Binary Sensor: Warning washwater
+######################################################################
+
+- platform: template
+  sensors:
+    ff590mr_warning_washwater:
+      friendly_name: Liquido lavacristalli
+      device_class: problem
+      entity_id: binary_sensor.ff590mr_engine_light_warning
+      value_template: >-
+        {{ is_state_attr('binary_sensor.ff590mr_engine_light_warning', 'warningwashwater', 'true') }}
+
+######################################################################
+# Binary Sensor: Warning coolant level low
+######################################################################
+
+- platform: template
+  sensors:
+    ff590mr_warning_coolantlevellow:
+      friendly_name: Liquido raffreddamento
+      device_class: problem
+      entity_id: binary_sensor.ff590mr_engine_light_warning
+      value_template: >-
+        {{ is_state_attr('binary_sensor.ff590mr_engine_light_warning', 'warningcoolantlevellow', 'true') }}
index dcb229c7d15d0106fbda0958e3a67a349d198083..614ad85a73d665e6e13da38e5aa3ed2a250be0e2 100644 (file)
@@ -4,4 +4,8 @@
 
 username: !secret mb_user
 password: !secret mb_password
-scan_interval: 120
+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 
+#scan_interval: 120
index fb3783207f717f9cab828dc269ed0683d2cd5860..6274e41d02798655fb1ba44242cfc985a4b3c1d4 100644 (file)
@@ -149,7 +149,8 @@ maxcube: !include components/eq3max.yaml
 google_assistant: !include components/google_assistant.yaml
 
 # Mercedes Me
-mbwebbeta: !include components/mercedesme.yaml
+#mbwebbeta: !include components/mercedesme.yaml
+mercedesmeapi: !include components/mercedesme.yaml
 
 # Weather
 weather: !include components/weather.yaml
index 080366e15a8313c0d97e2e49916e9971900d8ed4..c26e7478ae2fffd22edc6d033f124b038289e465 100644 (file)
@@ -2,23 +2,62 @@
 # Mercedes Me 
 ######################################################################
 
-# Sensori
-binary_sensor.ff590mr_decklid_status:
-  friendly_name: Bagagliaio
-  device_class: opening
-binary_sensor.ff590mr_warning_washwater:
-  friendly_name: Liquido lavacristalli
-  device_class: problem
-binary_sensor.ff590mr_warning_brakefluid:
-  friendly_name: Liquido freni
+# Binary Sensors
+binary_sensor.ff590mr_engine_light_warning:
+  friendly_name: Allarme Generale
   device_class: problem
-binary_sensor.ff590mr_parkbrake_status:
+  icon: mdi:hazard-lights
+  # warningbrakefluid, warningcoolantlevellow, warningwashwater
+binary_sensor.ff590mr_park_brake_status:
   friendly_name: Freno a mano
   device_class: plug
   icon: mdi:car-brake-parking
-binary_sensor.ff590mr_warning_engine_light:
-  friendly_name: Allarme Motore
+binary_sensor.ff590mr_tire_warning:
+  friendly_name: Allarme Pneumatici
   device_class: problem
+  icon: mdi:car-tire-alert
+  # lastTirepressureTimestamp
+  # tireWarningRollup
+  # tireMarkerFrontLeft, tireMarkerRearLeft, tireMarkerRearRight
+  # tirepressureFrontLeft, tirepressureFrontRight, tirepressureRearLeft, tirepressureRearRight 
+binary_sensor.ff590mr_windows_closed:
+  friendly_name: Finestrini
+  device_class: opening
+  icon: mdi:window-closed
+  #icon: mdi:car-door
+  # windowstatusfrontleft, windowstatusfrontright, windowstatusrearleft, windowstatusrearright
+
+# Lock
+lock.ff590mr_lock:
+  friendly_name: Blocco Sblocco 
+  icon: mdi:lock-open
+  
+# Sensors
+sensor.ff590mr_fuel_level:
+  friendly_name: Livello Carburante
+  icon: mdi:gas-station
+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:
+  friendly_name: Km Percorsi
+  icon: mdi:road-variant
+# liquidconsumptionreset, liquidconsumptionstart, liquidRangeSkipIndication
+# tanklevelpercent, tankReserveLamp
+# serviceintervaldays
+# distanceReset, distanceStart
+
+
+
+
+
+
 
 # Pressione gomme
 sensor.ff590mr_tire_pressure_front_left:
@@ -89,12 +128,6 @@ sensor.ff590mr_licenseplate:
 #  friendly_name:
 #sensor.ff590mr_liquid_consumption_start:
 #  friendly_name:
-sensor.ff590mr_odometer:
-  friendly_name: Km Percorsi
-  icon: mdi:road-variant
-sensor.ff590mr_tank_level:
-  friendly_name: Livello Carburante
-  icon: mdi:gas-station
 sensor.ff590mr_distance_since_reset:
   friendly_name: Distanza dal reset
   icon: mdi:road-variant
index 7a3723158fec5ef059e327a6d1f1de4803e1acfb..03146ff0eb89d98a0dc32de189051d9f3dc13e19 100644 (file)
@@ -8,5 +8,4 @@ logs:
   homeassistant.components.automation: info\r
   homeassistant.components.device_tracker: warn\r
   homeassistant.components.input_text: info\r
-  custom_components.mbwebbeta: warn\r
-  mbwebapppy.controller: warn\r
+  custom_components.mercedesmeapi: warn\r
index 18a2781fa12dc211c2e3671d0ee5137c1fa17cda..2f57a4fa33efd6278e06b1fe4570d4a4dab94ae0 100644 (file)
@@ -370,11 +370,14 @@ views:
     badges:
       - device_tracker.wdd1760081v167576  
       - sensor.ff590mr_odometer
-      - sensor.ff590mr_tank_level
-      - binary_sensor.car_doors_lock
-      - binary_sensor.car_windows_lock
-      - binary_sensor.ff590mr_parkbrake_status
-      - binary_sensor.ff590mr_decklid_status
+      - sensor.ff590mr_fuel_level
+#      - binary_sensor.ff590mr_park_brake_status
+#      - binary_sensor.ff590mr_status_decklid
+      - binary_sensor.ff590mr_engine_light_warning
+      - binary_sensor.ff590mr_tire_warning
+      - binary_sensor.ff590mr_doors_closed
+      - binary_sensor.ff590mr_windows_closed
+      - lock.ff590mr_lock
     cards:
       #- type: gauge
       #  title: "Livello Carburante"
@@ -389,11 +392,11 @@ views:
         title: "Mercedes A200d: Sensori"
         show_header_toggle: false
         entities:
-          - binary_sensor.ff590mr_parkbrake_status
-          - binary_sensor.ff590mr_decklid_status
-          - binary_sensor.ff590mr_warning_washwater
+          - binary_sensor.ff590mr_park_brake_status
+          - binary_sensor.ff590mr_status_decklid
           - binary_sensor.ff590mr_warning_brakefluid
-          - binary_sensor.ff590mr_warning_engine_light
+          - binary_sensor.ff590mr_warning_washwater
+          - binary_sensor.ff590mr_warning_coolantlevellow
           #- device_tracker.wdd1760081v167576
 
       - type: entities
@@ -445,7 +448,7 @@ views:
           - sensor.ff590mr_licenseplate
           - sensor.ff590mr_liquid_consumption_reset
           - sensor.ff590mr_liquid_consumption_start
-          #- sensor.ff590mr_odometer
+          - sensor.ff590mr_odometer_2
           #- sensor.ff590mr_liquid_range
           #- sensor.ff590mr_electric_distance_since_start
           #- sensor.ff590mr_tank_level