Skip to content

Bar chart of current value with midnight reset #299

Answered by dbuezas
Elarion245 asked this question in Q&A
Discussion options

You must be logged in to vote

Pro tip, you can simplify:

filters:
      - filter: i > 0 && i < xs.length - 1 // remove first and last, since they are partial values
      - fn: |
          ({ys,xs,hass}) => ({
            xs: [...xs, new Date().setHours(0,0,0)],
            ys: [...ys, hass.states['sensor.autarkie'].state],
          })

And you don't even need the second trace
(Edit: added missing hass param)

Replies: 2 comments 15 replies

Comment options

You must be logged in to vote
13 replies
@dbuezas
Comment options

@Elarion245
Comment options

@Elarion245
Comment options

@dbuezas
Comment options

Answer selected by Elarion245
@Elarion245
Comment options

@Elarion245
Comment options

@dbuezas
Comment options

Comment options

You must be logged in to vote
2 replies
@dbuezas
Comment options

@tomatensaus
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants