Hotwater controll by time and temperature

Post Reply
kre10
Posts: 4
Joined: Sunday 15 April 2018 18:25
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: BG
Contact:

Hotwater controll by time and temperature

Post by kre10 » Monday 16 April 2018 9:26

Hello i have SONOFF TH16 and connect my boiler for hotwater
and i need to control temperature at day and night for economy electricity.
but blocky not work correct and run on or off every minute. and i think not run when i need on rule.
can we help with script
Attachments
day.png
day.png (25.18 KiB) Viewed 360 times

User avatar
waaren
Posts: 482
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Hotwater controll by time and temperature

Post by waaren » Monday 16 April 2018 12:14

kre10 wrote:
Monday 16 April 2018 9:26
Hello i have SONOFF TH16 and connect my boiler for hotwater
and i need to control temperature at day and night for economy electricity.
but blocky not work correct and run on or off every minute. and i think not run when i need on rule.
can we help with script
in dzVents: something like this ?

Code: Select all

 --[[ 
    th15Test
    checkFirst() available in dzVents > 2.3.0
]]-- 
 
return { 
    on = { timer = { 'at 06:00-22:00 every 5 minutes'},
          },

    execute = function(dz,_)
        if dz.devices("HotWater:temp").temperature <= 40 then 
            dz.devices("HotWater:Relay").switchOn().checkFirst()
        elseif dz.devices("HotWater:temp").temperature >= 50 then
            dz.devices("HotWater:Relay").switchOff().checkFirst()
        end
end
}
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave , dzVents 2.4.n, Amazon echo

User avatar
Domosapiens
Posts: 371
Joined: Wednesday 20 August 2014 12:08
Target OS: Windows
Domoticz version: V3.5981
Location: NL
Contact:

Re: Hotwater controll by time and temperature

Post by Domosapiens » Monday 16 April 2018 12:40

Kre10, some remarks:
- Nested IF is not allowed (remove the outer IF)
- Use the IF with the blue star when ELSE is involved (correct for your inner IF)
- use a Dummy Switch Device and let it switch ON at 6 and switch OFF at 22hr (with the Timer of the device)
- combine this Dummy Switch in the IF part and in the ELSEIF part
- make sure the Blockly is of the type "Devices"

No need for scripts !
Win Vista&7; 1#Aeon Z-Stick S2; 1#Aeotec Z-Sick Gen5, 6#Fib.FGBS001; 24#DS18B20; 8#Everspr.AN158-2; 3#Philio PAN04; 1#Philio PAN06, 1#YouLess El; 1#Fib.FGWPE; 1#ZME_RC2; 2#FAK_ZWS230, 2#Quib.ZMNHCDx, 1#Quib.ZMNHDD1, 7#EM6555

jkimmel
Posts: 185
Joined: Monday 25 November 2013 18:51
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: Hotwater controll by time and temperature

Post by jkimmel » Monday 16 April 2018 12:49

in dzVents: something like this ?

Code: Select all

 --[[ 
    th15Test
    checkFirst() available in dzVents > 2.3.0
]]-- 
 
return { 
    on = { timer = { 'at 06:00-22:00 every 5 minutes'},
          },

    execute = function(dz,_)
        if dz.devices("HotWater:temp").temperature <= 40 then 
            dz.devices("HotWater:Relay").switchOn().checkFirst()
        elseif dz.devices("HotWater:temp").temperature >= 50 then
            dz.devices("HotWater:Relay").switchOff().checkFirst()
        end
end
}

What will the state of the relay be from 22:00 to 06:00?
Rfxcom

kre10
Posts: 4
Joined: Sunday 15 April 2018 18:25
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: BG
Contact:

Re: Hotwater controll by time and temperature

Post by kre10 » Monday 16 April 2018 21:21

i need to control temperature for daytime from 06:00-22:00 - 50C and from 22:00 to 06:00 - to max or 70C maximum
but when i test dzVents script not work correctly, i mean doesn't turn on switch but my temp is 30C. when i test

kre10
Posts: 4
Joined: Sunday 15 April 2018 18:25
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: BG
Contact:

Re: Hotwater controll by time and temperature

Post by kre10 » Monday 16 April 2018 23:21


User avatar
Denny64
Posts: 38
Joined: Friday 03 February 2017 12:34
Target OS: Raspberry Pi
Domoticz version: 3.5877
Location: Italy
Contact:

Re: Hotwater controll by time and temperature

Post by Denny64 » Wednesday 18 April 2018 18:07

I think this is the right way with blockly:

If Time ≥ 06:00 And Time ≤ 21:59 And HotWater: temp ≤ 40 And HotWater: Relay = Off
Set HotWater: Relay = On
Else If Time ≥ 06:00 And Time ≤ 21:59 And HotWater: temp ≥ 50 And HotWater: Relay = On
Set HotWater: Relay = Off
Else If Time ≥ 22:00 And Time ≤ 05:59 And HotWater: temp ≤ 70 And HotWater: Relay = Off
Set HotWater: Relay = On
Else If Time ≥ 22:00 And Time ≤ 05:59 And HotWater: temp ≥ 70 And HotWater: Relay = On
Set HotWater: Relay = Off

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests