alexarch21 / history-explorer-card

A card for Home Assistant Lovelace for exploring the history of your entities interactively and in real time.
MIT License
420 stars 64 forks source link

timeline mode deesn't work for me #14

Closed areyoufserious closed 2 years ago

areyoufserious commented 2 years ago

Hi i"m trying to add non-sersor entities, but i can't see chart i tried binary sensors, humidifier, heater, tried manual mode and selector mode -- result is the same however charts work great for sensor entities like temperature, what i do wrong?

alexarch21 commented 2 years ago

Please post your YAML

areyoufserious commented 2 years ago

sure

type: custom:history-explorer-card
cardName: historycard-75274398
uiLayout:
  toolbar: hide
  selector: hide
header: ' '
uimode: dark
showUnavailable: true
entityOptions:
  temperature:
    color: rgb(255, 0, 78)
    fill: rgba(255, 0, 78, 0.4)
  humidity:
    color: rgb(3, 155, 229)
    fill: rgba(3, 155, 229, 0.4)
  pressure:
    color: rgb(0, 255, 8)
    fill: rgba(0, 255, 8, 0.4)
graphs:
  - type: line
    entities:
      - entity: sensor.0x158d000410b3a8_temperature
        color: rgb(255, 0, 78)
        fill: rgba(255, 0, 78, 0.4)
        name: Sensor?
        width: 4
      - entity: sensor.zhimi_zb1_057c_temperature
        color: rgb(255, 0, 0)
        fill: rgba(255, 0, 0, 0.4)
        name: Smartmi Heater
        width: 4
  - type: timeline
    entities:
      - entity: humidifier.mi_smart_humidifer_humidifier
        color: rgb(3, 155, 229)
        fill: rgba(3, 155, 229, 0.4)
        name: humidifier
        width: 4

Also when i add timeline block, it affects all chart card1

Without timeline:

card2

alexarch21 commented 2 years ago

I was able to reproduce this when at least one entity ID in your timeline graphs doesn't exist. Make sure you haven't mistyped one. A single invalid / non-existent entity will make the card abort with an error. There is no additional checking for invalid entities in the YAML yet. I should probably add some.

To be sure, open the browser console (F12), reload the page and look for errors. If you see something like Uncaught TypeError: this._hass.states[t.entity] is undefined, then it's an invalid entity id.

areyoufserious commented 2 years ago

Thanks for your answer! I created new lovelace view and added entity that for sure has data, that's what i've got:

card3
alexarch21 commented 2 years ago

It looks like it may be using an incompatible external version of Chartjs (Chart.bundle.min.js), which it shouldn't, as it's bundled with its own version to prevent issues like this.

How did you install the card ? Over HACS or manually ? If manually, did you install the prebuilt package or did you build it yourself / install the source package ?

areyoufserious commented 2 years ago

I Used HACS

alexarch21 commented 2 years ago

Your HA version and install method ? What other custom cards do you have installed that display graphs in any way ?

areyoufserious commented 2 years ago

Home Assistant 2022.2.0 Also installed:

alexarch21 commented 2 years ago

I set up a new HA install with exactly the same version and custom cards as you and I was unfortunately unable to reproduce this. Everything seems to be working as expected.

The only idea left is to:

  1. Make sure that it isn't a cache issue. Clear your browser cache and reload.
  2. Create a new and empty history explorer card, add one single binary sensor by selecting it from the dropdown menu (to avoid mistyping the entity id).

If that still won't work, then I'm at a loss.

areyoufserious commented 2 years ago

thanks a lot for trying to help and your efforts! i used different browser and it works looks like problem is somewhere in my browser

areyoufserious commented 2 years ago

however, smth strange still going on i wiped all google chrome cache, and it worked some time, then -- same error and i must wipe cache for HA domain again and again same in safari smth wrong with HA setup

alexarch21 commented 2 years ago

I fixed an obscure bug in the timeline code that would sometimes make it so that timelines wouldn't properly show. I'm not 100% sure your issue is related, but it wouldn't hurt to try. In the newest V1.0.15 version. Let me know if it helped !

areyoufserious commented 2 years ago

Thanks a lot, fix works!!!