piitaya / lovelace-mushroom

Build a beautiful Home Assistant dashboard easily
Apache License 2.0
3.69k stars 340 forks source link

Feature Request: Vehicle Card #174

Closed Xelinor closed 2 years ago

Xelinor commented 2 years ago

Is your feature request related to a problem? Please describe. There are quite a few integrations that provide entities for vehicles today, but not a good way to visualize those entities in relation to the others. It's fine to see a long list of entites, but the reality is that it takes up a lot of space when a simple picture gives you same information in FAR less space and with greater cognitive understanding, and it's already a solved problem: It's in every car's dashboard.

So why not take that, and bring it to your home assistant dashboard.

Describe the solution you'd like

Describe alternatives you've considered I've implemented something similar with buttons in a grid today, and it looks okay, but still takes up a lot more space then I think a properly implemented card should.

My existing solution:

type: grid
cards:
  - type: grid
    cards:
      - type: grid
        cards:
          - type: gauge
            min: 0
            entity: sensor.distance_to_empty_toyota_highlander
            max: 500
            name: Distance to Empty
            severity:
              green: 150
              yellow: 50
              red: 0
            needle: true
          - type: gauge
            min: 0
            entity: sensor.next_service_toyota_highlander
            severity:
              green: 2000
              yellow: 500
              red: 0
            max: 5000
            name: Next Service Due
        square: false
        columns: 2
      - type: entities
        entities:
          - entity: sensor.odometer_toyota_highlander
      - type: grid
        cards:
          - type: button
            tap_action:
              action: more-info
            entity: sensor.tire_pressure_front_left_toyota_highlander
            name: Front Left Tire
            show_state: true
            hold_action:
              action: none
          - type: button
            tap_action:
              action: more-info
            entity: sensor.other_hood_toyota_highlander
            icon: mdi:train-car-passenger-door
            name: Hood
            show_state: true
            show_icon: true
            hold_action:
              action: none
          - type: button
            tap_action:
              action: more-info
            entity: sensor.tire_pressure_front_right_toyota_highlander
            show_state: true
            name: Front Right Tire
            hold_action:
              action: none
          - type: button
            tap_action:
              action: more-info
            entity: sensor.driver_side_door_toyota_highlander
            show_state: true
            name: Driver Side Door
            hold_action:
              action: none
          - type: button
            tap_action:
              action: call-service
              service: toyota_na.door_lock
              service_data:
                vehicle: ef1daa84f55cf42fd5b30b005ced4764
              target: {}
            icon: mdi:car-key
            hold_action:
              action: none
            name: Lock Car
            show_state: false
          - type: button
            tap_action:
              action: more-info
            entity: sensor.passenger_side_door_toyota_highlander
            show_state: true
            name: Passenger Side
            hold_action:
              action: none
          - type: button
            tap_action:
              action: more-info
            entity: sensor.driver_side_rear_door_toyota_highlander
            hold_action:
              action: none
            show_state: true
            name: Driver Side Rear Door
          - type: button
            tap_action:
              action: none
            hold_action:
              action: call-service
              service: toyota_na.engine_start
              service_data:
                vehicle: ef1daa84f55cf42fd5b30b005ced4764
              target: {}
            icon: mdi:engine
            name: Remote Start
          - type: button
            tap_action:
              action: more-info
            entity: sensor.passenger_side_rear_door_toyota_highlander
            show_state: true
            name: Passenger Side Rear Door
            hold_action:
              action: none
          - type: button
            tap_action:
              action: more-info
            entity: sensor.tire_pressure_rear_left_toyota_highlander
            name: Rear Left Tire
            show_state: true
            hold_action:
              action: none
          - type: button
            tap_action:
              action: more-info
            entity: sensor.other_hatch_toyota_highlander
            name: Rear Hatch
            show_state: true
            hold_action:
              action: none
            icon: mdi:car-back
          - type: button
            tap_action:
              action: more-info
            entity: sensor.tire_pressure_rear_right_toyota_highlander
            name: Rear Right Tire
            show_state: true
            hold_action:
              action: none
        square: false
    columns: 1
    square: false
square: false
columns: 1

Additional context I don't see this as having been solved properly by ANYONE in Home Assistant today, even though we have so many examples of this being implemented in other contexts. It's just more intuitive to understand given a simple diagram showing the state of the various sensors.

Some examples of other car 'status cards' in other contexts: https://cdn.dribbble.com/users/29543/screenshots/6231250/03-vehicle-status-control-app_4x.png https://www.mitsubishi-motors.com/en/products/pajero_sport/app/remote/img/slide_img_3_sp.png https://images.squarespace-cdn.com/content/v1/54663084e4b094164a00a57d/1625781054941-IVYE162SEGRGYL1NARW2/seatconnect.png https://www.nafisa.co.za/wp-content/uploads/2017/10/IMG_0024.jpg

In my head, with Mushroom, this would be generalized down to 2-3 car 'outlines' with doors being drawn when 'open' or a window down icon drawn with a pointer to the door when just a window is open, or a lock with a pointer line for unlocked, etc.

piitaya commented 2 years ago

Hello! Thanks for your request. Unfortunately there is no car entity in Home Assistant. A car is defined with combination of multiple entities (sensor, select, lock, etc...). It will be very hard to handled all cases (different for each car integration) so we will not do this in mushroom. Moreover, I could see in your example that you use custom service toyota_na.door_lock. Mushroom must keep independence from integrations

Maybe you can mix mushroom card and grid/vertical/horizontal layout to build your dashboard. For example, I have a printer and I created my dashboard with multiple cards :

image

Xelinor commented 2 years ago

Fair enough, I was suggesting a generic card to collect standard entities, not something specific to toyota's entities though. There is a reasonably common set of entities that can be predictably assumed where vehicles are concerned.