Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional series which is calculated based on other series #853

Open
3 tasks done
hindseb opened this issue Jan 15, 2025 · 0 comments
Open
3 tasks done

Additional series which is calculated based on other series #853

hindseb opened this issue Jan 15, 2025 · 0 comments
Labels
feature-request New feature or request

Comments

@hindseb
Copy link

hindseb commented Jan 15, 2025

Checklist

  • I am running the latest version of the card
  • I checked if there isn't another feature request opened with the same request
  • I checked that the feature is not already available in the dev branch

Is your feature request related to a problem? Please describe.
I am trying to show the efficiency of my heating system. Thus, I am showing the heating duration per unit (living-, bedroom & office) and the heating degree days.
To show the efficiency, I would like to calculate a ratio, ie the sum of all heating units, over the degree days. In the below example, it would be (8.5 + 9.4 + 4.4) / 57.5 = 0.3878

As I would like to show this information based on my grouping (day, week, month etc), I would like to calculate this in the graph and not as a new template.

Describe the solution you'd like
To be able to add series, which utilizes the data of existing series. Sample

  • entity: [no need of an entity]
    type: column
    yaxis_id: first
    statistics:
    type: change
    period: week
    align: end
    data_generator: |
    (series[1].data + series[2].data+series[3].data) \ series[0].data

Thanks for considering this.

image

`type: custom:apexcharts-card
experimental:
brush: true
header:
show: true
title: ApexCharts-Card
show_states: true
colorize_states: true
graph_span: 90day
span:
end: day
stacked: true
yaxis:

  • id: first
    decimals: 0
    min: 0
    max: 150
  • id: second
    opposite: true
    min: 0
    decimals: 0
  • id: third
    opposite: true
    min: 0
  • id: fourth
    opposite: false
    min: 0
    decimals: 0
    max: 140
    series:
  • entity: sensor.heating_degree_days
    type: line
    yaxis_id: second
    statistics:
    type: change
    period: week
    align: end
    stack_group: b
  • entity: sensor.living_room_heating_hours_today_total_increasing
    type: column
    yaxis_id: first
    statistics:
    type: change
    period: week
    align: end
    show:
    datalabels: false
    stack_group: a
  • entity: sensor.bedroom_heating_hours_today_total_increasing
    type: column
    yaxis_id: first
    statistics:
    type: change
    period: week
    align: end
    show:
    datalabels: false
    stack_group: a
  • entity: sensor.office_heating_hours_today_total_increasing
    type: column
    yaxis_id: first
    statistics:
    type: change
    period: week
    align: end
    show:
    datalabels: false
    stack_group: a
    `
@hindseb hindseb added the feature-request New feature or request label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant