SpangleLabs / history-explorer-card

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

Displaying future states on a graph #24

Open AhilusUA opened 1 month ago

AhilusUA commented 1 month ago

I have a file in which each line is a day of the week, and each column is an hour of the day, and based on this file, a sensor is made that sends the value for each hour to the graph and everything works as it should, but the graph is only up to the present time. How can I loop the graph (given that the file contains future states) so that I can scroll forward?

image

This is what the graph configuration looks like:

type: custom:history-explorer-card
axisAddMarginMin: false
axisAddMarginMax: false
header: ' '
uiLayout:
  toolbar: hide
  selector: hide
  interval: hide
labelsVisible: true
labelAreaWidth: 44
tooltip:
  size: slim
  showDuration: true
  showLabel: false
stateColors:
  'off': '#495A7A'
  warn: '#C5E3FA'
  'on': '#FFFFFF'
  On-Grid: '#FFFFFF'
  Off-Grid: '#495A7A'
graphs:
  - type: timeline
    entities:
      - entity: sensor.solarman_grid_connected_status
        name: Deye
      - entity: sensor.yasno_group_6
        name: GR_6

and here is the file with the graph (if suddenly necessary/useful):

on off off off off warn warn warn on on off off off off warn warn warn on on off off off off warn
warn warn on on off off off off warn warn warn on on off off off off warn warn warn on on off off
off off warn warn warn on on off off off off warn warn warn on on off off off off warn warn warn on
on off off off off warn warn warn on on off off off off warn warn warn on on off off off off warn
warn warn on on off off off off warn warn warn on on off off off off warn warn warn on on off off
off off warn warn warn on on off off off off warn warn warn on on off off off off warn warn warn on
on off off off off warn warn warn on on off off off off warn warn warn on on off off off off warn

Perhaps this can be implemented and I just haven’t found how, in which case I’ll be glad for advice.

AhilusUA commented 1 month ago

And here is the configuration of the sensor itself, also if necessary/would be useful:

command_line:
  - sensor:
      name: yasno_group_6
      command: "sed -n $(date +%u)p yasno_schedule_group_6.txt | cut -d' ' -f $(expr $(date +%H) + 1)"