Blocky and ventilation with two sensors Topic is solved

Moderator: leecollings

Post Reply
User avatar
rolandtwilt
Posts: 74
Joined: Monday 05 October 2020 18:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Blocky and ventilation with two sensors

Post by rolandtwilt »

Good morning, I've been puzzling for a while, while the solution is probably simple, but I can't. I would like the fan in the meter cupboard to start extracting when the temperature in the meter cupboard is 8 degrees higher than the temperature in the hall and then only stop extracting when the difference is less than 5 degrees. Example; meter cupboard temp is 38 degrees, hall 30, exhaust on until the temperature differences are only 5 degrees. (degrees randomly) Who can help me with an example Blocky?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Blocky and ventilation with two sensors

Post by waaren »

rolandtwilt wrote: Sunday 29 November 2020 16:39 Who can help me with an example Blocky?
I don't think you can calculate a delta temperature with a Blockly script.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
rolandtwilt
Posts: 74
Joined: Monday 05 October 2020 18:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blocky and ventilation with two sensors

Post by rolandtwilt »

In any case I have been helped because I do know the name of what I am looking for (delta temperature) thank you!
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Blocky and ventilation with two sensors

Post by waaren »

rolandtwilt wrote: Sunday 29 November 2020 18:11 In any case I have been helped because I do know the name of what I am looking for (delta temperature) thank you!
The dzVents script in this post might help to get you started.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
rolandtwilt
Posts: 74
Joined: Monday 05 October 2020 18:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blocky and ventilation with two sensors

Post by rolandtwilt »

thank you very much and have a nice day
User avatar
rolandtwilt
Posts: 74
Joined: Monday 05 October 2020 18:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blocky and ventilation with two sensors

Post by rolandtwilt »

The script is a great start and I'm starting to get it, thanks again
User avatar
rolandtwilt
Posts: 74
Joined: Monday 05 October 2020 18:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blocky and ventilation with two sensors

Post by rolandtwilt »

this has become the final script:

Code: Select all

-- temperature Delta
local temperatureInside = 'temperatuur hal'
local temperatureOutside = 'temperatuur meterkast'
local ventilate = 'ventilate'

return
{
    on = { devices = { temperatureInside, temperatureOutside, ventilate } },

    execute = function(dz, devices)
        
one = (dz.devices(temperatureOutside).temperature) - (dz.devices(temperatureInside).temperature) 
        a = 4
        b = 2
        if one > a then
            if dz.devices('ventilate').state == 'Off' then dz.devices('ventilate').switchOn() end
        end
        if one < b then
            if dz.devices('ventilate').state == 'On' then dz.devices('ventilate').switchOff() end
            end
    end
}
thanks a lot!!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest