Skip to content

Help with (relatively) simple graph with entity as multiple arrays #404

Answered by zahachtah
zahachtah asked this question in Q&A
Discussion options

You must be logged in to vote

Got it to work, thanks for all advice @dbuezas!

type: custom:plotly-graph
entities:
  - entity: sensor.tibber_electricity_price
    x: >-
      $ex [...meta.today.map(item => item.startsAt), meta.tomorrow[0]?.startsAt,
      meta.tomorrow[0]?.startsAt]
    'y': >-
      $ex [...meta.today.map(item => item.total), meta.today[meta.today.length -
      1]?.total, meta.tomorrow[0]?.total]
    name: Today
    mode: lines
  - entity: sensor.tibber_electricity_price
    x: $ex meta.tomorrow.map(item => item.startsAt)
    'y': $ex meta.tomorrow.map(item => item.total)
    name: Tomorrow
    mode: lines
  - entity: sensor.tibber_electricity_price
    name: Current
    showlegend: true
    mode: ma…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@zahachtah
Comment options

@dbuezas
Comment options

@zahachtah
Comment options

@zahachtah
Comment options

Answer selected by zahachtah
@dbuezas
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
2 participants