This project implement integration to Caruna+ service, which offers information about the energy consumption of a metering point in Caruna network. Caruna+ service is available for Caruna's end customers for which Caruna is the electric network provider.
This implementation is based on Kimmo Linna's pycaruna, which is used unmodified here. I've moved the licence and readme-files from the root to pycaruna-folder
All configuration is done on the /caruna_integration/config.ini. Be default most of the values are taken from environment variables, for that reason settings can be changed, either by provided a /.env -file or by directly changing the configuration on the config.ini-file.
This integration can be run as python script or as dockerized container.
In this mode the script runs in endless single threaded loop until a key is pressed.
-
Valid Caruna+ user account
-
postgresql database with table energy_hourly (see Database)
-
python version 3 or above
-
Configuration done in the config.ini or as .env-file
In order to run the script the requirements needs to be installed. This can be done with command pip install -r requirements.txt
.
The script can be started with command python main.py
. Script runs with timeloop and fetches the data on the interval of seconds set in config.ini->job_interval
.
In this mode the script runs in an docker container.
-
Valid Caruna+ user account
-
postgresql database with table energy_hourly (see Database)
-
Docker
-
Configuration done in the config.ini or as .env-file
Before the appliction is run as container, it needs the image to be created. This can be created with command docker build -t jsdesign/caruna-integration:latest .
The docker container can be run with command docker run jsdesign/caruna-integration:latest
This integration relies on postgresql database and it pushes the data in to the table energy_hourly
.
(
id bigint NOT NULL DEFAULT nextval('energy_hourly_id_seq'::regclass),
datetime timestamp with time zone,
kwh_total double precision,
kwh_night double precision,
kwh_day double precision,
kwh_night_winter double precision,
tariff character varying COLLATE pg_catalog."default",
CONSTRAINT energy_hourly_pkey PRIMARY KEY (id),
CONSTRAINT datetime UNIQUE (datetime)
)```