Skip to content

ondrej337/PLPython-Daikin-Altherma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 

Repository files navigation

Postgres PLPython-Daikin-Altherma

Download data from Daikin Altherma to Postgres DB using PLPython

1. Instal Python Daikin-Altherma heat pump

https://pypi.org/project/python-daikin-altherma/

 pip install python-daikin-altherma

1.1 add lines to init.py:

@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")

2. Create Schema daikin, mycron

CREATE SCHEMA daikin;

CREATE SCHEMA mycron;

2.1 Create table daikin.daikin_wrap:

download file: daikin_wrap.sql

2.2 Create function mycron.py_daikin('IP_NUMBER')

download file: daikin_function.sql

2.3 Call function:

Call plpython function to copy data to dB:

SELECT mycron.py_daikin('192.168.0.100');

3. PGcron job:

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;

About

Download data from Daikin Altherma to Postgress DB using PLPython

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published