Skip to content

Help needed with year long statistics plot #295

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

You must be logged in to vote

Oh, I understand, I thought it would be an accumulating value.

I underestimated the problem, but here's a custom filter that should be able to achieve what you want:

type: custom:plotly-graph
hours_to_show: current_year
entities:
  - entity: sensor.openweathermap_temperature
    period: day
    type: bar
    filters:
      - force_numeric
      - fn: |- 
          ({xs, ys, meta, states, statistics, hass}) => {
            const getMonth = date => {
              const d = new Date(date);
              if (d.getDate() < 9){
                d.setMonth(d.getMonth() - 1);
              }
              d.setDate(1);
              d.setHours(0,0,0,0);
              return d;
            }

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dbuezas
Comment options

Comment options

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

Answer selected by Serios
@Serios
Comment options

@dbuezas
Comment options

@Serios
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