Combining graphs

Hi,

I would like to combine 2 sensors outputs in 1 graph.
I have set both with unit_of_measurement to Watt, but still the graphs do not combine:

history_graph:
   energie_vandaag:
   name: Energie vandaag
   entities:
     - sensor.energie_stroom_verbruik
     - sensor.power_generation

sensors;
    power_generation:
        value_template: '{% if is_state_attr("sensor.pvoutput", "power_generation", "NaN") %}0{% else %}{{ states.sensor.pvoutput.attributes.power_generation }}{% endif %}'
        friendly_name: 'Generating'
        unit_of_measurement: 'Watt'

    energie_stroom_verbruik:
        friendly_name: Stroom verbruik
        value_template: >
        {%  if states.sensor.power_consumption.state != "unknown" %}
        {{ states.sensor.power_consumption.state | float * 1000 }}
        {% else %}
        "unknown"
        {% endif %}
        unit_of_measurement: 'Watt'

Naamloos

I doubt this can easily be done, but if you find a way, let me know. I use Grafana & Influxdb for my graphing requirements…

you should be able to do it in the history graph component:

https://home-assistant.io/components/history_graph/

1 Like

The second graph shows ‘W’ instead of ‘Watt’, while the sensor’s unit_of_measurement is right.
Maybe you have some customizing for the sensor?

FYI new URL of History Graph: History Graph Card - Home Assistant