error opening url but url is good
Moderators: leecollings, remb0
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
error opening url but url is good
hello,
really simple question.
i am opening an url in dzvents with following command.
the command executes fine but there is an error in the log
domoticz.openURL('http://192.168.1.165/light/douchelamp/t ... ffect=none')
works, light changes color
error in the log
2025-11-05 18:53:03.420 Error: Error opening url: http://192.168.1.165/light/douchelamp/t ... ffect=none
so why is this error showing while the html executes fine both from dzvents as well as google chrome
really simple question.
i am opening an url in dzvents with following command.
the command executes fine but there is an error in the log
domoticz.openURL('http://192.168.1.165/light/douchelamp/t ... ffect=none')
works, light changes color
error in the log
2025-11-05 18:53:03.420 Error: Error opening url: http://192.168.1.165/light/douchelamp/t ... ffect=none
so why is this error showing while the html executes fine both from dzvents as well as google chrome
-
jannl
- Posts: 823
- Joined: Thursday 02 October 2014 6:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2025.5.x
- Location: Geleen
- Contact:
Re: error opening url but url is good
What kind of switch are you operating? Nothing in Domoticz I presume?
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: error opening url but url is good
no this is an esphome module(lightbulb)
when inspecting it in chrome it is complaining about a resource not loaded favicon.ico.
could it be that this file is not in the root of the lightbulb os of esphome
when inspecting it in chrome it is complaining about a resource not loaded favicon.ico.
could it be that this file is not in the root of the lightbulb os of esphome
- waltervl
- Posts: 6677
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2025.1
- Location: NL
- Contact:
Re: error opening url but url is good
So it seems the url does not give a proper response back. Normally this should be 200.
What do you see as response if you run to following command in a terminal window
What do you see as response if you run to following command in a terminal window
Code: Select all
curl http://192.168.1.165/light/douchelamp/turn_on?brightness=255&b=255&g=255&effect=noneDomoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: error opening url but url is good
that does not seem to work
it is either firing up multiple sessions or i do not see it at all. format is incorrect
i am using a terminal inside synology(linux)
it is either firing up multiple sessions or i do not see it at all. format is incorrect
i am using a terminal inside synology(linux)
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: error opening url but url is good
HTTP/1.1 404 Not Found
- waltervl
- Posts: 6677
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2025.1
- Location: NL
- Contact:
Re: error opening url but url is good
Perhaps put quotes around the url.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: error opening url but url is good
curl -Is http://192.168.1.165/light/douchelamp/t ... ffect=none
this results in HTTP/1.1 404 Not Found
this results in HTTP/1.1 404 Not Found
- waltervl
- Posts: 6677
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2025.1
- Location: NL
- Contact:
Re: error opening url but url is good
Could be because you need quotes around the url as you have special characters in the url. Then it cannot find it.
But if you get that response but the light is switched then something is very wrong on the other side...
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: error opening url but url is good
finally
curl -v -d -urlencode http://192.168.1.165/light/douchelamp/t ... ffect=none
root@DISKSTATION:~# > POST /light/douchelamp/turn_on?brightness=255 HTTP/1.1
> Host: 192.168.1.165
> User-Agent: curl/7.86.0
> Accept: */*
> Content-Length: 10
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< connection: close
< accept-ranges: none
< content-length: 0
curl -v -d -urlencode http://192.168.1.165/light/douchelamp/t ... ffect=none
root@DISKSTATION:~# > POST /light/douchelamp/turn_on?brightness=255 HTTP/1.1
> Host: 192.168.1.165
> User-Agent: curl/7.86.0
> Accept: */*
> Content-Length: 10
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< connection: close
< accept-ranges: none
< content-length: 0
- waltervl
- Posts: 6677
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2025.1
- Location: NL
- Contact:
Re: error opening url but url is good
So the response is OK, then dzvents would not complain on it too. Perhaps some urlencoding needed to get it running in dzvents?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: error opening url but url is good
yes this is really strange.
even with a simple string(without ?) it generates an error
Error: Error opening url: http://192.168.1.165/light/douchelamp/turn_on
the problem is this light is an RGBWWZ light.
i can not control it with the gui.
with domoticz commands like .setcolor i can change the light but i can not access special effects inside the light.
with the html code i can access the special effect but the call generate an error
maybe i can test it with os.execute and then curl but have to see what the format is
even with a simple string(without ?) it generates an error
Error: Error opening url: http://192.168.1.165/light/douchelamp/turn_on
the problem is this light is an RGBWWZ light.
i can not control it with the gui.
with domoticz commands like .setcolor i can change the light but i can not access special effects inside the light.
with the html code i can access the special effect but the call generate an error
maybe i can test it with os.execute and then curl but have to see what the format is
- waltervl
- Posts: 6677
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2025.1
- Location: NL
- Contact:
Re: error opening url but url is good
You probably have to use the urlencode function as described in the wiki:
urlEncode(s, [strSub]): Function. Simple url encoder for string so you can use them in openURL(). strSub is optional and defaults to + but you can also pass %20 if you like/need.
urlEncode(s, [strSub]): Function. Simple url encoder for string so you can use them in openURL(). strSub is optional and defaults to + but you can also pass %20 if you like/need.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: error opening url but url is good
tried it, does not work.
the problem is not that the command is not working, it is working fine but generates an error in the log
got it working with os.execute, also with -urlencode
the problem is not that the command is not working, it is working fine but generates an error in the log
got it working with os.execute, also with -urlencode
Code: Select all
os.execute ('curl --data -urlencode "http://192.168.1.165/light/douchelamp/turn_on?brightness=255&b=255&g=255&effect=Fast%20Pulse"&')-
FlyingDomotic
- Posts: 463
- Joined: Saturday 27 February 2016 0:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Contact:
Re: error opening url but url is good
What's response returned by this request. Is this a 200 code, or something else ?
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: error opening url but url is good
i tested the response and it is a normal 200 like in the post i mentioned before.
i think this is a bug in domoticz.
solved it by using os.execute
i think this is a bug in domoticz.
solved it by using os.execute
- waltervl
- Posts: 6677
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2025.1
- Location: NL
- Contact:
Re: error opening url but url is good
I think it is a encode issue.
If it is a bug, I dont think so. Did you try to escape the special characters with a /
If it is a bug, I dont think so. Did you try to escape the special characters with a /
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: error opening url but url is good
i tried it with \
even with a really simple command linked to the on or of action on a switch i get this error in the log
ESPHOME device
http://192.168.1.160/light/testlamp/turn_on
http://192.168.1.160/light/testlamp/turn_off
this switches the light on and off like it should but generates an error in the log
2025-11-08 08:13:36.817 Error: Error opening url: http://192.168.1.160/light/testlamp/turn_off
ESPEASY device
i use thise commands on other devices also without any errors
http://192.168.1.150/control?cmd=GPIO,5,1
please note this
dzVents: domoticz.urlEncode deprecated. Please use domoticz.utils.urlEncode.
tried it with same result
i think it is device related, really strange because it returns a 200 ok statement
maybe the responsetime from the esphome device is different and domoticz thinks it can not open the url while it actually does open
even with a really simple command linked to the on or of action on a switch i get this error in the log
ESPHOME device
http://192.168.1.160/light/testlamp/turn_on
http://192.168.1.160/light/testlamp/turn_off
this switches the light on and off like it should but generates an error in the log
2025-11-08 08:13:36.817 Error: Error opening url: http://192.168.1.160/light/testlamp/turn_off
ESPEASY device
i use thise commands on other devices also without any errors
http://192.168.1.150/control?cmd=GPIO,5,1
please note this
dzVents: domoticz.urlEncode deprecated. Please use domoticz.utils.urlEncode.
tried it with same result
i think it is device related, really strange because it returns a 200 ok statement
maybe the responsetime from the esphome device is different and domoticz thinks it can not open the url while it actually does open
- habahabahaba
- Posts: 266
- Joined: Saturday 18 March 2023 14:44
- Target OS: Windows
- Domoticz version: 2024.4
- Contact:
Re: error opening url but url is good
May be double quotes needed?
-
Gravityz
- Posts: 652
- Joined: Wednesday 16 December 2015 19:13
- Target OS: NAS (Synology & others)
- Domoticz version: 2025.1
- Location: Netherlands
- Contact:
Re: error opening url but url is good
tried it. both ' and " work but generates error
since these commands work fine on espeasy it must be something webserver related in esphome(but only domoticz complains, nothing else
i know domoticz and espeasy is working way better together i am starting to use esphome for projects which support other platforms BK72xx chips, modbus etc)
esphome has a step learningcurve but once you get the hang of it it gets easier.
also esphome has better mqtt support and works with domoticz mqtt AD.
a light which i could not get to work with openbk(which supports HA and should support MQTT AD) worked instantly once i flashed esphome
since these commands work fine on espeasy it must be something webserver related in esphome(but only domoticz complains, nothing else
i know domoticz and espeasy is working way better together i am starting to use esphome for projects which support other platforms BK72xx chips, modbus etc)
esphome has a step learningcurve but once you get the hang of it it gets easier.
also esphome has better mqtt support and works with domoticz mqtt AD.
a light which i could not get to work with openbk(which supports HA and should support MQTT AD) worked instantly once i flashed esphome
Who is online
Users browsing this forum: Bing [Bot] and 1 guest