Error: Error opening url: http:

Moderator: leecollings

Post Reply
jojotjo
Posts: 6
Joined: Thursday 03 October 2019 15:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Nederland
Contact:

Error: Error opening url: http:

Post by jojotjo »

Hello,

I'll hope someone can help me. (sorry for my English)

There is a lot of information about the problem I have, but I can't find a solution.

The problem is that I want a switch from my fibaro HC2 system controlled by domoticz.

I'll tried a lot of different statements:
I have made a virtual switch and put there in the on-action the following line.
http://192.168.1.xx/api/callAction?devi ... ame=turnOn
when I used this line in a browser it works perfect.

The following error occurs:
2020-04-07 09:24:35.483 Status: User: Admin initiated a switch command (727/Lamp Test/On)
2020-04-07 09:24:35.694 Error: Error opening url: http://192.168.1.xx/api/callAction?devi ... ame=turnOn
I have tried it with several other commands such as:
http://User:[email protected]/api/c ... ame=turnOn
Also external with port forwarding to my fibaro HC2-system, in the browser they all worked.

I made also a script test.lua to test it.
commandArray = {}
os.execute ('curl -s "http://192.168.1.xx/api/callAction?devi ... ame=turnOn"')
return commandArray
With the following output.
2020-04-07 09:24:33.634 Status: Executing script: /home/pi/domoticz/scripts/test1.lua
2020-04-07 09:24:33.645 Error: Error executing script command (/home/pi/domoticz/scripts/test1.lua). returned: 32256

Please help!
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Error: Error opening url: http:

Post by freijn »

What is the network your Domoticz is in? ( what ip address ? )

looks to me your browser can reach the fibaro and your domoticz can't
jojotjo
Posts: 6
Joined: Thursday 03 October 2019 15:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Nederland
Contact:

Re: Error: Error opening url: http:

Post by jojotjo »

The ip adress starts also with 192.168.1.xx. It is in the same network. I have also a working connection to fibaro HC2 through the fibaro link. From HC2 I can reach domoticz also with a http-request.
jojotjo
Posts: 6
Joined: Thursday 03 October 2019 15:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Nederland
Contact:

Re: Error: Error opening url: http:

Post by jojotjo »

freijn wrote: Tuesday 07 April 2020 10:27 What is the network your Domoticz is in? ( what ip address ? )

looks to me your browser can reach the fibaro and your domoticz can't
The ip adress starts also with 192.168.1.xx. It is in the same network. I have also a working connection to fibaro HC2 through the fibaro link. From HC2 I can reach domoticz also with a http-request.
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Error: Error opening url: http:

Post by freijn »

instead of
os.execute ('curl -s "http://192.168.1.xx/api/callAction?devi ... ame=turnOn"')

can you try
os.execute ('curl -s \"http://192.168.1.xx/api/callAction?devi ... ame=turnOn\"')

I think its confused by the ' then " and then the "' again
jojotjo
Posts: 6
Joined: Thursday 03 October 2019 15:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: Nederland
Contact:

Re: Error: Error opening url: http:

Post by jojotjo »

Thanks for your reply. I changed it, but I get the same error.

2020-04-08 11:43:31.904 Status: Executing script: /home/pi/domoticz/scripts/test1.lua
2020-04-08 11:43:31.915 Error: Error executing script command (/home/pi/domoticz/scripts/test1.lua). returned: 32256
tahaahmed166
Posts: 1
Joined: Monday 20 April 2020 13:26
Target OS: Windows
Domoticz version:
Contact:

Re: Error: Error opening url: http:

Post by tahaahmed166 »

Facing the same error here, i also changed them but same issue persist, i guess it have something to do with website design.
Last edited by tahaahmed166 on Wednesday 03 June 2020 7:50, edited 1 time in total.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Error: Error opening url: http:

Post by waaren »

tahaahmed166 wrote: Monday 20 April 2020 13:38 Facing the same error here, i also changed them but same issue persist.
If you use this dzVents (100 % Lua) script, you might be able to identify what is causing your issue.

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

local testURL = 'http://192.168.1.xxx/api/callAction?deviceID=273&name=turnOn' -- change to the real http
local scriptVar = 'http test'

return 
{
    on = 
    {
        timer = 
        {
            'every minute', 
        },
        
        httpResponses = 
        {
            scriptVar,
        },
    },

    logging = 
    {
        level = domoticz.LOG_DEBUG,
        marker = scriptVar,
    },
    
    execute = function(dz, item)
        
        local lodash = dz.utils._
        
        local function sendURL()
            dz.openURL(
            {
                url = testURL,
                callback = scriptVar, 
            })
        end

        if item.isHTTPResponse then
            dz.log('return from openURL : ' .. lodash.str(item.data),dz.LOG_DEBUG)
        else
            sendURL()
        end
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest