Download data from Daikin Altherma to Postgres DB using PLPython
https://pypi.org/project/python-daikin-altherma/
pip install python-daikin-altherma
@property
def tank_consumption(self) -> dict:
""" Returns the tank energy consumption in kWh per [D]ay, [W]eek, [M]onth """
return self._requestValueHP("2/Consumption/la", "m2m:rsp/pc/m2m:cin/con")
CREATE SCHEMA daikin;
CREATE SCHEMA mycron;
download file: daikin_wrap.sql
download file: daikin_function.sql
Call plpython function to copy data to dB:
SELECT mycron.py_daikin('192.168.0.100');
Create JOB:
SELECT cron.schedule ('Daikin_wrap','15,45 * * * *',$$select mycron.py_daikin('192.168.0.100')$$);
Unselect from cron: 13->id_job:
select cron.unschedule(13);
Table of the created jobs:
SELECT * FROM cron.job;
History of jobs run:
select * from cron.job_run_details order by runid desc;