From: Giorgio Ravera Date: Fri, 7 Jun 2019 20:11:00 +0000 (+0200) Subject: Fixed car sensors (door, window and lock) X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=b83bab4d2c3c1cce799e0b4d21102b06777deda7;p=homeassistant.git Fixed car sensors (door, window and lock) --- diff --git a/binary_sensor/car.yaml b/binary_sensor/car.yaml index e6da6be5..d245235d 100644 --- a/binary_sensor/car.yaml +++ b/binary_sensor/car.yaml @@ -27,15 +27,15 @@ 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 @@ -123,6 +123,32 @@ {% 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 ###################################################################### diff --git a/components/mercedesme.yaml b/components/mercedesme.yaml index 614ad85a..c3ff54b2 100644 --- a/components/mercedesme.yaml +++ b/components/mercedesme.yaml @@ -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 diff --git a/configuration.yaml b/configuration.yaml index 6274e41d..7c14aeec 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -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 diff --git a/customizations/car.yaml b/customizations/car.yaml index 79c18f83..ad059e5d 100644 --- a/customizations/car.yaml +++ b/customizations/car.yaml @@ -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 diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index c0da6363..620c5b61 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -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