πŸ“Š Piotras Value Bar

:bar_chart: Piotras Value Bar

Clean and modern sensor value bars with color gradients, scale labels, and alarm indicators.
Designed for readability and flexibility β€” supports 3 bar orientations and 3 name/value layout modes.




3 bar orientations (layout):

  • Horizontal stepped β€” sharp color zones, ideal for battery levels and percentages
  • Horizontal smooth β€” gradual color transition, ideal for temperature and continuous metrics
  • Vertical β€” side-by-side columns with a shared scale, great for comparing multiple sensors at a glance

3 name/value placement modes (card_layout):

  • Classic row β€” device name on the left, bar in the center, value on the right
  • Name + value above bar β€” compact layout ideal for narrow columns
  • Value inside bar β€” value rendered directly on the bar, works best with a taller bar

Key features:

  • Fully customizable color gradient β€” up to 13 colors per bar, stepped or smooth
  • Independent min/max range per device β€” mix units freely (%, Β°C, W, kWh)
  • Scale labels below each bar (horizontal) or on a shared left column (vertical)
  • Alarm indicators β€” animated arrows appear when a value crosses alarm_min or alarm_max
  • White pin marker shows current value position, or switch to progress fill mode
  • Click any row to open the entity detail in Home Assistant
  • Responsive β€” automatically adapts to card width
  • Horizontal Scroll Navigation

Visual Editor: Full GUI editor β€” add devices, set color gradients, adjust fonts and layout without touching YAML.

:gear: Installation

Method 1: Via HACS (Recommended)

  1. Click the button below to automatically add the repository to your HACS:
Open your Home Assistant instance
  1. Click Add in the pop-up window.
  2. Once the repository page opens, click Download.
  3. After downloading, do a Hard reload of your browser.

Method 2: Manual Installation

  1. Download this repository as a ZIP file and extract it.
  2. Inside your Home Assistant config/www/ directory, create a new folder named piotras-value-bar.
  3. Copy the compiled files (from dist/ folder) into config/www/piotras-value-bar/.
  4. Go to Settings β†’ Dashboards β†’ Resources.
  5. Click Add Resource and enter:
/local/piotras-value-bar/piotras-value-bar-loader.js?v=1.1.0
  • Resource type: JavaScript Module
  1. Hard reload your browser (Ctrl+Shift+R).
7 Likes

Release v1.2.0

New Features:

  • max field now accepts a Home Assistant entity ID in addition to a fixed number β€” the bar scale updates dynamically from the entity’s current state
  • Fallback to 100 when entity does not exist or returns an invalid value

Editor fixes:

  • max field in device editor changed from number-only input to text field β€” accepts both numbers and entity IDs
  • Added tip explaining dynamic max usage directly in the editor
  • Fixed show_shadow and alarm_on toggles showing incorrect default state in the editor
  • Fixed label_font_size default value in editor (was 9, now correctly 0)
  • Fixed Divisions (label_mode) selector now shown for Layout 2 as well as Layout 3

:zap: Dynamic max β€” Entity as Scale Reference

type: custom:piotras-value-bar
header: "POWER β€” REAL TIME"
layout: 2
card_layout: 1
bar_height: 14
show_indicator: true
show_label: true
label_font_size: 9
devices:
  - entity: sensor.power_total
    name: "Total"
    min: 0
    max: 5500
    unit: "W"
    colors: "1,2,3,4,5,5"
  - entity: sensor.power_office
    name: "Office PC"
    min: 0
    max: sensor.power_total
    unit: "W"
    colors: "1,2,3,4,5,5"
  - entity: sensor.power_tv
    name: "TV"
    min: 0
    max: sensor.power_total
    unit: "W"
    colors: "1,2,3,4,5,5"
  - entity: sensor.power_fridge
    name: "Fridge"
    min: 0
    max: sensor.power_total
    unit: "W"
    colors: "1,2,3,4,5,5"

type: custom:piotras-value-bar
header: "ENERGY β€” TODAY kWh"
layout: 2
card_layout: 1
bar_height: 14
show_indicator: true
show_label: true
label_font_size: 9
devices:
  - entity: sensor.energy_total_today_kwh
    name: "Total"
    min: 0
    max: sensor.energy_total_today_kwh
    unit: "kWh"
    precision: 2
    colors: "1,2,3,4,5,5"
  - entity: sensor.energy_office_today_kwh
    name: "Office PC"
    min: 0
    max: sensor.energy_total_today_kwh
    unit: "kWh"
    precision: 2
    colors: "1,2,3,4,5,5"
  - entity: sensor.energy_fridge_today_kwh
    name: "Fridge"
    min: 0
    max: sensor.energy_total_today_kwh
    unit: "kWh"
    precision: 2
    colors: "1,2,3,4,5,5"