State value without unit of measurement in gauge

Another question on my gauge:

type: custom:mod-card
tap_action:
  action: none
double_tap_action:
  action: none
hold_action:
  action: more-info
card:
  type: gauge
  entity: >-
    sensor.temperature
  name: temperature
  card_mod:
    style:
      .: |
        ha-card {
          width: 80px;
          height: 50px !important;
          top: 115px;
          left: -485px;
          position: relative;
          padding: 0px -0px 0px 0px;
          background: rgb(75, 75, 75);
          border: 3px solid rgb(0, 0, 0);
          border-radius: 10px;
          box-shadow: 3px -3px 10px -3px rgba(25, 90, 80, 1);
          color: rgb(255, 32, 122);
          --paper-item-icon-color: rgb(255, 32, 122);
        }
        .name {
          font-size: 12px !important;
          font-weight: bold;
          color: white !important;
          position: absolute;
          bottom: 0px;
          padding: 0px 0px 0px 0px;
          }
      ha-gauge$: |
        svg {
        transform: scale(1.5) translateY(-5px);
        overflow: visible;
        }
        svg text {
        transform: scale(1.5) translateY(-20px);
        }
        text.value-text {
          font-size: 55px !important;
          font-weight: bold;
          fill: rgba(255, 255, 224, 1) !important;
          text-anchor: middle;
        }
        .needle {
          fill: white !important;
        }
  unit: ''
  needle: true
  min: 5
  max: 9
  segments:
    - from: 5
      color: '#FF0000'
    - from: 6
      color: '#00FF00'
    - from: 8
      color: '#FF0000'

is it possible to display the temperature value without the unit of measurement?

I think this might be useful:

immagine

Let’s hope we’re luckier this time! :rofl:

P.S. Of course without resorting to another sensor

As I already told you - there is no need to use mod-card here.
Check examples for using card-mod for the Gauge card - mod-card is not used.

Since a value and UoM are inside same css element - do not think it is possible. But may be I am wrong.
A possible workaround - create a template sensor without UoM.

As I already told you thanks for your interest in my issues.

You told me and someone else too:
immagine

The problem is what do you mean?

That I should keep the “basic” gauge?
That there is some other method to achieve the same result? (Which?)
First result of the google search for: card-mod for the Gauge.
card-mod is used.

To style the Gauge card - use card-mod.
But do not use mod-card.

Without really understanding what I did, I removed the mod-card:

type: gauge
name: Cond.tà (µS/cm)
entity:   sensor.temperature
tap_action:
  action: none
double_tap_action:
  action: none
hold_action:
  action: more-info
card_mod:
  style: |
    ha-card {
      width: 80px;
      height: 50px !important;
      top: 115px;
      left: -335px;
      padding: 0px -0px 0px 0px;
      background: rgb(75, 75, 75);
      border: 3px solid rgb(0, 0, 0);
      border-radius: 10px;
      box-shadow: 3px -3px 10px -3px rgba(25, 90, 80, 1);
      color: rgb(255, 32, 122);
      --paper-item-icon-color: rgb(255, 32, 122);
    }
    .name {
      font-size: 9px !important;
      font-weight: bold;
      color: white !important;
      position: absolute;
      bottom: 2px;
      padding: 0px 0px 0px 0px;
    }
    ha-gauge$: |
      svg {
        transform: scale(1.4) translateY(-5px);
        overflow: visible;
      }
      svg text {
        transform: scale(1.2) translateY(-20px);
      }
      text.value-text {
        font-size: 65px !important;
        font-weight: bold;
        fill: rgba(255, 255, 224, 1) !important;
        text-anchor: middle;
      }
      .needle {
        fill: white !important;
      }
needle: true
min: 500
max: 3000
segments:
  - from: 500
    color: '#FF0000'
  - from: 1000
    color: '#00FF00'
  - from: 2000
    color: '#FF0000'

the layout of the card is OK but:

  • the gauge is too small
  • the text is too small
  • the needle is black.

I basically lost control of the ha-gauge section…

Why not using simple examples for other cards as a starting point? Go to card-mod thread, there are plenty of examples.

Again, your intervention was of no help to me.
Thanks anyway.

You were given examples and correction of your errors . But you seem to expect a READY code.
Hint: compare your initial variant with mod-card and the latest variant w/o mod-card - you made errors with combining “$:” and “.:” parts.

You see, dear friend, that I was right?

I think I read somewhere that, in case of problems, to ask the vast community of home assistants.

Let’s start from the beginning.
I don’t think I asked: “I want to create a gauge with the dimensions of 75x75 pixels, white background, yellow needle, etc etc”. Tell me how to do it!
In my contry, a similar behavior is called: “wanting the baby food ready”. (I hope that google translates correctly).
I hope you will agree with me that this did not happen.

Reading various and various threads (without anyone’s advice) I managed to create my own gauges with the layout I liked without disturbing anyone, even if I note that gauges are not used very much… in depth.
Above all, I read your posts where you demonstrate deep knowledge of the subject and I give you credit for that.
I also told you (perhaps in the other thread) that, even though it works, I have no idea what is written and why it was written that way. By trial and error I understood that: if I change this number the gauge widens, etc.
I had no problem “confessing” it to the world. No one is omniscient.
I had some needs for improvement. I tried to solve it on my own but I couldn’t. So I did as recommended: I asked the community.
By explaining my problem in an appropriate manner and attaching “my” code.
Now comes the problem: sometimes at school there are teachers who, when they understand that the student hasn’t understood something, tell him: “Read the book”. If the teacher is more “professional” he replies: “Read the book from page 30”.
Here… from my point of view you behave like those teachers.
You will tell me: “I’m not paid to solve problems for the community”. True. Neither are Tom and all the others. But they address the problem, and provide what you call the “ready solution”. They do it for user X but also for all the n other users who, over time, will have the same problem and google will redirect them to that discussion.
And I am living proof of this: if over time someone had not asked about gauges, I would probably have been forced to use the basic version.
Analyze the “quality” of your answers…

  • don’t use mod-card’
  • search for examples on the web
  • make mistakes combining the parts “$:” and “.:”.

Do you think you were helpful to me?
Or to the users who, searching the board in some time, will come across this discussion?
Your answers have only had the effect of lowering my self-esteem and creating expectations for the intervention of some other user more aware of his role within the board to provide me with the help requested. Evidently, given the verticality of the problem, you are the only one able to answer.
In thanking you again, sincerely, for the attention you have paid in talking to me I give you a free and unsolicited piece of advice:
IMHO to answer in that way… do not answer that is better!

Probably I spent a lot of personal time for preparing examples and tutorials NOT to “lower down someone’s self-esteem”.
The goal of these examples and tutorials is to TEACH people, to make them LEARNING.
I am answering mainly in a short way - but with concrete info - due to inability to write long texts. It is probably hard to believe while sitting in a comfortable armchair - but there is a war somewhere.
Do not get offended - you are exaggerating.
Back to the beginning: take your 1st code and only remove mod-card. Do not touch card-mod code (as you did) - and check if it works.

So let’s forget it…
Whichever side of the fence you are on… good luck!