[SOLVED] Intergas - disabling/enabling heater when door opens

For heating/cooling related questions in Domoticz

Moderator: leecollings

Post Reply
awtjes
Posts: 5
Joined: Friday 02 May 2025 16:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

[SOLVED] Intergas - disabling/enabling heater when door opens

Post by awtjes »

Hi all,

I have an Intergas LAN2RF gateway, version 1.3 (this one needs authenticating when you want set values)
I have Domoticz Version: 2025.1 (build 16657) on a Raspberry Pi

What I want to achieve is that when our sliding-door in the Livingroom is opened, the heating will be disabled, or set to a very low setpoint.
And when de door is closed again, the heating needs to be re-enabled.

I tried to change the temperature setpoints to 5 degrees when the door opens, and when the door closes to 22 degrees. That works.
By the way, I did that with Blockly, very easy to achieve, but scripting is also possible.

But there is a challenge: I am also using a pre-programmed week schedule in the room-thermostat.

So when the doors opens, the best action would be not only set the setpoint very low, but also disable the week-schedule.
For example: schedule says temperature set to 22 degrees at 15:00h, but I opened the door at 14:50h and it is still open.
Then the heating will be turned on, because the week schedule overrides the "manually" set setpoint.

My idea is this:
door open: After 30 seconds disable the week schedule and temperature setpoint at 5.0 degrees Celsius (lowest value)
door close: After 30 seconds enable the week schedule (setpoint is automatically set from the schedule then)

Time out of 30 seconds to avoid too much "switching" when the door is opened/closed in a short period of time.

I found several posts describing setting setpoints, reading out values, but I can't find the setting/syntax for the week schedule.

Does anybody have the API of the Intergas Gateway? (found a link in a post from 2015, but that link is broken)
Or does somebody know how to enable/disable the week schedule with a script?

Thanks!
Last edited by awtjes on Saturday 20 September 2025 10:04, edited 1 time in total.
User avatar
habahabahaba
Posts: 266
Joined: Saturday 18 March 2023 14:44
Target OS: Windows
Domoticz version: 2024.4
Contact:

Re: Intergas - disabling/enabling heater when door opens

Post by habahabahaba »

So you can change temp setpoint of thermostat from Domoticz.
and you have some door contact...

You need Dzvents script that is activated by door contact and by timer (5 min?)

1. the script is activated by sensor: means the door is open/close -> set temp to low/high or off/on heating
2. the script is activated by timer:
- check the state of the door sensor
- if it is open -> set temp to low or off heating
- if it is close -> set temp to high or on heating

In this case you dont need to operate by the shedule
HvdW
Posts: 663
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Intergas - disabling/enabling heater when door opens

Post by HvdW »

You can check the setpoint every 1, 2, 3, 5 minutes and act accordingly.

I'd say tell your story to AI, tell it which sensors you have, publish your posts here, say the magic word dzVents and you'll get your solution in seconds.
Bugs bug me.
awtjes
Posts: 5
Joined: Friday 02 May 2025 16:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Intergas - disabling/enabling heater when door opens

Post by awtjes »

HvdW wrote: Sunday 04 May 2025 15:42 You can check the setpoint every 1, 2, 3, 5 minutes and act accordingly.

I'd say tell your story to AI, tell it which sensors you have, publish your posts here, say the magic word dzVents and you'll get your solution in seconds.
I'ver tried this, but it returns direct http-requests which the Intergas Internet Gateway does not accept. Or am I missing something?
awtjes
Posts: 5
Joined: Friday 02 May 2025 16:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Intergas - disabling/enabling heater when door opens

Post by awtjes »

habahabahaba wrote: Sunday 04 May 2025 9:25 So you can change temp setpoint of thermostat from Domoticz.
and you have some door contact...

You need Dzvents script that is activated by door contact and by timer (5 min?)

1. the script is activated by sensor: means the door is open/close -> set temp to low/high or off/on heating
2. the script is activated by timer:
- check the state of the door sensor
- if it is open -> set temp to low or off heating
- if it is close -> set temp to high or on heating

In this case you dont need to operate by the shedule
Do you mean that domoticz will keep sending the new setpoint over and over again, untill the door is closed?
akamming
Posts: 422
Joined: Friday 17 August 2018 14:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Intergas - disabling/enabling heater when door opens

Post by akamming »

Just for fun i asked this question to chatgpt using the following prompt:
Create a dzventz script based on the following info

So you can change temp setpoint of thermostat from Domoticz.
and you have some door contact...

You need Dzvents script that is activated by door contact and by timer (5 min?)

1. the script is activated by sensor: means the door is open/close -> set temp to low/high or off/on heating
2. the script is activated by timer:
- check the state of the door sensor
- if it is open -> set temp to low or off heating
- if it is close -> set temp to high or on heating

In this case you dont need to operate by the shedule
I did not right away like the outcome cause the script did not remember the previous setpoint setting, so i entered a 2nd prompt:
adjust the script so it remembers the setpoint value
And chatgpt created the solution:

Code: Select all

return {
    on = {
        devices = { 'Door Sensor' },  -- Replace with your door sensor name
        timer = { 'every 5 minutes' }
    },

    data = {
        lastDoorState = { initial = '' }
    },

    logging = {
        level = domoticz.LOG_INFO,
        marker = "DoorHeatingControl"
    },

    execute = function(domoticz, trigger)
        local door = domoticz.devices('Door Sensor')       -- Replace with your door sensor name
        local thermostat = domoticz.devices('Thermostat')  -- Replace with your thermostat name

        local tempLow = 15  -- Temperature to set when door is open

        -- Ensure the variable exists
        local savedVar = domoticz.variables('ThermoSavedSetpoint')
        if not savedVar then
            domoticz.variables.create('ThermoSavedSetpoint', 21)  -- Default to 21 if not set
            savedVar = domoticz.variables('ThermoSavedSetpoint')
        end

        if door.state == 'Open' then
            if domoticz.data.lastDoorState ~= 'Open' then
                -- Save the current setpoint only when door first opens
                savedVar.set(thermostat.setPoint)
                thermostat.updateSetPoint(tempLow)
                domoticz.log("Door opened -> saved setpoint (" .. savedVar.value .. ") and set thermostat to LOW (" .. tempLow .. "°C)", domoticz.LOG_INFO)
            end
            domoticz.data.lastDoorState = 'Open'

        elseif door.state == 'Closed' then
            if domoticz.data.lastDoorState ~= 'Closed' then
                -- Restore previous setpoint when door closes
                thermostat.updateSetPoint(savedVar.value)
                domoticz.log("Door closed -> restored thermostat to previous setpoint (" .. savedVar.value .. "°C)", domoticz.LOG_INFO)
            end
            domoticz.data.lastDoorState = 'Closed'
        else
            domoticz.log("Unknown door state: " .. door.state, domoticz.LOG_ERROR)
        end
    end
}
it also stated:

Code: Select all

Setup Checklist:
- Create a user variable in Domoticz named ThermoSavedSetpoint (type: Integer), or let the script create it automatically.
- Replace the device names (Door Sensor, Thermostat) accordingly.
- Optional: adjust tempLow for your "door open" fallback temperature.
I am impressed with chatgpt. I hope this helps @awtjes. And i will use chatgpt a lot more to create or modify my dzvents scripts...
awtjes
Posts: 5
Joined: Friday 02 May 2025 16:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Intergas - disabling/enabling heater when door opens

Post by awtjes »

@akamming

tnx! I did a similar request, but my result was something completely different, which didn't work obviously.
Your script is getting me in the right direction.

In the mean time I learned that a (week)schedule is generated and controlled by the room-thermostat.

And with this script to the Internet Gateway you control the boiler directly, by overriding the setpoint coming from the room-thermostat.
The challenge now is, if the room-thermostat needs to change the temperature because of a scheduled time, then it will override the setting made by Domoticz.

So, if I understand correctly, your script stores the previously set setpoint, and when the door closes, that setpoint is restored.
That will work without any problems, but what happens if the room-thermostat changes the setpoint because of the active schedule (e.g. at 15:00h setpoint becomes 22,5 degrees) but the door is opened at 14:50h, and is still open at 15:00h ?

When the door is still open, the setpoint needs to stay at "low", but when the door closes, the setpoint needs to be at the temperature according to the schedule. (which could be different than the previously set setpoint)

Or am I missing something?
User avatar
habahabahaba
Posts: 266
Joined: Saturday 18 March 2023 14:44
Target OS: Windows
Domoticz version: 2024.4
Contact:

Re: Intergas - disabling/enabling heater when door opens

Post by habahabahaba »

awtjes wrote: Tuesday 06 May 2025 11:12 Do you mean that domoticz will keep sending the new setpoint over and over again, untill the door is closed?
In the simplest way yes, you can do so.
But i gave you just a direction to think :)

Using user variables you can store as much setpoints as you need - for opened door, closed door, winter, summer... And chek all conditions before sending data to thermostat.

Or just force sendig data you need
awtjes
Posts: 5
Joined: Friday 02 May 2025 16:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

**[SOLVED]Re: Intergas - disabling/enabling heater when door opens

Post by awtjes »

**[SOLVED] dzVents script: Automatic CV override when sliding door is open**

Hi all,

After some helpful input from the community (also M365 Copilot) and further testing, I’d like to share the final working solution for my setup. The goal was to automatically override the central heating (CV) setpoint when a sliding door (Zone:Schuifpui) is open, and restore it when the door is closed — without interfering with the clock thermostat when the door is closed.

---

### ✅ **Functionality**
This dzVents script does the following:

- **When the sliding door opens (status = 3):**
- The current setpoint from the clock thermostat is saved in a user variable.
- The override setpoint is immediately set to **5°C** to prevent heating.

- **While the door remains open:**
- The script runs every 2 minutes.
- If the clock thermostat changes its setpoint (e.g. due to a scheduled time block), the new value is saved.
- The override is re-applied to **5°C** to ensure heating remains off.

- **When the sliding door closes (status = 1):**
- The previously saved clock thermostat value is restored as the override setpoint.
- After this, the script stops interfering, and the clock thermostat regains control.

---

### 🧠 **Design Notes**
- Timer interval: **every 2 minutes** (to minimize unnecessary heating while keeping Domoticz responsive).
- Logging: only **relevant actions** are logged (setpoint changes, overrides, restorations).
- No debounce: all setpoint changes from the clock thermostat are intentionally captured.
- No notifications or override time limits — the door will always eventually close.

---

### 💻 **Script (with comments)**

```lua

Code: Select all

--[[ 
Script name: cv_override_schuifpui.lua
Description: Automatically overrides CV setpoint when sliding door is open.
Author: Eric & Copilot
--]]

return {
    active = true,
    on = {
        timer = { 'every 2 minutes' },
        devices = { 'Zone:Schuifpui' }
    },
    logging = {
        level = domoticz.LOG_INFO,
        marker = 'Script CV uit bij open schuifpui'
    },
    execute = function(domoticz, trigger)
        local schuifpui = domoticz.devices('Zone:Schuifpui')
        local overrideSetpoint = domoticz.devices('Room Override Setpoint')
        local klokwaardeVar = domoticz.variables('klok_setpoint_backup')

        if not schuifpui or not overrideSetpoint or not klokwaardeVar then
            domoticz.log('Required devices or variable not found!', domoticz.LOG_ERROR)
            return
        end

        local status = tonumber(schuifpui.rawData[1]) or schuifpui.numericValue
        local huidigSetpoint = overrideSetpoint.setPoint or overrideSetpoint.temperature
        local opgeslagenSetpoint = tonumber(klokwaardeVar.value)

        if status == 3 then
            -- Door is open
            if trigger.isDevice then
                klokwaardeVar.set(huidigSetpoint)
                if huidigSetpoint ~= 5 then
                    domoticz.log('Door opened → override to 5°C', domoticz.LOG_INFO)
                    overrideSetpoint.updateSetPoint(5)
                end
            end

            if trigger.isTimer then
                if huidigSetpoint ~= opgeslagenSetpoint and huidigSetpoint ~= 5 then
                    domoticz.log('New clock value detected during open door: ' .. huidigSetpoint .. '°C → override to 5°C', domoticz.LOG_INFO)
                    klokwaardeVar.set(huidigSetpoint)
                    overrideSetpoint.updateSetPoint(5)
                end
            end

        elseif status == 1 then
            -- Door is closed
            if trigger.isDevice then
                if opgeslagenSetpoint and huidigSetpoint ~= opgeslagenSetpoint then
                    domoticz.log('Door closed → restoring setpoint to clock value: ' .. opgeslagenSetpoint .. '°C', domoticz.LOG_INFO)
                    overrideSetpoint.updateSetPoint(opgeslagenSetpoint)
                end
            end
        end
    end
}
```

---

I hope this helps others with similar setups!

Best regards,
Eric
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest