From 1a09755fe9e4bfc41c45908c537b9166e53f1f15 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sat, 31 Jan 2026 21:59:07 -0500 Subject: [PATCH] Gauge card pro for gas price info --- main_dashboard.yaml | 87 +++++++++++++++++++++++++++++++++++++---- mobile_dashboard.yaml | 90 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 161 insertions(+), 16 deletions(-) diff --git a/main_dashboard.yaml b/main_dashboard.yaml index f66be2d..f4b555b 100644 --- a/main_dashboard.yaml +++ b/main_dashboard.yaml @@ -4346,14 +4346,85 @@ views: cards: - type: heading heading: Defiance Gas Statistics - - type: entities - entities: - - entity: sensor.local_minimum_gas_price - name: Minimum - - entity: sensor.local_average_gas_price - name: Average - - entity: sensor.local_maximum_gas_price - name: Maximum + - type: horizontal-stack + cards: + - type: custom:gauge-card-pro + entity: sensor.local_minimum_gas_price + segments: + - pos: 2 + color: var(--success-color) + - pos: 3 + color: var(--warning-color) + - pos: 4 + color: var(--error-color) + needle: true + gradient: true + titles: + primary: Minimum + gradient_resolution: auto + min: 2 + max: 4 + round: small + value_texts: + primary: |- + {% if states(entity) in ['unavailable','unknown'] %} + ? + {% else %} + {{ states(entity) }} + {% endif %} + primary_unit: '{{ '''' }}' + - type: custom:gauge-card-pro + entity: sensor.local_average_gas_price + segments: + - pos: 2 + color: var(--success-color) + - pos: 3 + color: var(--warning-color) + - pos: 4 + color: var(--error-color) + needle: true + gradient: true + titles: + primary: Average + gradient_resolution: auto + min: 2 + max: 4 + round: small + value_texts: + primary: |- + {% if states(entity) in ['unavailable','unknown'] %} + ? + {% else %} + {{ states(entity) }} + {% endif %} + primary_unit: '{{ '''' }}' + - type: custom:gauge-card-pro + entity: sensor.local_maximum_gas_price + segments: + - pos: 2 + color: var(--success-color) + - pos: 3 + color: var(--warning-color) + - pos: 4 + color: var(--error-color) + needle: true + gradient: true + titles: + primary: Maximum + gradient_resolution: auto + min: 2 + max: 4 + round: small + value_texts: + primary: |- + {% if states(entity) in ['unavailable','unknown'] %} + ? + {% else %} + {{ states(entity) }} + {% endif %} + primary_font_size_reduction: 0 + primary_unit_before_value: true + primary_unit: '{{ '''' }}' - type: custom:auto-entities card: type: entities diff --git a/mobile_dashboard.yaml b/mobile_dashboard.yaml index 340d437..9832171 100644 --- a/mobile_dashboard.yaml +++ b/mobile_dashboard.yaml @@ -3659,14 +3659,88 @@ views: button_type: name name: Gas Prices icon: mdi:gas-station - - type: entities - entities: - - entity: sensor.local_minimum_gas_price - name: Minimum - - entity: sensor.local_average_gas_price - name: Average - - entity: sensor.local_maximum_gas_price - name: Maximum + sub_button: + main: [] + bottom: [] + - type: horizontal-stack + cards: + - type: custom:gauge-card-pro + entity: sensor.local_minimum_gas_price + segments: + - pos: 2 + color: var(--success-color) + - pos: 3 + color: var(--warning-color) + - pos: 4 + color: var(--error-color) + needle: true + gradient: true + titles: + primary: Minimum + gradient_resolution: auto + min: 2 + max: 4 + round: small + value_texts: + primary: |- + {% if states(entity) in ['unavailable','unknown'] %} + ? + {% else %} + {{ states(entity) }} + {% endif %} + primary_unit: '{{ '''' }}' + - type: custom:gauge-card-pro + entity: sensor.local_average_gas_price + segments: + - pos: 2 + color: var(--success-color) + - pos: 3 + color: var(--warning-color) + - pos: 4 + color: var(--error-color) + needle: true + gradient: true + titles: + primary: Average + gradient_resolution: auto + min: 2 + max: 4 + round: small + value_texts: + primary: |- + {% if states(entity) in ['unavailable','unknown'] %} + ? + {% else %} + {{ states(entity) }} + {% endif %} + primary_unit: '{{ '''' }}' + - type: custom:gauge-card-pro + entity: sensor.local_maximum_gas_price + segments: + - pos: 2 + color: var(--success-color) + - pos: 3 + color: var(--warning-color) + - pos: 4 + color: var(--error-color) + needle: true + gradient: true + titles: + primary: Maximum + gradient_resolution: auto + min: 2 + max: 4 + round: small + value_texts: + primary: |- + {% if states(entity) in ['unavailable','unknown'] %} + ? + {% else %} + {{ states(entity) }} + {% endif %} + primary_font_size_reduction: 0 + primary_unit_before_value: true + primary_unit: '{{ '''' }}' - type: custom:auto-entities card: type: entities