Page 1 of 1

HTTPResponse callback issues

Posted: Saturday 24 January 2026 0:49
by Gingerpale
Hi,
after installing 2nd last and last beta version v2025.2 (build 17053), the callback function of openURL doesn't fire every time I call it anymore.
Did anything change in this respect?
My (energy) dzvents scripts worked for 3 years up to now without any problem.
It's quite a large JSON response but when pasting the url in a web browser it works every time.
Any idea's? Or is there a better way to debug?

Part of the code is listed below, and the HTTPresponse routine is not reached consistently by the lack of the callback.

Code: Select all

return {
    on = {
        timer = {'every minute'},
        httpResponses = { 'http_response_P1' }
		},
	logging = {	level = domoticz.LOG_DEBUG,
			marker = 'Test Callback P1',
		},

    execute = function(domoticz, item)
        local DomoUrl = 'http://192.168.x.xx:yyyy' -- URL of domoticz not shown here.
        local P1idx = 28105 -- IDX of P1 meter device
        local ContractYear = 2026
        
        local P1_data
        local p1resultly = {}

        local function getDomData(url, callback)
            domoticz.openURL({
                url = url,
                -- method = 'GET',
                callback = callback,
                timeout = 10,
            })
        end

        if (item.isTimer) then
                local t = DomoUrl .. '/json.htm?type=command&param=graph&sensor=counter&range=year&idx=' .. tostring(P1idx) .. '&year=' .. ContractYear
                local c = 'http_response_P1'
                getDomData(t,c)
        elseif (item.isHTTPResponse) then
            domoticz.log('Script triggered by HTTPResponse', domoticz.LOG_INFO) -- doesn't reach here consistently
            if (item.trigger == 'http_response_P1' and item.ok and item.isJSON) then
                P1_data = item.json["P1_Tariff"] -- just as example, in full script, more data is fetched from the JSON response
                domoticz.log('P1 Tariff : ' .. P1_data, domoticz.LOG_INFO)
                ...
            end
        else
		...
        end
    end

Re: HTTPResponse callback issues

Posted: Saturday 24 January 2026 8:00
by gizmocuz
Sorry about this.

I moved two variables (I thought) in the right scope

void CEventSystem::EventQueueThread()

Seems the vector is used differently perhaps.

Version 17056 should solve the issue, could you check this?

Re: HTTPResponse callback issues

Posted: Saturday 24 January 2026 9:41
by Gingerpale
No worries,
better that I ask before I spend few days (more) on trying to debug the issue.
As soon as 17056 is pushed I will test it again.
Many thanks!

Re: HTTPResponse callback issues  [Solved]

Posted: Saturday 24 January 2026 15:28
by Gingerpale
I can confirm that with Version 17056 everything works as expected again.
Many thanks for all the hard work!