Some styles for “timeline” history-graph
On December 2022 default colors for icons & “timeline” graphs were changed.
Later users got a possibility to customize colors by defining theme variables (also, in a normal format, not like “234,23,45” which did not allow users to use colors like “green” & “rgb(2,34,45)”).
One of changes was related to using a transparent color for history-graph for “unavailable” values.
Earlier a transparent color was used for periods when an entity did not exist.
On a screenshot from 2022.7.4 the upper entity was not created yet before ~06:05:
And here is a similar picture from 2023.7 - the upper entity was just created, the 2nd entity is currently unavailable :
Can you see a difference between “not created” & “unavailable” here?
Created an issue on 13.12.22, but it appeared to be a waste of time since I failed to convince people in obvious (imho) things.
What I can do now is using a theme variable (let’s use “cyan” as intuitively “unavailble”):
my_super_theme:
history-unavailable-color: cyan
which gives us this 100% clear picture:
Here are ways to style graphs locally:
code
- type: history-graph
entities:
- binary_sensor.testing_availability
hours_to_show: 0.15
show_names: false
- type: history-graph
entities:
- binary_sensor.testing_availability
hours_to_show: 0.15
show_names: false
card_mod:
style: |
ha-card {
--history-unavailable-color: cyan;
}
BTW, I especially love this puzzle - what is this?
Correct answer - this is a DEFAULT graph for “unavailable” entity.
For “unknown”:
code
- type: history-graph
entities:
- sensor.web_scrape
hours_to_show: 1
show_names: false
- type: history-graph
entities:
- sensor.web_scrape
hours_to_show: 1
show_names: false
card_mod:
style: |
ha-card {
--history-unknown-color: pink;
}