Custom component to get usage data from Falu Energi & Vatten for Home Assistant.
Falu Energi & Vatten doesn't have an open api, so we are acting as a Chrome user logging in with username (or customer number) and password.
Data is fetched every hour by default. This is kind of excessive since they only update the data once a day around 00:00.
- Navigate to your HA configuration folder (the one with
configuration.yaml
in it). - If you do not have a
custom_components
folder there, create it. - In the
custom_components
folder, create a new folder calledfalu_energi_vatten
. - Download or clone the repository.
- Place the files you downloaded in the new folder you created.
Using your HA configuration folder as a starting point, it should now look something like this:
custom_components/falu_energi_vatten/__init__.py
custom_components/falu_energi_vatten/manifest.json
custom_components/falu_energi_vatten/README.md
custom_components/falu_energi_vatten/sensor.py
Add the sensor to configuration.yaml
:
sensor:
- platform: falu_energi_vatten
username: 123456 # Could be username or customer number
password: password1
Example chart with ApexCharts Card
type: custom:apexcharts-card
header:
show: true
title: Förbrukning per dag
graph_span: 30d
span:
start: day
offset: '-30d'
yaxis:
- id: usage
min: 0
apex_config:
dataLabels:
enabled: true
stroke:
width: 2
series:
- entity: sensor.falu_energi_vatten_usage
name: Förbrukning
yaxis_id: usage
type: line
extend_to_end: false
show:
legend_value: false
data_generator: |
return entity.attributes.usage_per_day.map((entry) => {
return [new Date(entry.date), entry.usage];
});