From: Giorgio Ravera Date: Wed, 6 Jan 2021 14:08:57 +0000 (+0100) Subject: Improvements in mercedes layout and minor fix to the package X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=c23f6119ed2ed3b61025e8ec415b483ab23e75d4;p=homeassistant.git Improvements in mercedes layout and minor fix to the package --- diff --git a/.storage/lovelace b/.storage/lovelace index 4c74282b..e4bd137d 100644 --- a/.storage/lovelace +++ b/.storage/lovelace @@ -666,6 +666,296 @@ "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", @@ -755,7 +1045,7 @@ "entity": "binary_sensor.ff590mr_door_rear_right" }, { - "entity": "binary_sensor.ff590mr_fuel_lid" + "entity": "binary_sensor.ff590mr_decklid" } ], "show_header_toggle": false, diff --git a/.storage/lovelace_resources b/.storage/lovelace_resources index ddd69f93..2f027644 100644 --- a/.storage/lovelace_resources +++ b/.storage/lovelace_resources @@ -42,6 +42,11 @@ "url": "/hacsfiles/lovelace-swipe-navigation/swipe-navigation.js", "type": "module", "id": "737d0af49e4a49c881d60ef2c724203a" + }, + { + "url": "/hacsfiles/lovelace-card-mod/card-mod.js", + "type": "module", + "id": "1235e3ac5c7348f19284d47961cc2109" } ] } diff --git a/packages/mercedes/mercedes_binary_sensor.yaml b/packages/mercedes/mercedes_binary_sensor.yaml index 9d517e43..23aabb48 100644 --- a/packages/mercedes/mercedes_binary_sensor.yaml +++ b/packages/mercedes/mercedes_binary_sensor.yaml @@ -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 ###################################################################### diff --git a/packages/mercedes/mercedes_log.yaml b/packages/mercedes/mercedes_log.yaml index 3fa36d0c..52cbb20b 100644 --- a/packages/mercedes/mercedes_log.yaml +++ b/packages/mercedes/mercedes_log.yaml @@ -12,14 +12,13 @@ history: - binary_sensor.ff590mr_door_rear_right #- binary_sensor.ff590mr_doors_closed - binary_sensor.ff590mr_engine_light_warning - - binary_sensor.ff590mr_fuel_lid #- binary_sensor.ff590mr_locked - binary_sensor.ff590mr_low_brake_fluid_warning - binary_sensor.ff590mr_low_coolant_level_warning - binary_sensor.ff590mr_low_wash_water_warning - binary_sensor.ff590mr_tire_warning - - binary_sensor.ff590mr_trunk - - binary_sensor.ff590mr_fuel_lid + - binary_sensor.ff590mr_decklid + - binary_sensor.ff590mr_fuellid - binary_sensor.ff590mr_window_front_left - binary_sensor.ff590mr_window_front_right - binary_sensor.ff590mr_window_rear_left @@ -38,7 +37,6 @@ history: - sensor.ff590mr_tire_pressure_front_right - sensor.ff590mr_tire_pressure_rear_left - sensor.ff590mr_tire_pressure_rear_right - - sensor.ff590mr_trunk ###################################################################### # Mercedes Package - Logbook @@ -54,14 +52,13 @@ logbook: - binary_sensor.ff590mr_door_rear_right #- binary_sensor.ff590mr_doors_closed - binary_sensor.ff590mr_engine_light_warning - - binary_sensor.ff590mr_fuel_lid #- binary_sensor.ff590mr_locked - binary_sensor.ff590mr_low_brake_fluid_warning - binary_sensor.ff590mr_low_coolant_level_warning - binary_sensor.ff590mr_low_wash_water_warning - binary_sensor.ff590mr_tire_warning - - binary_sensor.ff590mr_trunk - - binary_sensor.ff590mr_fuel_lid + - binary_sensor.ff590mr_decklid + - binary_sensor.ff590mr_fuellid - binary_sensor.ff590mr_window_front_left - binary_sensor.ff590mr_window_front_right - binary_sensor.ff590mr_window_rear_left @@ -80,7 +77,6 @@ logbook: - sensor.ff590mr_tire_pressure_front_right - sensor.ff590mr_tire_pressure_rear_left - sensor.ff590mr_tire_pressure_rear_right - - sensor.ff590mr_trunk ###################################################################### # Mercedes Package - Recorder @@ -96,14 +92,13 @@ recorder: - binary_sensor.ff590mr_door_rear_right #- binary_sensor.ff590mr_doors_closed - binary_sensor.ff590mr_engine_light_warning - - binary_sensor.ff590mr_fuel_lid #- binary_sensor.ff590mr_locked - binary_sensor.ff590mr_low_brake_fluid_warning - binary_sensor.ff590mr_low_coolant_level_warning - binary_sensor.ff590mr_low_wash_water_warning - binary_sensor.ff590mr_tire_warning - - binary_sensor.ff590mr_trunk - - binary_sensor.ff590mr_fuel_lid + - binary_sensor.ff590mr_decklid + - binary_sensor.ff590mr_fuellid - binary_sensor.ff590mr_window_front_left - binary_sensor.ff590mr_window_front_right - binary_sensor.ff590mr_window_rear_left @@ -122,4 +117,3 @@ recorder: - sensor.ff590mr_tire_pressure_front_right - sensor.ff590mr_tire_pressure_rear_left - sensor.ff590mr_tire_pressure_rear_right - - sensor.ff590mr_trunk diff --git a/www/images/car/dashboard.png b/www/images/car/dashboard.png new file mode 100644 index 00000000..698ba873 Binary files /dev/null and b/www/images/car/dashboard.png differ