Lovelace: dual gauge card

More good news!
dual gauge card is now off hacs blacklist!
Unfortunatly I forgot to tag a new version on github. I did bump the version to 0.5.2 now but I’m not sure when this is reflected by hacs. Until then you may install the “master” version - which is the same as 0.5.2 at the moment.

tl;dr: Please update the card to 0.5.2 or “master” to use it again.

Shame on me :man_facepalming: I forgot to add a release on github. I promise I will learn from this :wink:

You may now install 0.5.2 via hacs.

:pray:

but I have an error in the log

Cannot read property ‘setConfig’ of undefined

- type: custom:dual-gauge-card
  title: Piscine
  min: 0
  max: 900
  outer:
    entity: sensor.ph_moyen_piscine
  inner:
    entity: sensor.ph_moyen_piscine
  colors:
    - color: "var(--label-badge-red)"
      value: 27.5
    - color: "var(--label-badge-green)"
      value: 25
    - color: "var(--label-badge-yellow)"
      value: 18
    - color: "var(--label-badge-blue)"
      value: 0
    - color: "var(--paper-blue-400)"
      value: -40

I am trying to take a sensor and some of it’s attributes and setup a gauge that can display it’s percentage based on the sensor amount, it’s maximum attribute which would show it’s max value, and then change colors based on OK, warning, or critical. The default gauge card doesn’t seem to allow this kind of entry and I have to hard code all number but the initial sensor which in my case is how many GB of drive space are used. Below are the results of my rest call on the C: drive.

image

If I have to I will create sensors for each value and not attributes but could these sensor values or attributes be used without using hard coded numbers?

Hi @pitp2!
Sorry, I can’t replicate this error. I copied your config snippet, replaced your entity with some random numerical sensor in my setup and had no problems.
Screenshot at 2020-04-25 13-22-49
Are you sure you have the latest version (0.5.2) installed? And which version of home assistant are you running?

Hi @jriker1!
If I get this right, this isn’t possible at the moment without the use of extra sensors.
I plan to implement templating for some options, that should make something like this possible. But I can’t give any schedule on that.

@Rocka84, thank you for your feedback, it was an indentation issue :slight_smile:

hello!
Is it possible to add an icon to one of the top corners using this card?
Ideally, I’d like to place the red icon from the custom_button card in the top left corner of the double-gauge card. If there is a better way to add an icon to your card, Im all ears! :slight_smile:
Here’s my current code etc:
cards

    cards:
      - cards:
          - color: 'rgb(255,0,0)'
            entity: binary_sensor.wyzesense_77a24d96
            icon: 'mdi:gesture-tap-hold'
            size: 10%
            state:
              - color: 'rgb(0,255,0)'
                value: 'off'
            theme: clear-dark
            type: 'custom:button-card'
            aspect_ratio: 1/1
            show_name: false
            custom_fields:
              gauge:
                card:
                  background_color: black
                  cardwidth: 200
                  inner:
                    attribute: rssi
                    colors:
                      - color: var(--label-badge-green)
                        value: -40
                      - color: var(--label-badge-yellow)
                        value: -70
                      - color: var(--label-badge-red)
                        value: -90
                    entity: binary_sensor.wyzesense_77a24d96
                    label: RSSI
                    max: 0
                    min: -105
                  outer:
                    attribute: battery_level
                    colors:
                      - color: var(--label-badge-green)
                        value: 90
                      - color: var(--label-badge-yellow)
                        value: 80
                      - color: var(--label-badge-red)
                        value: 70
                    entity: binary_sensor.wyzesense_77a24d96
                    label: Battery
                    unit: '%'
                  theme: clear-dark
                  title: Red Button
                  type: 'custom:dual-gauge-card'
            styles:
              custom_fields:
                gauge:
                  - filter: opacity(50%)
                  - overflow: unset
              card:
                - overflow: unset
              grid:
                - grid-template-areas: '"i" "n" "gauge"'
                - grid-template-columns: 2fr
                - grid-template-rows: 2fr min-content min-content
          - color: 'rgb(255,0,0)'
            entity: binary_sensor.wyzesense_77a25137
            icon: 'mdi:gesture-tap-hold'
            size: 10%
            state:
              - color: 'rgb(0,255,0)'
                value: 'off'
            theme: clear-dark
            type: 'custom:button-card'
            aspect_ratio: 1/1
            show_name: false
            custom_fields:
              gauge2:
                card:
                  background_color: black
                  cardwidth: 200
                  inner:
                    attribute: rssi
                    colors:
                      - color: var(--label-badge-green)
                        value: -40
                      - color: var(--label-badge-yellow)
                        value: -80
                      - color: var(--label-badge-red)
                        value: -100
                    entity: binary_sensor.wyzesense_77a25137
                    label: RSSI
                    max: 0
                    min: -105
                  outer:
                    attribute: battery_level
                    colors:
                      - color: var(--label-badge-green)
                        value: 90
                      - color: var(--label-badge-yellow)
                        value: 80
                      - color: var(--label-badge-red)
                        value: 70
                    entity: binary_sensor.wyzesense_77a25137
                    label: Battery
                    unit: '%'
                  theme: clear-dark
                  title: Black Button
                  type: 'custom:dual-gauge-card'
            styles:
              custom_fields:
                gauge2:
                  - filter: opacity(50%)
                  - overflow: unset
              card:
                - overflow: unset
              grid:
                - grid-template-areas: '"i" "n" "gauge2"'
                - grid-template-columns: 1fr
                - grid-template-rows: 1fr min-content min-content
        type: horizontal-stack

EDIT:
It almost looks like if I could overlap the two cards perfectly, the icon might show up right in the middle of all the info in the gauge, barely being out of the way of the numbers and everything. Which ever method would be easier to accomplish!

hi @Rocka84

I’m facing same issue like @pitp2.

I’m having 0.5.2, installed via HACS.
HA Supervised 112.4

Error as I edit the custom card: Cannot read property ‘setConfig’ of undefined
If I save, the card shows: No card type configured.
No errors in the logs.

Not sure what to check next, I’m quite new to HACS.
thanks,
-a

Please ignore my comment - by copy-pasting the example directly into the manual card, you get that error.
Correct code should be without the - in front of the “type” and all indentation shifted left by 2 spaces…
In case of @pitp2, it should be like:

type: custom:dual-gauge-card
title: Piscine
min: 0
max: 900
outer:
  entity: sensor.ph_moyen_piscine
inner:
  entity: sensor.ph_moyen_piscine
colors:
  - color: "var(--label-badge-red)"
    value: 27.5
  - color: "var(--label-badge-green)"
    value: 25
  - color: "var(--label-badge-yellow)"
    value: 18
  - color: "var(--label-badge-blue)"
    value: 0
  - color: "var(--paper-blue-400)"
    value: -40

I hope it’s ok I use this thread to ask a random question about the Dual Gauge Card :slight_smile:
So I want the color from the outer ring (temperature) change depending on the settings of the inner ring (input_number)

type: 'custom:dual-gauge-card'
title: Temperature
max: 40
min: 10
inner:
  entity: input_number.target_temp
  label: Target
  unit: °C
outer:
  entity: sensor.temperature
  label: Is
  unit: °C
  colors:
    - color: "var(--paper-blue-400)"
      value: 10
    - color: var(--label-badge-blue)
      value: '{{ states(''input_number.target_temp'') - 4 | int }}'
    - color: var(--label-badge-green)
      value: '{{ states(''input_number.target_temp'') - 2 | int }}'
    - color: var(--label-badge-orange)
      value: '{{ states(''input_number.target_temp'') + 2 | int }}'
    - color: var(--label-badge-red)
      value: '{{ states(''input_number.target_temp'') + 4 | int }}'

Isn’t this how it should work?! (Sorry, I will never fully understand templating xD)

1 Like

Can anyone tell me which part of the css? I don’t need the current/target words, just the numeric values and the title. How to shift the text a few pixel lower?
dual-gauges

Ok. I figured out. I forgot we are dealing with css and js file. Need to clear browser cache in order to see the changes.

My other question is how can I have script to omit the last digit.
Example: 27.45 <-- omit the 5

I am looking for the same solution. Did you get it fix?

Hi!

No, but I switched to a different card type. Now it looks like this

figure1a

And I can swipe right to get a zoomed version of the two cards like this example

figure1b

Kind regards.

not work
immagine

1 Like

I had the same issue as well. This means the component has not been installed correctly. Try to reinstall in from HACS or manually. HACS should also add the required js in the lovelace resources page (configuration>lovelace dashboards>resources) or if you do a manual install , then add the correct path

Would it be possible to have the MAX value set to the value of an entity (or attribute)? I want to display progress on the inner gauge, with the outer gauge representing the max to which the inner should go.

I need to reduce the number of decimal places from 3 to 1 for clarity. My entity is “sensor.pm12_pool_kwh”.

I´m triying to do the same thing…
Did you reatch this goal?
Thanks

same issue

Can you please help with font size? I’m new to HASS, this card is nice and i’m planning to use it for devices with dual parameters, like routers (RX/TX, etc). Card_mod is installed, of course. But so far i’m unable to set font size, so test card looks like this:
Screenshot_3