Utility to fetch Fortum Energy consumption data from 'My Fortum'
- go >= 1.21.0
- chromium (chrome)
git clone https://github.com/ikaakkola/fortum-fetch.git
cd fortum-fetch
go build
Optionally symlink the generated binary fortum-fetch
to somewhere in $PATH
Run fortum-fetch -h
for usage information
Configuration values are read from ~/.config/fortum_fetch
(YAML)
For example to persist login details and some usage configuration values:
# username for My Fortum
user: "[email protected]"
# password for My Fortum
password: "super secret password"
usage:
# only process a single metering point
metering-point-id: "12345678901234567890"
# set the source time zone (timezone for values visible in My Fortum)
tz: "Europe/Helsinki"
The output format can be configured with a text template. The template is called once for each row of data, with the following fields:
- Time
- CustomerId
- MeteringPointId
- MeteringPointNo
- MeteringPointAddress
- Energy
- Cost
For example, to print each row with only the time and energy values:
{{.Time}} {{.Energy}}\n