@ Ildar_Gabdullin the wizard of customizations!!
Thank you for your interest in my need.
I had to take some time to carefully consider my answer.
Here it is:
I would like to point out that I am aware and agree with the fact that nothing is owed here.
Having said that, perhaps it escapes that a multitude of intelligences pass through here, some oriented towards programming, others not but simply passionate about the subject.
Some young with great hopes, others on the home stretch but no less gifted with cognitive appetite.
I belong to the last category mentioned.
I could have simply asked “how do you do it?” but in doing so I could have also implied that I like to have “the food ready”. So I wanted to share in my request the (vain) attempts that I made with my limited knowledge.
Also because I hoped that, as sometimes happens, the problem was a typing error or some simple syntax error.
I didn’t invent anything… I tried to tailor my limited knowledge to the problem. Asking ChatGPT never helped me much.
So I did as you suggested… I asked the community and got your answer:
1- reprimand;
2 - search the site for the add-on
3 - search for gauge and find my solution.
Let’s say that you quickly switched to the board and that’s what you felt like writing.
Thanks for doing so.
Let’s also say that in hindsight, the question was badly phrased.
But I only understood it after your answer.
type: custom:mod-card
tap_action:
action: none
double_tap_action:
action: none
hold_action:
action: more-info
card:
type: gauge
entity: >-
sensor.ph
name: pH
card_mod:
style:
.: |
ha-card {
width: 80px;
height: 50px !important;
top: 115px;
left: -365px;
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: 8px !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: 50px !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'
This is the complete code of my gauge.
There is very little of mine since it is a set of copy and paste of code found on the board.
I had already found this solution of yours:
type: vertical-stack
cards:
- type: entities
entities:
- sensor.electricity_meter_huidig_gemiddelde_vraag
- sensor.electricity_meter_maximale_vraag_huidige_maand
- type: custom:auto-entities
card:
type: vertical-stack
card_param: cards
filter:
template: |-
{{
{
'type': 'gauge',
'entity': 'sensor.electricity_meter_huidig_gemiddelde_vraag',
'name': 'Piekverbruik',
'needle': 'true',
'max': states('sensor.electricity_meter_maximale_vraag_huidige_maand')|int,
'segments': {
- 'from': 0
'color': 'green'
- 'from': states('sensor.electricity_meter_maximale_vraag_huidige_maand')*0,8|int,
'color': 'orange'
- 'from': states('sensor.electricity_meter_maximale_vraag_huidige_maand')|int,
'color': 'red'
},
}
}},
but I understand that he uses a different addon than mine.
So, to add a feature, I would risk destroying the gauge layout.
And since I have a dozen of them all the same on the dashboard, the remedy would be worse than the disease.
I don’t know what this grapheme means .: | but thanks to the fact that someone used it, I was able to independently create what I was interested in.
By trial and error… changing here this happens, etc.
I had a new need that I tried to address independently without success.
After all, if I were as good as you are at the subject, I wouldn’t have had the need to ask the question.
I would probably be here, like you, helping others.
Maybe in a more empathetic way.
Thanks for your attention.