Page 1 of 1

Blocky and ventilation with two sensors

Posted: Sunday 29 November 2020 16:39
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?

Re: Blocky and ventilation with two sensors

Posted: Sunday 29 November 2020 17:01
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.

Re: Blocky and ventilation with two sensors

Posted: Sunday 29 November 2020 18:11
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!

Re: Blocky and ventilation with two sensors

Posted: Sunday 29 November 2020 20:10
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.

Re: Blocky and ventilation with two sensors

Posted: Monday 30 November 2020 8:37
by rolandtwilt
thank you very much and have a nice day

Re: Blocky and ventilation with two sensors

Posted: Wednesday 02 December 2020 16:25
by rolandtwilt
The script is a great start and I'm starting to get it, thanks again

Re: Blocky and ventilation with two sensors

Posted: Sunday 06 December 2020 16:05
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!!