dzvents and docker icm xx

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

dzvents and docker icm xx

Post by pvklink »

Problem: when execute an url with dz.openURL it works, but i get an error afterwards
What i did:
-- stripped the script to the essential problem
-- also installed curl within the default docker container (domoticz/domoticz) in bridge mode,
-- no solution, error stays
-- think that it has something to do with the callback ?

RPI 4b4gb, buster latest beta
Domoticz docker domoticz/domoticz
error

Code: Select all

2021-06-15 08:23:05.123 Status: User: Admin (IP: 192.168.1.10) initiated a switch command (1483/testxx/Off)
2021-06-15 08:23:05.268 Status: dzVents: Info: ------ Start internal script: testdenon: Device: "testxx (dummydevices)", Index: 1483
2021-06-15 08:23:05.269 Status: dzVents: Debug: OpenURL: url = http://192.168.20.26/MainZone/index.put.asp?cmd0=PutZone_OnOff/OFF
2021-06-15 08:23:05.269 Status: dzVents: Debug: OpenURL: method = GET
2021-06-15 08:23:05.269 Status: dzVents: Debug: OpenURL: post data = nil
2021-06-15 08:23:05.269 Status: dzVents: Debug: OpenURL: headers = nil
2021-06-15 08:23:05.269 Status: dzVents: Debug: OpenURL: callback = testxx
2021-06-15 08:23:05.270 Status: dzVents: Info: ------ Finished testdenon
2021-06-15 08:23:05.492 Status: dzVents: Info: ------ Start internal script: testdenon: HTTPResponse: "testxx"
2021-06-15 08:23:05.493 Status: dzVents: Debug: Denon successfully send
2021-06-15 08:23:05.494 Status: dzVents: Info: ------ Finished testdenon
2021-06-15 08:23:05.293 Error: Error opening url: http://192.168.20.26/MainZone/index.put.asp?cmd0=PutZone_OnOff/OFF

Code: Select all

return {
	on = {
		devices = {'testxx'},
        httpResponses = {'testxx'}
	},
	logging = 
	{
	    level = domoticz.LOG_DEBUG,
	    marker = testxx,
	},

    execute = function(dz, item,info)

    if item.isDevice then
        if item.state == 'Off' then                                        

            dz.openURL({url='http://192.168.20.26/MainZone/index.put.asp?cmd0=PutZone_OnOff/OFF',method = 'GET',callback = 'testxx'})
            
        else

            dz.openURL({url='http://192.168.20.26/MainZone/index.put.asp?cmd0=PutZone_OnOff/ON',method = 'GET',callback = 'testxx'})

        end
    elseif (item.isHTTPResponse) then
        if (item.ok) then
            dz.log('Denon successfully send', dz.LOG_DEBUG)
        else
            dz.log('No valid response from Denon command: ' .. item.statusCode, dz.LOG_ERROR)
            dz.log(item, dz.LOG_DEBUG)
        end
    end

end
}
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzvents and docker icm xx

Post by waaren »

pvklink wrote: Tuesday 15 June 2021 8:29 Problem: when execute an url with dz.openURL it works, but i get an error afterwards
Below version will show some extra information of the return (item)

Code: Select all

return {
    on = {
        devices = {'testxx'},
        httpResponses = {'testxx'}
    },
    logging = 
    {
        level = domoticz.LOG_DEBUG,
        marker = testxx,
    },

    execute = function(dz, item,info)

    if item.isDevice then
        if item.state == 'Off' then                                        

            dz.openURL({url='http://192.168.20.26/MainZone/index.put.asp?cmd0=PutZone_OnOff/OFF',method = 'GET',callback = 'testxx'})
            
        else

            dz.openURL({url='http://192.168.20.26/MainZone/index.put.asp?cmd0=PutZone_OnOff/ON',method = 'GET',callback = 'testxx'})

        end
    elseif (item.isHTTPResponse) then
        if (item.ok) then
            dz.log('Denon successfully send', dz.LOG_DEBUG)
        else
            dz.log('No valid response from Denon command: ' .. item.statusCode, dz.LOG_ERROR)
        end
        dz.log(item, dz.LOG_DEBUG)
    end

end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents and docker icm xx

Post by pvklink »

Great!, missing info to solve this issue...
Gonna execuite your script, to see whats going wrong
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzvents and docker icm xx

Post by waaren »

pvklink wrote: Tuesday 15 June 2021 12:22 that would be great, missing info to solve this issue...
included the missing code in my previous post now
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents and docker icm xx

Post by pvklink »

I get this info back, is statusCode=200 the thing to look for?

2021-06-15 12:25:50.952 Status: User: Admin (IP: 192.168.1.10) initiated a switch command (1483/testxx/On)
2021-06-15 12:25:51.066 Status: dzVents: Info: ------ Start internal script: testdenon: Device: "testxx (dummydevices)", Index: 1483
2021-06-15 12:25:51.066 Status: dzVents: Debug: OpenURL: url = http://192.168.20.26/MainZone/index.put ... e_OnOff/ON
2021-06-15 12:25:51.066 Status: dzVents: Debug: OpenURL: method = GET
2021-06-15 12:25:51.066 Status: dzVents: Debug: OpenURL: post data = nil
2021-06-15 12:25:51.067 Status: dzVents: Debug: OpenURL: headers = nil
2021-06-15 12:25:51.067 Status: dzVents: Debug: OpenURL: callback = testxx
2021-06-15 12:25:51.067 Status: dzVents: Info: ------ Finished testdenon
2021-06-15 12:25:52.245 Status: dzVents: Info: ------ Start internal script: testdenon: HTTPResponse: "testxx"
2021-06-15 12:25:52.246 Status: dzVents: Debug: Denon successfully send
2021-06-15 12:25:52.246 Status: dzVents: Debug: {["isTimer"]=false, ["protocol"]="HTTP/1.0", ["callback"]="testxx", ["ok"]=true, ["dump"]=function, ["data"]="", ["baseType"]="httpResponse", ["_contentType"]="text/html", ["isShellCommandResponse"]=false, ["isHardware"]=false, ["isCustomEvent"]=false, ["isVariable"]=false, ["headers"]={["Pragma"]="no-cache", ["Server"]="GoAhead-Webs", ["Content-type"]="text/html", ["CONTENT-LANGUAGE"]="en", ["Date"]="Sat Jan 1 00:00:00 2000", ["Cache-Control"]="no-cache"}, ["isHTTPResponse"]=true, ["statusCode"]=200, ["isSystem"]=false, ["isSecurity"]=false, ["trigger"]="testxx", ["isXML"]=false, ["statusText"]="OK", ["isDevice"]=false, ["isJSON"]=false, ["isGroup"]=false, ["isScene"]=false}
2021-06-15 12:25:52.247 Status: dzVents: Info: ------ Finished testdenon
2021-06-15 12:25:52.108 Error: Error opening url: http://192.168.20.26/MainZone/index.put ... e_OnOff/ON
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents and docker icm xx

Post by pvklink »

there is another line after the error
2021-06-15 12:26:48.899 Proxy: Error, reconnecting (Connection timed out)
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzvents and docker icm xx

Post by waaren »

pvklink wrote: Tuesday 15 June 2021 12:28 I get this info back, is statusCode=200 the thing to look for?
statusCode = 200 is something dzVents looks for so this part is OK. Don't see why domoticz generates the error.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents and docker icm xx

Post by pvklink »

i also dont see it, must be something with docker, maybe bridgemodus ?
This is above my very poor skills :-)
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents and docker icm xx

Post by pvklink »

is it an option to execute this url from the os in the domoticz docker ?
time problem ?
(the url is a call to my denon receiver...)

docker domoticz/domoticz

curl -I 'http://192.168.20.26/MainZone/index.put ... _OnOff/OFF'

HTTP/1.0 200 OK
Date: Sat Jan 1 00:00:00 2000
Server: GoAhead-Webs
Pragma: no-cache
Cache-Control: no-cache
CONTENT-LANGUAGE: en
Content-type: text/html
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzvents and docker icm xx

Post by waltervl »

Proxy error I think is related tot MyDomoticz. That server seems to be offline for some time now. I have the same error every couple of minutes.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents and docker icm xx

Post by pvklink »

okay, but i dont use a proxy, perhaps old settings to mydomoticz...I wil check and remove...
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: dzvents and docker icm xx

Post by pvklink »

ok, remove my setting from mydomoticz... still the same "error"..
Perhaps something to do with docker/bridgemodus
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest