/device-card

Device Card to summarize device information in Home Assistant

Primary LanguageTypeScriptMIT LicenseMIT

Device Card

A comprehensive card to display and organize your Home Assistant device entities

Home Assistant hacs_badge

GitHub Release GitHub Pre-Release GitHub Tag GitHub branch status

stars home commits license

Built with the tools and technologies:

npm Prettier TypeScript GitHub%20Actions Lit


Overview

A custom card for Home Assistant that provides a comprehensive overview of any device in your system. The card organizes device information into expandable sections, displaying sensors, controls, configuration options, and diagnostic data in a clean, user-friendly interface.

Features

Device Information Display

  • Shows device name and model information
  • Organizes entities into logical categories:
    • Controls - for interactive elements like buttons and switches
    • Sensors - for data readings and status information
    • Configuration - for device settings
    • Diagnostic - for troubleshooting information

device-sections

Problem Detection

  • Automatically detects entities labeled as "problem" in the device based on their device_class
  • Visual indication when problems are detected (card border turns red)
  • Easy identification of issues requiring attention
  • Problem entities show a green or red indicator to their left

problem-detection

Entity Pictures

With an optional flag, you can showcase entity pictures when available. There must exist an entity with an entity_picture attribute.

entity-pictures

Expandable Sections

  • Collapsible sections for better organization of information
  • Preview counts for sensors to reduce visual clutter
  • Ability to expand sections to see all entities

expanded

Entity Attributes

  • Click an entity to expand it and show it's attributes

attributes

Visual Styling

  • Consistent with Home Assistant design language
  • Responsive layout that works on both desktop and mobile
  • Clear visual hierarchy for easy reading

Installation

HACS (Recommended)

HACS

  1. Open HACS in your Home Assistant instance
  2. Click the menu icon in the top right and select "Custom repositories"
  3. Add this repository URL and select "Dashboard" as the category
    • https://github.com/homeassistant-extras/device-card
  4. Click "Install"

Manual Installation

  1. Download the device-card.js file from the latest release in the Releases tab.
  2. Copy it to your www/community/device-card/ folder
  3. Add the following to your configuration.yaml (or add as a resource in dashboards menu)
lovelace:
  resources:
    - url: /local/community/device-card/device-card.js
      type: module

Usage

Add the card to your dashboard using the UI editor or YAML:

Card Editor

The card is fully configurable in the UI editor. Simply select "Custom: Device Card" when adding a new card to your dashboard, then select your device from the dropdown.

editor

YAML

This is the most minimal configuration needed to get started:

type: custom:device-card
device_id: YOUR_DEVICE_ID

The card will automatically:

  • Display the device name and model information
  • Organize all entities related to the device into appropriate sections
  • Show collapsible sections for Controls, Configuration, Sensors, and Diagnostics
  • Highlight any detected problems

Configuration Options

Name Type Default Description
device_id string Required The Home Assistant device ID for your device
title string Device name Optional custom title for the card
preview_count number All items Number of items to preview before showing "Show More" button
exclude_sections list none Sections of entities to exclude. See below.
exclude_entities list none Entities to remove from the card.
features list See below Optional flags to toggle different features

Feature Options

Name Type Description
entity_picture flag Show entity picture when available

Section Exclude Options

  • controls
  • configurations
  • sensors
  • diagnostics

Example Configurations

Basic Configuration

type: custom:device-card
device_id: 1a2b3c4d5e6f7g8h9i0j

Custom Title and Preview Count

type: custom:device-card
device_id: 1a2b3c4d5e6f7g8h9i0j
title: Living Room Thermostat
preview_count: 3

With Entity Picture

type: custom:device-card
device_id: 1a2b3c4d5e6f7g8h9i0j
features:
  - entity_picture

Excluding some enities and sections

type: custom:device-card
device_id: 1a2b3c4d5e6f7g8h9i0j
exclude_sections:
  - controls
  - configurations
  - diagnostics
exclude_entities:
  - update.home_assistant_core_update

Project Roadmap

  • Initial design: Create initial card design
  • Enhanced customization: Add more customization options
  • Status badges: Quick status badges for device state
  • Device filtering: Filter specific entities from display

Contributing

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/homeassistant-extras/device-card
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!

License

This project is protected under the MIT License. For more details, refer to the LICENSE file.

Acknowledgments

  • Built using LitElement
  • Inspired by Home Assistant's chip design
  • Thanks to all contributors!

contributors

ko-fi

Code Quality

Stats

Bugs Vulnerabilities Code Smells Technical Debt Duplicated Lines (%) Lines of Code Coverage

Ratings

Quality Gate Status Reliability Rating Security Rating Maintainability Rating

Build Status

Main

Bump & Tag Fast Forward Check

Release

Bump & Tag Merge