Shift setpoint up and down Heatpump

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Derik
Posts: 1605
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Shift setpoint up and down Heatpump

Post by Derik »

Hi,
I have a Panasonic heatpump with a heishamon so i can switch with mqtt.
I will make a simple dz vents script so i can switch my heatcruve up and down. [ on different variable setpoints ]

I do have:
ScreenShot298.png
ScreenShot298.png (18.48 KiB) Viewed 342 times
ScreenShot297.png
ScreenShot297.png (10.91 KiB) Viewed 342 times
And try a simple script to start:

Code: Select all

return {
	on = {
		timer = {'every 1 minutes' },
	},
	
	execute = function(domoticz)
        local setPoint = 12956 -- wp warm shift
        local roomTemperatureId = "TV Woonkamer.rawData[1]"-- Woonkamer TV 14844
        local Time = require('Time')
        local currentTime = Time()

        if currentTime.matchesRule("between 6:05 and 15:35") and roomTemperatureId <= 22 then
            updateSetPoint(-1)
            domoticz.notify("tester aan", domoticz.PRIORITY_NORMAL,domoticz.SOUND_DEFAULT, "" , "")
            domoticz.log('1 WP shiften if -1 !')
            
        elseif currentTime.matchesRule("between 6:05 and 15:35") and roomTemperatureId > 22.0 then
            updateSetPoint(2)
            domoticz.notify("Tester uit", domoticz.PRIORITY_NORMAL,domoticz.SOUND_DEFAULT, "" , "")   
            domoticz.log('1 WP shiften if 2 !')

            
        end
    
	end
}
Log says:

Code: Select all

2022-12-26 13:37:00.384 Status: dzVents: Info: ------ Start internal script: 1 WP Shiften:, trigger: "every 1 minutes"
Only no change @ all

I think Setpoint is the problem? Only when i read the wiki i cannot find a other option to switch or set a other setpoint.

Where do i go wrong?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
waltervl
Posts: 6691
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Shift setpoint up and down Heatpump

Post by waltervl »

To get a current temperature value of a temperature device use something. Like

Code: Select all

local currentTemp = domoticz.devices(IDX).temperature
To set a setpoint to -1 use something like

Code: Select all

 domoticz.devices(IDX).setSetpoint(-1)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Derik
Posts: 1605
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Shift setpoint up and down Heatpump

Post by Derik »

Thanks...
Make some changes..:-0:

Code: Select all

return {
	on = {
		timer = {'every 1 minutes' },
	},
	
	execute = function(domoticz)
        local setPoint = 12956 -- wp warm shift
        local currentTemp = domoticz.devices(14844).temperature
        local Time = require('Time')
        local currentTime = Time()

        if currentTime.matchesRule("between 6:05 and 15:35") and currentTemp <= 22 then
            domoticz.devices(12956).setSetpoint(1)
            domoticz.notify("tester aan", domoticz.PRIORITY_NORMAL,domoticz.SOUND_DEFAULT, "" , "")
            domoticz.log('1 WP shiften if -1 !')
            
        elseif currentTime.matchesRule("between 6:05 and 15:35") and currentTemp > 22.0 then
            domoticz.devices(12956).setSetpoint(-1)
            domoticz.notify("Tester uit", domoticz.PRIORITY_NORMAL,domoticz.SOUND_DEFAULT, "" , "")   
            domoticz.log('1 WP shiften if 2 !')

            
        end
    
	end
}
Not switching anything, lag says the same .
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
waltervl
Posts: 6691
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Shift setpoint up and down Heatpump

Post by waltervl »

Try to remove the currenttime.matchrule to debug if temp is working.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Derik
Posts: 1605
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Shift setpoint up and down Heatpump

Post by Derik »

mmm also not working:

Code: Select all

return {
	on = {
		timer = {'every 1 minutes' },
	},
	
	execute = function(domoticz)
        local setPoint = 12956 -- wp warm shift
        local currentTemp = domoticz.devices(14844).temperature
        local Time = require('Time')
        local currentTime = Time()

        --if currentTime.matchesRule("between 6:05 and 22:35") and currentTemp <= 22 then
                    if debug("between 6:05 and 22:35") and currentTemp <= 22 then

            domoticz.devices(12956).setSetpoint(1)
            domoticz.notify("tester aan", domoticz.PRIORITY_NORMAL,domoticz.SOUND_DEFAULT, "" , "")
            domoticz.log('1 WP shiften if -1 !')
            
        --elseif currentTime.matchesRule("between 6:05 and 22:35") and currentTemp > 22.0 then
                    elseif debug("between 6:05 and 22:35") and currentTemp > 22.0 then

            domoticz.devices(12956).setSetpoint(-1)
            domoticz.notify("Tester uit", domoticz.PRIORITY_NORMAL,domoticz.SOUND_DEFAULT, "" , "")   
            domoticz.log('1 WP shiften if 2 !')

            
        end
    
	end
}
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
waltervl
Posts: 6691
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Shift setpoint up and down Heatpump

Post by waltervl »

Please do not take me to literally :-)
Just remove the matchrule stuff to end up with something something like.

Code: Select all

if currentTemp <= 22 then
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest