As it supposed to be since another CSS selector is used for UoM.
Do not try to use a code by just “copy/paste” - see if it applicable to YOUR case. Check this.
Replace it with Courier to see if it works.
Then find out why this particular font “1-segment” is not set.
Thank you for answer, both my issues already fixed.
Two other questions if you no mind:
is there any method to add any, even symbolical scale on X axis? Or even short text info, how long time is shown (hours_to_show)? I know, that would obscure the simple look of the entire card, but if it is possible by any easy way, I’d like to try, how it looks.
How to move down the current value, to have it in one line with min and max values?
I decided to show only graph (title I have on other place, so doesn’t make a sense to double it)
I’m trying by own but with results as below. I’m able to move value, but not the unit. Why?
For the same reason that Ildar explained in his previous answer:
(To be clear, UoM = Unit of Measurement). In other words, you will need to identify the CSS selector for the UoM, and apply the same card-mod code to it
yes, and there is a section for this UoM. Bold in this section works, my “W” is bolded. Positioning, exactly the same as in section “value” doesn’t work. Why?
Maybe more clear view, code (borders added only to show that these sections works:
Your reply made me look much closer at the CSS here - ultimately, what you are trying to do is overlap 2 div elements, one which contains the state value and UoM, and the other which contains the min and max values.
It’s a bit hacky really, but overall you might be better off applying a negative margin-top value to the min/max div, so it overlaps with the state div above it.
This works for me, but I’ve no idea how it will scale on different views and layouts:
Last question: is there any way to add prefix or any text before value?
I removed title line, but I think about something indicating that on this graph is a sum of power from three phases. So instead of just 768W, could be: “Total: 768W” or “Σ 768W”
I tried to do it with “name” moved down, but unfortunately above of “min, value, max” line is left an empty space, regardless of moving this field.
Thx a lot to both of you for help, finally I decided to not add X scale (too much details on card) and this is my final card for measuring home electricity
Gents, I’d like to ask you about help for other story. I’m trying to make a card showing my current internet connection parameters. Here is my current result:
Left value is a current WAN RX throughput, right - ping answer to my external DNS server.
What I want to change:
first of all this big icon in the center, I’d like to replace it by any graphics depending on the state of WAN connection. I tried to simply relace mdi icon definition by link to my locally stored png, but it doesn’t work. So this is my first question: how to replace mdi icon by own local graphics?
second question: I’d like to rearrange Min and Max values: remove “min” at all, move the max value to the left and add max value from the second entity on the right - is it possible? I’m near sure that I saw somewhere here how to disable “min” value, but can’t find it now.
and third question connected to previous: can I modify “Max” text on card to my own description? I found how to add any text before or after this text, but not instead.
Thx for help. Generally I got what I wanted to have (only Icon I left for later, with picture elements card I should be able to do it without big problems), but last question: here is my current card, I hidden extrema for second value, hidden “Min” value for first one and moved “max” to the left:
Question: how to align value and date to the left? They are aligned to right, because right side is their native position, in my case I’d like to change it. Tried to do it by own:
ha-card .info.flex .info__item:nth-child(2) .info__item__value {
text-align: left;
color: green
}
but no reaction for text-align. Also I tried to put it in expected place manually by command left: 5% added into this section, but then the whole section starts to be ignored (green color disappearing, position without changes))
I could not deal with 2 things in the last some days. A tried to read everything about them but sadly without success so maybe anyone here can light me the reasons of them.
I know that the official release not yet support attributes, but in theory dev version 3 of unreleased 0.11 can handle it:
water_quality:
- name: Szabad aktív klór
value: 0,20
unit: mg/l
limit: '1000'
state: ok
...
- name: pH
value: 7,7
unit: ' '
limit: '8.5'
state: ok
location: Budapest - XI. kerület
water_hardness: közepesen kemény
provider: Data provided by vizmuvek.hu
icon: mdi:water
friendly_name: Water Quality FVM
Now I’m on the hot fresh official stable 0.11.0 and figured out that for attributes I have to use state_map. With it - as the following config show - my problem solved. No think that this is the most intuitive and convenient but at least it works, so thanks for the developers.
The config:
type: custom:mini-graph-card
entities:
- entity: sensor.water_quality_fvm
name: Water hardness
attribute: water_hardness
font_size_header: 10
font_size: 66
hour24: true
height: 50
line_width: 1
hours_to_show: 168
show:
labels: false
state_map:
- value: nagyon lágy
label: Very soft
- value: lágy
label: Soft
- value: közepesen kemény
label: Moderately hard
- value: kemény
label: Hard
- value: nagyon kemény
label: Very hard