[Under New Management] Interactive history explorer custom card

Dynamically added card contents are per browser. Adding graphs in one browser will not automatically add them in other browsers, even if it’s the same card on the dashboard. If you want the card to have the exact same graphs in all browsers automatically, you need to define the contents manually in yaml.

1 Like

Has somebody some Examples of Custom data processing, especially for building Averages?

I am looking for a possibility to display the average( mean?) Temperature, Humidity, Rain, Sunshine, Brightness,… where the average can be calculated on a e.g. Daily Base. If i had a starting Point Code it might be easy to adapt it to Weekly, Monthly,… values.

Pictures show more than 1000 Words. A quick Example:
grafik
This is a Month of the Temperature of our Loggia, rendered with History Explorer Card.

grafik
This is the sama Dataset, but with Home Assistants Statistics Graph, set to period: day and stat_types: mean.

grafik
While this would not be really necessary, it looks even cooler - it additionally renders the min and max values.

However, in the End i would be totally Happy if i’d have some sample Expressions for Averaging to start with! :slight_smile:

Custom functions are meant for operating on single samples at a time, more for simple operations like unit conversions, type conversions, spike rejections, clamping, etc. While it would probably be possible to run them on the entire dataset with some creativity, that’s not their purpose and would probably lead to very bad performance.

If you want a filtered view, you can select the filter period in the long term statistics setting part of the card, as described here. This would give you a view identical to your second image. Of course that only works on statistical data, not on the short term history part (which is unfiltered). The upcoming version there will have some new statistics related switches (mean/max/min per entity, force the use of statistics only), so that would presumable work for you.

As for the third visualization, you could achieve something similar with per-entity statistics (add the same entity 3 times, setting min/max/mean stats for each entity accordingly, set the fill colors as needed). I’m personally not a big fan of this type of visual, so implementing it natively isn’t high on my todo list.

2 Likes

Well - Thank you so much for this great support again! Top-Notch, just like the Card itself! :+1:

I feel bad. How could i have overlooked this :frowning:

This such great News! But now i have to work harder on my patience than on the Cards themself :smiley:

While at first glance it looked really interesting, this isn’t something i really pray for as well. Having the first new Features would be a much higher Improvement.

Thanks for everything! :+1:

Won’t be too long :wink: Life is just really busy on my side for the moment, so updates to the card are a bit slower than usual.

1 Like

I asked this a while ago and we solved this for cards. But now i have the same problem for history-info panel:

about “labels” color (that is scale color): i can set any color i like in card with uiColors: labels. That way i can also set theme: dark.

But, how to set this when i enable “history info_panel”? I use that as a replacement for HA’s native history, and scale is very dark (dark grey) - i use dark theme, but i also tried other darker themes, however, scale color doesn’t change with theme change. Since i use black background best would be white for labels.
Any chance to set this as default for history info panel, too?

You can do all this there as well, e.g.

infoPanel:
  lineMode: stepped
  stateTextMode: auto
  uimode: dark
  showUnavailable: false
  decimation: false
  refresh:
    automatic: true
  exclude:
    climate: true
    energy: false
    binary_sensor: false
    sensor.motion1: false
  uiColors:
    gridlines: '#212121'
    labels: '#BAC0C6'
    buttons: '#2e2e2e'
    selector: '#2e2e2e'
    closeButton: '#2e2e2e'
  statistics:
    enabled: true
    mode: max
  tooltip:
    size: compact
    showColorsLine: false
    showColorsTimeline: false
    showDuration: true
    showLabel: false
    stateTextMode: raw
  stateColors:
    gestoppt: '#414141'
    'on': '#6da620'
    'off': '#414141'
    open: '#ad3631'
    closed: '#6da620'
    tilted: '#ff9800'
    locked: '#ad3631'
    unlocked: '#ad3631'
    battery.on: '#ad3631'
    battery.off: '#6da620'
    door.on: '#ad3631'
    door.off: '#6da620'
    shutter.open: '#649ace'
    shutter. Closed: '#6da620'
1 Like

OK; i found it… it must be placed into card from which i enable new history, correct? Many thanks!

Yes.you have to define the whole infopanel once in one random card. With all settings etc.

1 Like

Hi Alex,
This looks really good. I’ve now installed HACS and HE. I got a pop-up telling me to include url: /hacsfiles/history-explorer-card/history-explorer-card.js and type: module into my YAML. I added them to my UI-Lovelace YAML but it doesn’t seem to work. Where is it supposed to go?

Btw, it would be useful to have this message somewhere in your documentation rather than only in the pop-up. I had to reinstall HE in order to re-read the message. :stuck_out_tongue:

thanks,
Sean

This is not a message generated by the card. I don’t know what generates this popup. You don’t have to add any js resource to your YAML manually. Everything is handled by HACS. Just search for the card on the default store and install it using the UI.

Ok, thanks Alex. It must come from HACS then. I installed the card with no issues, but I can’t add it to a panel. The pop-up said something about how my Lovelace is installed. I’ll have to check that message more carefully.

Alex,

I thought I just needed some history data to load into Excel, but through your card I got so much more.

Great stuff,

Rudi

1 Like

Or this ? More like the original HA one, but with different colors and transparent overlays.
image

Could you share your code to make it look like the second example?

V1.0.47 is out with lots of new features and improvements !

  • Manually predefined YAML graphs can now use wildcards to auto-add multiple entities. The following example will auto-add all entities with ‘temperature’ in their names to a line graphs, except for fridge temp sensors and the CPU temp sensor:
graphs:
  - type: line
    entities:
      - entity: sensor.*temperature*
        exclude:
          - entity: '*fridge*'
          - entity: sensor.cpu_temperature
        fill: rgba(0,0,0,0)

image

  • Added an option to bar graphs showing the raw data as a line graph:

image
image

image

  • CSV exporter can now optionally export entity attributes (yay ! I really needed that myself). Entity attributes will be added to additional columns after the state in the CSV.
type: custom:history-explorer-card
csv:
  exportAttributes: true
  • Added some additional default colors (because colors !)

  • And various bugfixes.

Sadly the statistics settings didn’t make it into this release. Probably the next one.

6 Likes

That was a mockup while brainstorming on how something like that may be visualized. It has not been implemented I’m afraid.

Edit: I need to investigate more.

Do you have a link to the GitHub issue?

No GH issue yet, I need to investigate more. This thing is pretty obscure, the workaround doesn’t work in all cases. And for all I know, this could be an intentional change in the API, as the WS API calls are undocumented. The problem arises when the server and clients are in different timezones. So if you are in this case, and get weird behavior when having auto-refresh on, the workaround for now is to disable auto refresh.

1 Like

I succesfully added the HACS interactive history explorer to a newly created “View” in my custom HA “dashboard”.

I can successfully view various “entities” over varying “time-periods” etc…

However, after I add an “entity” to my interactive history explorer, when I come back to the “view” of the dashboard, it appears to make me start all over again by adding one or more entities already “added”.

** How do I save the “entity” list for the “View” of the “Dashboard”?