]> git.giorgioravera.it Git - homeassistant.git/commitdiff
Improvements in mercedes layout and minor fix to the package
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Wed, 6 Jan 2021 14:08:57 +0000 (15:08 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Wed, 6 Jan 2021 14:08:57 +0000 (15:08 +0100)
.storage/lovelace
.storage/lovelace_resources
packages/mercedes/mercedes_binary_sensor.yaml
packages/mercedes/mercedes_log.yaml
www/images/car/dashboard.png [new file with mode: 0644]

index 4c74282b78e321621da1b66c1fc551b4be2db6e2..e4bd137d3658c80b1717d7e04ccbede60610823f 100644 (file)
                     "id": "people",
                     "title": "People"
                 },
+                {
+                    "title": "car2",
+                    "path": "car2",
+                    "icon": "mdi:car",
+                    "panel": true,
+                    "badges": [],
+                    "cards": [
+                        {
+                            "type": "custom:layout-card",
+                            "layout": "vertical",
+                            "column_width": "50%",
+                            "cards": [
+                                {
+                                    "type": "picture-elements",
+                                    "image": "/local/images/car/dashboard.png",
+                                    "elements": [
+                                        {
+                                            "entity": "sensor.ff590mr_fuel_level",
+                                            "prefix": "",
+                                            "style": {
+                                                "transform": "translate(-50%, -50%) scale(1.3, 1.3)",
+                                                "color": "lightgrey",
+                                                "left": "8%",
+                                                "top": "17%"
+                                            },
+                                            "type": "state-label"
+                                        },
+                                        {
+                                            "entity": "sensor.ff590mr_odometer",
+                                            "prefix": " ",
+                                            "style": {
+                                                "transform": "translate(-50%, -50%) scale(1.3, 1.3)",
+                                                "color": "lightgrey",
+                                                "left": "28%",
+                                                "top": "17%"
+                                            },
+                                            "type": "state-label"
+                                        },
+                                        {
+                                            "entity": "sensor.ff590mr_service_interval_days",
+                                            "prefix": " ",
+                                            "style": {
+                                                "transform": "translate(-50%, -50%) scale(1.3, 1.3)",
+                                                "color": "lightgrey",
+                                                "left": "51%",
+                                                "top": "17%"
+                                            },
+                                            "type": "state-label"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_tire_warning",
+                                            "prefix": "",
+                                            "style": {
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "color": "#FFFFFF",
+                                                "left": "66.5%",
+                                                "top": "17.5%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_low_brake_fluid_warning",
+                                            "prefix": "",
+                                            "style": {
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "color": "#FFFFFF",
+                                                "left": "76%",
+                                                "top": "17.5%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_low_coolant_level_warning",
+                                            "prefix": "",
+                                            "style": {
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "color": "#FFFFFF",
+                                                "left": "85.5%",
+                                                "top": "17.5%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_low_wash_water_warning",
+                                            "prefix": "",
+                                            "style": {
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "color": "#FFFFFF",
+                                                "left": "95%",
+                                                "top": "17.5%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "sensor.ff590mr_tire_pressure_front_right",
+                                            "style": {
+                                                "transform": "translate(-50%, -50%) scale(0.8, 0.8)",
+                                                "color": "lightgrey",
+                                                "left": "38%",
+                                                "top": "32%"
+                                            },
+                                            "type": "state-label"
+                                        },
+                                        {
+                                            "entity": "sensor.ff590mr_tire_pressure_rear_right",
+                                            "style": {
+                                                "transform": "translate(-50%, -50%) scale(0.8, 0.8)",
+                                                "color": "lightgrey",
+                                                "left": "84%",
+                                                "top": "32%"
+                                            },
+                                            "type": "state-label"
+                                        },
+                                        {
+                                            "entity": "sensor.ff590mr_tire_pressure_front_left",
+                                            "style": {
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "color": "lightgrey",
+                                                "left": "38%",
+                                                "top": "90%"
+                                            },
+                                            "type": "state-label"
+                                        },
+                                        {
+                                            "entity": "sensor.ff590mr_tire_pressure_rear_left",
+                                            "style": {
+                                                "transform": "translate(-50%, -50%) scale(0.8, 0.8)",
+                                                "color": "lightgrey",
+                                                "left": "84%",
+                                                "top": "90%"
+                                            },
+                                            "type": "state-label"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_door_front_right",
+                                            "style": {
+                                                "--paper-item-icon-color": "white",
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "left": "61%",
+                                                "top": "38%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_door_rear_right",
+                                            "style": {
+                                                "--paper-item-icon-color": "white",
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "left": "68%",
+                                                "top": "38%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_door_front_left",
+                                            "style": {
+                                                "--paper-item-icon-color": "white",
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "left": "61%",
+                                                "top": "83%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_door_rear_left",
+                                            "style": {
+                                                "--paper-item-icon-color": "white",
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "left": "68%",
+                                                "top": "83%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_decklid",
+                                            "style": {
+                                                "--paper-item-icon-color": "white",
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "left": "95%",
+                                                "top": "60%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_window_front_right",
+                                            "style": {
+                                                "--paper-item-icon-color": "lightgrey",
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "left": "56%",
+                                                "top": "31%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_window_rear_right",
+                                            "style": {
+                                                "--paper-item-icon-color": "lightgrey",
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "left": "73%",
+                                                "top": "31%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_window_front_left",
+                                            "style": {
+                                                "--paper-item-icon-color": "lightgrey",
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "left": "56%",
+                                                "top": "90%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_window_rear_left",
+                                            "style": {
+                                                "--paper-item-icon-color": "lightgrey",
+                                                "transform": "translate(-50%, -50%) scale(0.7, 0.7)",
+                                                "left": "73%",
+                                                "top": "90%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_locked",
+                                            "prefix": "",
+                                            "style": {
+                                                "color": "#FFFFFF",
+                                                "left": "11%",
+                                                "top": "38%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_doors_closed",
+                                            "prefix": "",
+                                            "style": {
+                                                "color": "#FFFFFF",
+                                                "left": "11%",
+                                                "top": "49%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_windows_closed_2",
+                                            "prefix": "",
+                                            "style": {
+                                                "color": "#FFFFFF",
+                                                "left": "11%",
+                                                "top": "60%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "binary_sensor.ff590mr_decklid",
+                                            "prefix": "",
+                                            "style": {
+                                                "color": "#FFFFFF",
+                                                "left": "11%",
+                                                "top": "71%"
+                                            },
+                                            "type": "state-icon"
+                                        },
+                                        {
+                                            "entity": "device_tracker.ff590mr_device_tracker",
+                                            "prefix": "",
+                                            "style": {
+                                                "color": "lightgrey",
+                                                "left": "12%",
+                                                "top": "83%"
+                                            },
+                                            "type": "state-label"
+                                        }
+                                    ]
+                                },
+                                {
+                                    "type": "map",
+                                    "entities": [
+                                        {
+                                            "entity": "device_tracker.ff590mr_device_tracker"
+                                        }
+                                    ],
+                                    "hours_to_show": 12,
+                                    "dark_mode": true,
+                                    "default_zoom": 17
+                                }
+                            ]
+                        }
+                    ]
+                },
                 {
                     "icon": "mdi:car",
                     "id": "car",
                                     "entity": "binary_sensor.ff590mr_door_rear_right"
                                 },
                                 {
-                                    "entity": "binary_sensor.ff590mr_fuel_lid"
+                                    "entity": "binary_sensor.ff590mr_decklid"
                                 }
                             ],
                             "show_header_toggle": false,
index ddd69f930d5fe7639771ad92f6fec95f8497b674..2f027644905c2cd71d2c50033689cf021eaf9b2b 100644 (file)
                 "url": "/hacsfiles/lovelace-swipe-navigation/swipe-navigation.js",
                 "type": "module",
                 "id": "737d0af49e4a49c881d60ef2c724203a"
+            },
+            {
+                "url": "/hacsfiles/lovelace-card-mod/card-mod.js",
+                "type": "module",
+                "id": "1235e3ac5c7348f19284d47961cc2109"
             }
         ]
     }
index 9d517e43d44da8f4c824551b284418f7d9209966..23aabb48996572b7e8dc79c1d07ade96fa1c2a0b 100644 (file)
@@ -36,7 +36,12 @@ binary_sensor:
               is_state_attr('binary_sensor.ff590mr_windows_closed', 'doorstatusfrontright', 'false') and
               is_state_attr('binary_sensor.ff590mr_windows_closed', 'doorstatusrearleft', 'false') and
               is_state_attr('binary_sensor.ff590mr_windows_closed', 'doorstatusrearright', 'false')) }}
-        icon_template: mdi:car-door
+        icon_template: >-
+          {% if is_state('sensor.ff590mr_lock', '2',) %}
+            mdi:car-door-lock
+          {% else %}
+            mdi:car-door
+          {% endif %}
         device_class: opening
 
   ######################################################################
@@ -48,7 +53,16 @@ binary_sensor:
         friendly_name: Anteriore Sinistra
         value_template: >-
           {{ is_state_attr('sensor.ff590mr_lock', 'doorstatusfrontleft', '2') }}
-        icon_template: mdi:car-door
+        icon_template: >-
+          {% if is_state('sensor.ff590mr_lock', '2',) %}
+            mdi:car-door-lock
+          {% else %}
+            {% if not is_state_attr('sensor.ff590mr_lock', 'doorstatusfrontleft', true) %}
+              mdi:car-door
+            {% else %}
+              mdi:car-door
+            {% endif %}
+          {% endif %}
         device_class: opening
 
   ######################################################################
@@ -60,7 +74,16 @@ binary_sensor:
         friendly_name: Anteriore Destra
         value_template: >-
           {{ is_state_attr('sensor.ff590mr_lock', 'doorstatusfrontright', '2') }}
-        icon_template: mdi:car-door
+        icon_template: >-
+          {% if is_state('sensor.ff590mr_lock', '2',) %}
+            mdi:car-door-lock
+          {% else %}
+            {% if not is_state_attr('sensor.ff590mr_lock', 'doorstatusfrontright', true) %}
+              mdi:car-door
+            {% else %}
+              mdi:car-door
+            {% endif %}
+          {% endif %}
         device_class: opening
 
   ######################################################################
@@ -72,7 +95,16 @@ binary_sensor:
         friendly_name: Posteriore Sinistra
         value_template: >-     
           {{ is_state_attr('sensor.ff590mr_lock', 'doorstatusrearleft', '2') }}
-        icon_template: mdi:car-door
+        icon_template: >-
+          {% if is_state('sensor.ff590mr_lock', '2',) %}
+            mdi:car-door-lock
+          {% else %}
+            {% if not is_state_attr('sensor.ff590mr_lock', 'doorstatusrearleft', true) %}
+              mdi:car-door
+            {% else %}
+              mdi:car-door
+            {% endif %}
+          {% endif %}
         device_class: opening
 
   ######################################################################
@@ -84,45 +116,56 @@ binary_sensor:
         friendly_name: Posteriore Destra
         value_template: >-
           {{ is_state_attr('sensor.ff590mr_lock', 'doorstatusrearright', '2') }}
-        icon_template: mdi:car-door
+        icon_template: >-
+          {% if is_state('sensor.ff590mr_lock', '2',) %}
+            mdi:car-door-lock
+          {% else %}
+            {% if not is_state_attr('sensor.ff590mr_lock', 'doorstatusrearright', true) %}
+              mdi:car-door
+            {% else %}
+              mdi:car-door
+            {% endif %}
+          {% endif %}
         device_class: opening
 
   ######################################################################
-  # Binary Sensor: Trunk
-  ######################################################################
-  #- platform: template
-  #  sensors:
-  #    ff590mr_trunk:
-  #      friendly_name: Bagagliaio
-  #      value_template: >-
-  #        {{ not (is_state_attr('sensor.ff590mr_lock', 'trunkStateRollup', 'CLOSED_AND_LOCKED') or
-  #                is_state_attr('sensor.ff590mr_lock', 'trunkStateRollup', 'CLOSED_AND_UNLOCKED')) }}
-  #      icon_template: >-
-  #        {% if (is_state_attr('sensor.ff590mr_lock', 'trunkStateRollup', 'CLOSED_AND_LOCKED') or 
-  #               is_state_attr('sensor.ff590mr_lock', 'trunkStateRollup', 'CLOSED_AND_UNLOCKED')) %}
-  #          mdi:lock
-  #        {% else %}
-  #          mdi:lock-open
-  #        {% endif %}
-  #      device_class: opening
-
-  ######################################################################
-  # Binary Sensor: Deck Lid
+  # Binary Sensor: Decklid
   ######################################################################
   - platform: template
     sensors:
-      ff590mr_fuel_lid:
-        friendly_name: Serbatoio
+      ff590mr_decklid:
+        friendly_name: Bagagliaio
         value_template: >-
           {{ is_state_attr('sensor.ff590mr_lock', 'decklidstatus', true) }}
         icon_template: >-
-          {% if is_state_attr('sensor.ff590mr_lock', 'decklidstatus', true) %}
-            mdi:gas-station
+          {% if is_state('sensor.ff590mr_lock', '2',) %}
+            mdi:car-door-lock
           {% else %}
-            mdi:gas-station
+            {% if not is_state_attr('sensor.ff590mr_lock', 'decklidstatus', true) %}
+              mdi:car-door
+            {% else %}
+              mdi:car-door
+            {% endif %}
           {% endif %}
         device_class: opening
 
+  ######################################################################
+  # Binary Sensor: Serbatoio
+  ######################################################################
+  #- platform: template
+  #  sensors:
+  #    ff590mr_fuellid:
+  #      friendly_name: Serbatoio
+  #      value_template: >-
+  #        {{ is_state_attr('sensor.ff590mr_lock', 'decklidstatus', true) }}
+  #      icon_template: >-
+  #        {% if is_state_attr('sensor.ff590mr_lock', 'decklidstatus', true) %}
+  #          mdi:gas-station
+  #        {% else %}
+  #          mdi:gas-station
+  #        {% endif %}
+  #      device_class: opening
+
   ######################################################################
   # Binary Sensor: Windows Closed
   ######################################################################
index 3fa36d0c17127fb898b0629284179ed604786778..52cbb20bb58442af57ce3139e1d32f9e98065820 100644 (file)
@@ -12,14 +12,13 @@ history:
     - binary_sensor.ff590mr_door_rear_right\r
     #- binary_sensor.ff590mr_doors_closed\r
     - binary_sensor.ff590mr_engine_light_warning\r
-    - binary_sensor.ff590mr_fuel_lid\r
     #- binary_sensor.ff590mr_locked\r
     - binary_sensor.ff590mr_low_brake_fluid_warning\r
     - binary_sensor.ff590mr_low_coolant_level_warning\r
     - binary_sensor.ff590mr_low_wash_water_warning\r
     - binary_sensor.ff590mr_tire_warning\r
-    - binary_sensor.ff590mr_trunk\r
-    - binary_sensor.ff590mr_fuel_lid\r
+    - binary_sensor.ff590mr_decklid\r
+    - binary_sensor.ff590mr_fuellid\r
     - binary_sensor.ff590mr_window_front_left\r
     - binary_sensor.ff590mr_window_front_right\r
     - binary_sensor.ff590mr_window_rear_left\r
@@ -38,7 +37,6 @@ history:
     - sensor.ff590mr_tire_pressure_front_right\r
     - sensor.ff590mr_tire_pressure_rear_left\r
     - sensor.ff590mr_tire_pressure_rear_right\r
-    - sensor.ff590mr_trunk\r
 \r
 ######################################################################\r
 # Mercedes Package - Logbook\r
@@ -54,14 +52,13 @@ logbook:
     - binary_sensor.ff590mr_door_rear_right\r
     #- binary_sensor.ff590mr_doors_closed\r
     - binary_sensor.ff590mr_engine_light_warning\r
-    - binary_sensor.ff590mr_fuel_lid\r
     #- binary_sensor.ff590mr_locked\r
     - binary_sensor.ff590mr_low_brake_fluid_warning\r
     - binary_sensor.ff590mr_low_coolant_level_warning\r
     - binary_sensor.ff590mr_low_wash_water_warning\r
     - binary_sensor.ff590mr_tire_warning\r
-    - binary_sensor.ff590mr_trunk\r
-    - binary_sensor.ff590mr_fuel_lid\r
+    - binary_sensor.ff590mr_decklid\r
+    - binary_sensor.ff590mr_fuellid\r
     - binary_sensor.ff590mr_window_front_left\r
     - binary_sensor.ff590mr_window_front_right\r
     - binary_sensor.ff590mr_window_rear_left\r
@@ -80,7 +77,6 @@ logbook:
     - sensor.ff590mr_tire_pressure_front_right\r
     - sensor.ff590mr_tire_pressure_rear_left\r
     - sensor.ff590mr_tire_pressure_rear_right\r
-    - sensor.ff590mr_trunk\r
 \r
 ######################################################################\r
 # Mercedes Package - Recorder\r
@@ -96,14 +92,13 @@ recorder:
     - binary_sensor.ff590mr_door_rear_right\r
     #- binary_sensor.ff590mr_doors_closed\r
     - binary_sensor.ff590mr_engine_light_warning\r
-    - binary_sensor.ff590mr_fuel_lid\r
     #- binary_sensor.ff590mr_locked\r
     - binary_sensor.ff590mr_low_brake_fluid_warning\r
     - binary_sensor.ff590mr_low_coolant_level_warning\r
     - binary_sensor.ff590mr_low_wash_water_warning\r
     - binary_sensor.ff590mr_tire_warning\r
-    - binary_sensor.ff590mr_trunk\r
-    - binary_sensor.ff590mr_fuel_lid\r
+    - binary_sensor.ff590mr_decklid\r
+    - binary_sensor.ff590mr_fuellid\r
     - binary_sensor.ff590mr_window_front_left\r
     - binary_sensor.ff590mr_window_front_right\r
     - binary_sensor.ff590mr_window_rear_left\r
@@ -122,4 +117,3 @@ recorder:
     - sensor.ff590mr_tire_pressure_front_right\r
     - sensor.ff590mr_tire_pressure_rear_left\r
     - sensor.ff590mr_tire_pressure_rear_right\r
-    - sensor.ff590mr_trunk\r
diff --git a/www/images/car/dashboard.png b/www/images/car/dashboard.png
new file mode 100644 (file)
index 0000000..698ba87
Binary files /dev/null and b/www/images/car/dashboard.png differ