8000 GitHub - homeassistant-extras/pi-hole-card: Card to summarize information for, and to control your Pi-Hole 6 instance!
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Card to summarize information for, and to control your Pi-Hole 6 instance!

License

Notifications You must be signed in to change notification settings

homeassistant-extras/pi-hole-card

Repository files navigation

Pi-hole Card

Pi-hole Card

Complete Pi-hole monitoring and control for Home Assistant

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 comprehensive dashboard card for managing and monitoring your Pi-hole DNS ad blocker directly from Home Assistant. The card provides real-time statistics and controls in an intuitive, dashboard-style interface that matches the Pi-hole visual identity.

Features

Dashboard Statistics

  • Main Statistics Dashboard - Four color-coded tiles showing your most important Pi-hole metrics:
    • Total DNS Queries
    • Queries Blocked
    • Block Percentage
    • Domains on Blocklists

Dashboard Statistics

Additional Metrics

  • Client Statistics - See active clients, unique domains, unique clients, and time remaining
  • Performance Data - View cached queries and forwarded DNS requests
  • Interactive Elements - Configurable tap, hold, and double-tap actions for all metrics

Additional Metrics

Additional Metrics

Direct Controls

  • Enable/Disable Controls - Toggle Pi-hole filtering with a single click as well as Group Default
  • Action Buttons - Quick access buttons for common maintenance tasks:
    • Refresh Data
    • Restart DNS
    • Update Gravity
    • Flush ARP
    • Flush Logs
  • Customizable Actions - Configure custom actions for the control buttons in this section

Control Buttons

Control Buttons

Version Information

  • Component Versions - Display installed versions for all Pi-hole components:
    • Core
    • Docker
    • FTL
    • Web Interface
    • Home Assistant Integration

Version Information

Status Monitoring

  • Real-time Status - Visual indication of Pi-hole's current state
  • Error Detection - Automatic highlighting when issues are detected
  • Update Indicators - Clear notification when updates are available

Interactive Dashboard

  • Clickable Elements - All sections can be configured with custom actions
  • Visual Indicators - Color-coded statistics to understand status at a glance
  • Customizable Card - Set custom title and icon to match your dashboard style

Responsive Design

  • Mobile-friendly - Optimized layout for both desktop and mobile viewing
  • Fluid Layout - Responsive design adapts to available space

Responsive Design Responsive Design

Installation

Prerequisites

Warning

Before using this card, please ensure you have the Pi-hole v6 integration installed in your Home Assistant instance.

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/pi-hole-card
  4. Click "Install"

Manual Installation

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

Usage

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

Card Editor

The card is fully configurable through the card editor, allowing you to customize:

  • Pi-hole device selection
  • Card title and icon
  • Custom actions for statistics, info panels, and control buttons

editor

YAML

This is the most minimal configuration needed to get started:

type: custom:pi-hole
device_id: your_pihole_device_id

The card will automatically:

  • Detect all Pi-hole entities associated with the device
  • Organize statistics in the dashboard layout
  • Display control buttons for common actions
  • Show version information for all components

Configuration Options

Name Type Default Description
device_id string Required The ID of your Pi-hole device in Home Assistant
title string Pi-Hole Custom title for the card header
icon string mdi:pi-hole Custom icon for the card header
stats object optional Configure actions for statistics tiles
info object optional Configure actions for additional info items
controls object optional Configure actions for control buttons

Action Configuration

Each section (stats, info, controls) supports the following action types:

Name Type Default Description
tap_action object optional Action to perform when tapped
hold_action object optional Action to perform when held
double_tap_action object optional Action to perform when double-tapped

Actions can be configured to perform various operations such as:

  • Toggle entities
  • Show more info
  • Call services
  • Navigate to different views
  • And more!

Auto-discovery

The card automatically discovers and identifies all Pi-hole entities based on:

  • Entity naming patterns
  • Translation keys
  • Entity relationships to the device

This includes sensors, buttons, switches, binary sensors, and update entities.

Example Configurations

Basic Configuration

type: custom:pi-hole
device_id: pi_hole_device_1

With Custom Title and Icon

type: custom:pi-hole
device_id: pi_hole_device_1
title: 'My Pi-hole Server'
icon: 'mdi:shield-check'

With Custom Actions

type: custom:pi-hole
device_id: pi_hole_device_1
title: 'Network Protection'
stats:
  tap_action:
    action: more-info
  hold_action:
    action: navigate
    navigation_path: /lovelace/network
controls:
  tap_action:
    action: toggle
  hold_action:
    action: more-info

Custom Actions for All Sections

type: custom:pi-hole
device_id: pi_hole_device_1
# Configure stat box actions
stats:
  tap_action:
    action: call-service
    perform_action: browser_mod.popup
    data:
      title: Pi-hole Statistics
      content: 'Detailed view of Pi-hole stats'
  hold_action:
    action: navigate
    navigation_path: /lovelace/network-monitoring
# Configure additional info actions
info:
  tap_action:
    action: more-info
  double_tap_action:
    action: toggle
# Configure control button actions
controls:
  tap_action:
    action: toggle
  hold_action:
    action: more-info
  double_tap_action:
    action: call-service
    perform_action: browser_mod.popup
    data:
      title: Pi-hole Controls
      content: 'Advanced Pi-hole control panel'

Project Roadmap

  • Initial design: create initial card design
  • Auto-discovery: automatic detection of Pi-hole entities
  • Dashboard statistics: visual representation of key metrics
  • Control buttons: quick actions for common Pi-hole tasks
  • Version info: display component versions
  • Custom actions: tap/hold/double-tap actions for all elements
  • Card customization: custom title and icon options
  • Links directly to sub pages: direct links to specific Pi-hole admin pages

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/pi-hole-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 Pi-hole's own dashboard 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

0