Page 1 of 1

intergas script not working

Posted: Friday 01 April 2022 19:40
by Gravityz
i am using this script to update the intergas gateway but it is not working.
it does not update the value in the gateway

if i however copy/paste the http string in a browser it works as expected.
can anybody see what is wrong?
i tried setting SetTemperature to 160 but that did not work either
it looks like nothing is send to the http page

Code: Select all

                                    -- DzVents script for updating setpoint of LAN2RF Incomfort Gateway Intergas
                                    -- V1.0 (september 2020)
                                    
local IPADDRESS = '192.168.1.80'   -- IP address of LAN2RF Gateway
local USER = 'admin'                -- login credentials LAN2RF Gateway
local PASSWORD = 'password'            -- login credentials LAN2RF Gateway
local THERMOSTAAT = 'Thermostaat'   -- Thermostaat domoticz device name


return {
	on = {
		devices = {
			THERMOSTAAT,
		}
	},
	execute = function(domoticz, device)
	    domoticz.log('Thermostaat setpoint was changed, updating LAN2RF Incomfort Gateway', domoticz.LOG_INFO)
        
        -- Calculating setpoint (see Intergas API documentation)
        local SetTemperature = (domoticz.devices(THERMOSTAAT).setPoint - 5) * 10
		-- Update LAN2RF Gateway
		domoticz.openURL({
			url = 'http://' .. USER .. ':' .. PASSWORD .. '@' .. IPADDRESS .. '/protect/data.json?heater=0&setpoint=' .. SetTemperature .. '&thermostat=0',
			method = 'GET',
			})		
	end
}
this string does work

Code: Select all

http://admin:[email protected]/protect/data.json?heater=0&setpoint=160&thermostat=0

Re: intergas script not working

Posted: Saturday 02 April 2022 16:21
by Gravityz
it looks like the script is not triggered when the thermostat value is changed.

Re: intergas script not working

Posted: Saturday 02 April 2022 16:31
by waltervl
It should be triggered if there is a change of device 'thermostaat'
Is that what you would expect?
Do you see the statement 'Thermostaat setpoint was changed, updating LAN2RF Incomfort Gateway' in the log file?
Else change in the on devices section the variable THERMOSTAAT by the idx or 'thermostaat'

Re: intergas script not working

Posted: Saturday 02 April 2022 17:04
by Gravityz
Hi waltervl
when changing the thermostat i only see this mesage

Code: Select all

Intergas InComfort: Setpoint of sensor with idx idx changed to temp
this device is a real device which was generated by the LAN2RF plugin.
also changing the trigger to the real name or IDX did not work.

you however gave me an idea.
I made a second dummy thermostat and that one is reacting and triggering like it should
i am now using the dummy thermostat to update the intergas incomfort gateway which in turn updates he real thermostat setpoint

so this is a workaround from domoticz to the real thermostat.
The other way around(changing the real thermostat) also changes the real thermostat in domoticz but does not update the dummy one.

i have to figur out a way to do that without causing a loop.

so bottomline. the Intergas InComfort LAN2RF Gateway plugin has a bug which prevents the thermostat setpoint being used(there is no feedback directly to the real thermostat)
as a workaround you need a script to update the real thermostat but since that script can not be triggered by the thermostat device in domoticz you need a second, dummy thermostat, to fix this.

a lot of workarounds but we are getting there