Window open -> stop heating

For heating/cooling related questions in Domoticz

Moderator: leecollings

Post Reply
groovesurfer
Posts: 8
Joined: Monday 28 September 2020 22:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany
Contact:

Window open -> stop heating

Post by groovesurfer »

Hello,

I use different heating sensors (Eurotronic Spirit) and windows open/closed sensors.
Now I want the heating sensor to lower the temperature to 10 degrees when the window is opened. When the window is closed again, the temperature should return to the previous value.
I tried to do this with the following event: Image
This works, but the heating sensor continuously readjusts (every 30 seconds) loudly.
Is there any other way to do this?
My heating plan:
0am - 18 degrees
6am - 21 degrees
9pm - 18 gedrees
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Window open -> stop heating

Post by waaren »

groovesurfer wrote: Monday 28 September 2020 23:02 I use different heating sensors (Eurotronic Spirit) and windows open/closed sensors.
Is there any other way to do this?
I would not know how to do this in Blockly (probably something with an additional uservariable)
but in dzVents it could look like below script.

When not yet familiar with dzVents please start with reading Get started Before implementing (~ 5 minutes). Special attention please for "In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents enabled' is checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."

Code: Select all

return
{
    on =
    {
        devices =
        {
            'Türe Terrasse',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG, -- change to domoticz.LOG_ERROR when all ok
        marker = 'Heizung',
    },

    execute = function(dz, item)

        local heizung = dz.devices('Heizung Wohnzimmer')

        local function setSetPoint(dv, setPoint)
            local function round(value)
                return dz.utils.round(value, 1)
            end
            if round(dv.setPoint) ~= round(setPoint) then
                dv.updateSetPoint(round(setPoint))
            end
        end

        local function thermostat(dv)
            local setPoint = 18
            if dz.time.matchesRule('at 06:00-21:00') then
                setPoint = 21
            end
            setSetPoint(dv, setPoint)
        end

        dz.log(item.name .. ' updated. State is now ' .. item.state,dz.LOG_DEBUG)

        if item.state == 'Open' then
            setSetPoint(heizung, 10)
        else
            thermostat(heizung)
        end
    end
} 
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
groovesurfer
Posts: 8
Joined: Monday 28 September 2020 22:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany
Contact:

Re: Window open -> stop heating

Post by groovesurfer »

Thank you very much for your reply.
The script works, but when I open the door/window (the heating sensor goes to 10 degrees) an close it again, it goes to 18 degrees and not to 21.
What can I do?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Window open -> stop heating

Post by waaren »

groovesurfer wrote: Tuesday 29 September 2020 9:08 The script works, but when I open the door/window (the heating sensor goes to 10 degrees) an close it again, it goes to 18 degrees and not to 21.
What can I do?
Please try again after changing the line

Code: Select all

if dz.time.matchesRule('06:00-21:00') then
to

Code: Select all

if dz.time.matchesRule('at 06:00-21:00') then
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
groovesurfer
Posts: 8
Joined: Monday 28 September 2020 22:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany
Contact:

Re: Window open -> stop heating

Post by groovesurfer »

Cool, that works. Thank you very much.
groovesurfer
Posts: 8
Joined: Monday 28 September 2020 22:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany
Contact:

Re: Window open -> stop heating

Post by groovesurfer »

Now it´s after 21:00 o´clock and the heating didn´t change the temperature to 18 degrees.
What can be the mistake?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Window open -> stop heating

Post by waaren »

groovesurfer wrote: Tuesday 29 September 2020 22:22 Now it´s after 21:00 o´clock and the heating didn´t change the temperature to 18 degrees.
What can be the mistake?
So far the script only reacted to a device event. This one should also control the thermostat time based.

Code: Select all

return
{
    on =
    {
        devices =
        {
            'Türe Terrasse',
        },
        timer =
        {
            'at 06:00',
            'at 21:01',
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG, -- change to domoticz.LOG_ERROR when all ok
        marker = 'Heizung',
    },

    execute = function(dz, item)

        local heizung = dz.devices('Heizung Wohnzimmer')

        local function setSetPoint(dv, setPoint)
            local function round(value)
                return dz.utils.round(value, 1)
            end
            if round(dv.setPoint) ~= round(setPoint) then
                dv.updateSetPoint(round(setPoint))
            end
        end

        local function thermostat(dv)
            local setPoint = 18
            if dz.time.matchesRule('at 06:00-21:00') then
                setPoint = 21
            end
            setSetPoint(dv, setPoint)
        end

        if item.isTimer then 
            thermostat(heizung)
        else
            dz.log(item.name .. ' updated. State is now ' .. item.state,dz.LOG_DEBUG)
            if item.state == 'Open' then
                setSetPoint(heizung, 10)
            else
                thermostat(heizung)
            end
        end
    end
} 
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
harrykausl
Posts: 184
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Window open -> stop heating

Post by harrykausl »

I have the same constellation with the Eurotonics and window-sensors. I did it in another way. When window is opended, I change the haeating mode to off, when window is closed, I turn it on again. It switches automatically to the last temperature. The time based temperatures are onyl handled in time-plans of the thermostat device. To switch the heater off or on, I have a dummy-switch. When turning this off or on, the eurotonics changes the mode. The advantage of this is, that I see automatically at this switch, if all works correct when window status changes. All is done with lua.
groovesurfer
Posts: 8
Joined: Monday 28 September 2020 22:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany
Contact:

Re: Window open -> stop heating

Post by groovesurfer »

Thank you for your posts.
@harry: can you tell me it how you have done it with lua? I never used lua before.
harrykausl
Posts: 184
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: Window open -> stop heating

Post by harrykausl »

If you want to do it with lua, you should test a little bit with that environment. Then I can try to help you.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Window open -> stop heating

Post by waaren »


groovesurfer wrote: I never used lua before.
Yes you did Image
dzVents is 100% Lua



Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
groovesurfer
Posts: 8
Joined: Monday 28 September 2020 22:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany
Contact:

Re: Window open -> stop heating

Post by groovesurfer »

ah ok :lol:
The script (waaren) works now perfect.
Thank you ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest