I wanted to create a simple chart to show electricity consumption vs. the outdoor temperature.
Prerequisites:
- Home Assistant
- HACS (How to install)
- ApexCharts
- Outdoor temperature sensor
- Power-measuring on all the heating-devices
There are a lot of guides and videos of how to install HACS and ApexCharts if you don’t already have it. Just Google it 🙂
Summary
- Create a template-sensor that summarizes your devices power consumption.
- Create a chart that uses your outdoor temperature sensor and your created template-sensor.
Measure power usage
I have a lot of different heating options, like floor-heating, heat pump and panel oven. For my floor heating I use the Heatit Z-TRM3 thermostats. For my heat pumps I use Fibaro Wall Plug on one of them and a Aqara Single Switch Module T1 on the other. My panel ovens have a Fibaro Wall Plug.
Create a template-sensor
We will need a template-sensor to summarize all the power consumption from all our heating.
Go to Settings -> Devices & services -> Helpers -> Create helper.
Click the CREATE HELPER button.
Select «Template» in the list:
Select «Template a sensor«:
Fill in the form. You can find my template below the image, that you can copy, paste, and modify.
{{
states('sensor.termostat_bad_nede_electric_consumption_w') | float +
states('sensor.termostat_vaskerom_electric_consumption_w') | float +
states('sensor.gl_heatpump_power') | float +
states('sensor.varmepumpe_active_power') | float +
states('sensor.bad_oppe_panelovn_active_power') | float
}}
ApexChart card
Add a new card to your dashboard.
Insert the config. You need to change the two sensor entities to match your own.
type: custom:apexcharts-card
update_interval: 10min
graph_span: 2d
all_series_config:
stroke_width: 3
yaxis:
- id: first
decimals: 0
apex_config:
title:
text: Outdoor-temp
- id: second
decimals: 0
apex_config:
title:
text: Heating (W)
opposite: true
header:
show: true
title: Outdoor temp. vs. consumption
show_states: true
colorize_states: true
series:
- entity: sensor.MY_OUTDOOR_TEMPERATURE_SENSOR
yaxis_id: first
- entity: sensor.MY_TEMPLATE_SENSOR
yaxis_id: second
group_by:
func: avg
duration: 240m
fill: zero