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

Add raw value combination #346

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

veista
Copy link

@veista veista commented Oct 10, 2023

Data manipulation in HA is almost impossible, This is necessary to make a nice single graph. If you know a better way, do tell.

Data manipulation in HA is almost impossible, This is necessary to make a nice single graph.
@APayerl
Copy link

APayerl commented Nov 8, 2024

I have combined them using a template sensor like this (extract, could miss something but should be mostly ok.)

{% set today = now() %}
{% set prices = [[0, state_attr('sensor.nordpool_kwh_se3_sek_3_10_0', 'today')], [1, state_attr('sensor.nordpool_kwh_se3_sek_3_10_0', 'tomorrow')]] %}
                       
{%- set ns = namespace(coming = []) -%}
{%- for item in prices -%}
  {%- for price_list in item[1] -%}
    {%- set ns.coming = ns.coming + [price_list] -%}      
  {%- endfor -%}
{%- endfor -%}
            
{{ ns.coming }}

Should at least give you an idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants