Is it possible to rever displayed data upside down, as negatives? E.g. to show upload data above zero axis and download data below (though the sensor has positive values).
Not natively, but you could create a template sensor that would flip the sign of the download data, making it negative. Graphing this together with the unchanged upload data would give you the desired result.
That’s what I thought too though I do not like to create sensors if unnecessary… Already have almost 1000 in my system
You know what, open a feature request on github for a generic scale multiplier on line graphs. I had this in mind for awhile now, but keep forgetting about it. It could be used to flip your data on the fly (scale -1) or to do more generic unit conversions too.
V 1.0.25 is out !
Happy to say that the history explorer card is now fully localized and available in three new languages besides English: French, German and Spanish (thanks @Pharizna for the last one !). If your language is not yet supported and you’d like to see it added, your help is welcome !
Besides this, a new scale
options was added to both YAML entities and dynamically added ones. It can be used change the scale of line graphs on the fly, without having to create new template entities. For example, you can use this to do unit conversions or sync the scales of multiple entities into a single graph. You can also use the scale to flip a graph upside down if you make it negative (@mirekmal).
Just installed and very happy with the result!
Speedtest results before:
Aand after (download flipped and scaled /10):
Thanks alot !!!
Nice !
I did notice that besides flipping the sign, it looks like the download speed was divided by 10, so the scale looks something like -0.1. Did you do this on purpose ?
Yes! In my case disproportion between maximum download (500 mbs) and upload (30 mbps) makes a bit hard to see variations on upload,if not scaled up. It is just very tiny vs download. So rescalling download makes it to look more like ‘percentage’ of available bandwidth. Obviously this could be achieved by creation of additional template sensors that would do similar recalculation, but this unneceserily multiply entities.
Ah okay. I thought it might have been some weird bug.
Alternatively you could use the scale feature to rescale both up and download data to actual percentage values of their individual theoretical maximum, and then override the graph unit to %.
Question: So do we have to assign colors to each and every graph? I like the way the graphs that are added on-the-fly would have colors, but the graphs I added via config would be black only, some how.
type: custom:history-explorer-card
cardName: historycard-68893440
uimode: dark
defaultTimeRange: 12h
combineSameUnits: true
header: hide
tooltipShowDuration: true
graphs:
- type: line
options:
ymin: 0
showTimeLabels: false
entities:
- entity: sensor.estimated_illuminance
- type: timeline
entities:
- entity: sun.sun
- entity: sensor.period_of_the_day
- entity: sensor.owm_weather
- entity: sensor.owm_condition
- type: line
options:
ymin: 0
entities:
- entity: sensor.owm_uv_index
- type: arrowline
title: Wind bearing
entities:
- entity: sensor.wind_bearing
… or did I missed something, or something in conflict?
For YAML defined entities, yeah. That’s why it’s called manual mode
Mixing manually defined colors with automatic ones is problematic, because automatic colors are assigned sequentially. So everytime you would add an entity to your YAML, or move one around, or manually set the color of one, the auto colors for all subsequent entities would change in unpredictable ways. That goes against the whole idea of YAML entities providing a fixed ‘set in stone’ base.
If you like the auto colors and want to use them for your YAML entities, they’re available here. Just copy and paste them.
Any instructions/examples to use the new scale options?
… and about using your card as YAML entity: I usually build a graph choosing a sensor, etc (dynamically?) but I’d like to “save” this card configuration to use it in different sessions… in the file configuration.yaml, for example
The scale option is an entity option like color
or lineMode
and can be used at the same spots as these two options (look them up in the readme), both for predefined YAML entities or dynamic entities (over entityOptions). I’ll update the manual when I have some time.
In HA, custom cards don’t have write access to the YAML sadly, so it’s not technically possible to programmatically change the YAML config from within the card. It could be possible to add dynamic presets though. The backend is already able to do this, but there’s no UI around the feature.
I created a new graph type for my rain gauge, so that I could easily visualize accumulated rainfall over time with weekly, daily, hourly or 10 minute accumulation intervals that can be selected on the fly. I then realized that this principle would probably work for any monotonically increasing sensor (state class total_increasing
), like power, water or gas usage, internet usage, etc. Would there be any interest in such a more generic mode for the history explorer card ?
Automatic colors for line graphs defined in the YAML are now available in the newest version (V1.0.26).
Anyone having problems with filll option? It stopped to work me (not sure at what moment). None of my graphs fill in space below the line. I’ve seen no changes in card configuration on github…
Known issue (Regression with explicitly defined fill colours · Issue #62 · alexarch21/history-explorer-card · GitHub).
Temporary workaround is to downgrade to 1.0.25.
Maybe I missed something: Wind bearing is not showing.
- type: line
entities:
- entity: sensor.owm_wind_bearing
So I went to check what I would see in the developer tool on the same entity:
It’s not critical… but any pointer would be great. I just want to know whether I have a bigger problem somewhere.
===
EDIT: adding extra info… a couple minutes later the state of the entity does change. So at least we know it is not some dead/stale entity:
Impossible to say with this little information I’m afraid. Could be anything. First try to add it using the UI instead of the YAML. Make sure that this entity is actually recorded in the history.