error opening url but url is good

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

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:

Re: error opening url but url is good

Post by Gravityz »

i used a script waaren made to inspect html strings.
it looks like nothing is returned while with curl under linux 200 ok is returned

Code: Select all

2025-11-08 09:19:00.319 dzVents: http test: ------ Start internal script: url-test:, trigger: "every minute"
2025-11-08 09:19:00.320 dzVents: Debug: http test: OpenURL: url = http://192.168.1.160/light/testlamp/turn_on?brightness=255&b=255&g=255&effect=none
2025-11-08 09:19:00.320 dzVents: Debug: http test: OpenURL: method = GET
2025-11-08 09:19:00.320 dzVents: Debug: http test: OpenURL: post data = nil
2025-11-08 09:19:00.320 dzVents: Debug: http test: OpenURL: headers = nil
2025-11-08 09:19:00.321 dzVents: Debug: http test: OpenURL: callback = http test
2025-11-08 09:19:00.321 dzVents: http test: ------ Finished url-test
2025-11-08 09:19:00.322 Status: EventSystem: Script event triggered: /opt/domoticz/dzVents/runtime/dzVents.lua
2025-11-08 09:19:00.346 Error: Error opening url: http://192.168.1.160/light/testlamp/turn_on?brightness=255&b=255&g=255&effect=none
2025-11-08 09:19:00.373 dzVents: http test: ------ Start internal script: url-test: HTTPResponse: "http test"
2025-11-08 09:19:00.374 dzVents: Debug: http test: return from openURL :
2025-11-08 09:19:00.375 dzVents: http test: ------ Finished url-test
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

Post by FlyingDomotic »

Gravityz wrote: Friday 07 November 2025 17:12 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

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"&')
It seems that os.execute don't return errors. Just try with :

Code: Select all

os.execute("thisisan illegalcommand")
So every command you'll give to it will "succeed", even if you ask to execute garbage...
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

Post by jannl »

You have to code the error handling.....like

Code: Select all

local status = os.execute("mkdir testfolder")
print(status)  -- 0 at success, otherwise errorcode
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

Post by Gravityz »

thanks. got it working.
i do not need the returncode.
if i execute the command and it works(the light goes on or off) i am fine.

still figuring out if i can avoid this from the esphome side.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest