LUA script to control heat pump optimizing power from photovoltaic!!

For heating/cooling related questions in Domoticz

Moderator: leecollings

Post Reply
User avatar
psubiaco
Posts: 222
Joined: Monday 20 August 2018 9:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Italy
Contact:

LUA script to control heat pump optimizing power from photovoltaic!!

Post by psubiaco »

Controlling the heat pump optimizing power consumption, is not really easy, but it's possible!
I'm using a LUA script + a configuration LUA file for this purpose, for both heating and cooling, and it works very very well!
Cooling only when there is enough energy from the photovoltaic system (no energy from the electric grid).
Heating: it trys to regulate the heat pump power to reduce power consumption when there is no power production from photovoltaic (and rooms are almost in temperature), and increase heat pump power, fluid temperature and zone setpoints when there is an extra photovoltaic production (it's better to heat the house a little bit more than the setpoint today, if it's sunny, because tomorrow it can be cloudy).

I've explain something in the following page, where you can find the commands to download the two LUA scripts.
https://www.creasol.it/support/domotics ... otovoltaic

I hope this can be useful for you. Any suggestions are welcome!
Last edited by psubiaco on Sunday 04 October 2020 0:07, edited 1 time in total.
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Controlling heat pump optimizing power usage

Post by waaren »

psubiaco wrote: Thursday 01 October 2020 0:02 IAny suggestions are welcome!
Thanks for sharing this.

I tried to download the two files but heatpump_conf.lua is missing from your github. I get a 404: Not Found with

Code: Select all

curl https://raw.githubusercontent.com/CreasolTech/domoticz_lua_scripts/master/heatpump_conf.lua

In the Lua code I see

Code: Select all

json=require("dkjson")
but "dkjson" is not included in the domoticz distribution. Domoticz does use ./scripts/lua/JSON.lua for converting a Lua table to JSON and the other way around
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
psubiaco
Posts: 222
Joined: Monday 20 August 2018 9:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Italy
Contact:

Re: Controlling heat pump optimizing power usage

Post by psubiaco »

Hi Waaren,
thanks a lot for both info.
I've just loaded heatpump_conf.lua in github, so now it's available.
About json, you can install lua-dkjson package as I did, or modify the script to use JSON.lua included in domoticz (this should be the preferred solution).
Have a nice day.
Paolo
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest