Page 1 of 1
[SOLVED] Error using http
Posted: Monday 13 August 2018 9:03
by BertB
I have put this question on HOLD because I think the problem is outside dzVents.
In my project I use a HTTP string to send a command to an ESPEasy device.
The string :
Code: Select all
http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page3.b5.bco=1024
works in the ESPEasy device, but I get an error opening URL notification.
As far as I remember, this used to work fine.
Is there something wrong with my URL?
Re: Error using http
Posted: Monday 13 August 2018 9:37
by waaren
@BertB, what is the relation with dzVents ?
Re: Error using http
Posted: Monday 13 August 2018 14:27
by BertB
waaren wrote: Monday 13 August 2018 9:37
@BertB, what is the relation with dzVents ?
I create this URL in dzVents like:
Code: Select all
domoticz.openURL({
url = http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page3.b5.bco=1024
})
Re: Error using http
Posted: Monday 13 August 2018 17:00
by waaren
BertB wrote:waaren wrote: Monday 13 August 2018 9:37
@BertB, what is the relation with dzVents ?
I create this URL in dzVents like:
Code: Select all
domoticz.openURL({
url = http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page3.b5.bco=1024
})
Does this URL works when entered from a browser?
What is the error message when entered from dzVents?
If you set loglevel to debug for this script what do you see in the domoticz log (what URL is being send by dzVents)
Verstuurd vanaf mijn ONEPLUS A3003 met Tapatalk
Re: Error using http
Posted: Monday 13 August 2018 18:18
by BertB
waaren wrote: Monday 13 August 2018 17:00
BertB wrote:waaren wrote: Monday 13 August 2018 9:37
@BertB, what is the relation with dzVents ?
I create this URL in dzVents like:
Code: Select all
domoticz.openURL({
url = http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page3.b5.bco=1024
})
Does this URL works when entered from a browser?
What is the error message when entered from dzVents?
If you set loglevel to debug for this script what do you see in the domoticz log (what URL is being send by dzVents)
Verstuurd vanaf mijn ONEPLUS A3003 met Tapatalk
Yes, it works also with a normal browser, but I get no error.
This is what I captured:
Code: Select all
2018-08-13 18:15:56.528 Status: dzVents: MySubType = ARC
2018-08-13 18:15:56.528 Status: dzVents: page0.vAcht.val=0
2018-08-13 18:15:56.528 Status: dzVents: Debug: OpenURL: url = http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page0.vAcht.val=0
2018-08-13 18:15:56.528 Status: dzVents: Debug: OpenURL: method = GET
2018-08-13 18:15:56.528 Status: dzVents: Debug: OpenURL: post data = nil
2018-08-13 18:15:56.528 Status: dzVents: Debug: OpenURL: headers = nil
2018-08-13 18:15:56.528 Status: dzVents: Debug: OpenURL: callback = nil
2018-08-13 18:15:56.528 Status: dzVents: URL =http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page0.vAcht.val=0
2018-08-13 18:15:56.528 Status: dzVents: -----------------
2018-08-13 18:15:56.529 Status: dzVents: Debug: Constructed timed-command: Off
2018-08-13 18:15:56.529 Status: dzVents: Info: ------ Finished dzE16ConfigMult
2018-08-13 18:15:56.529 Status: dzVents: Debug: Commands sent to Domoticz:
2018-08-13 18:15:56.529 Status: dzVents: Debug: - OpenURL = {["URL"]="http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page7.t0.txt="270"", ["method"]="GET"}
2018-08-13 18:15:56.529 Status: dzVents: Debug: - OpenURL = {["URL"]="http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page7.t1.txt="2.4000000953674"", ["method"]="GET"}
2018-08-13 18:15:56.529 Status: dzVents: Debug: - OpenURL = {["URL"]="http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page0.vFont.val=0", ["method"]="GET"}
2018-08-13 18:15:56.529 Status: dzVents: Debug: - OpenURL = {["URL"]="http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page0.vLight.val=0", ["method"]="GET"}
2018-08-13 18:15:56.529 Status: dzVents: Debug: - OpenURL = {["URL"]="http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page0.vErf.val=0", ["method"]="GET"}
2018-08-13 18:15:56.529 Status: dzVents: Debug: - OpenURL = {["URL"]="http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page0.vAcht.val=0", ["method"]="GET"}
2018-08-13 18:15:56.529 Status: dzVents: Debug: - E16Conf = Off
2018-08-13 18:15:56.529 Status: dzVents: Debug: =====================================================
2018-08-13 18:15:56.612 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-08-13 18:15:56.981 Status: dzVents: Debug: Dumping domoticz data to /home/pi/domoticz/scripts/dzVents/domoticzData.lua
2018-08-13 18:15:56.698 Error: Error opening url: http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page7.t0.txt="270"
2018-08-13 18:15:56.774 Error: Error opening url: http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page7.t1.txt="2.4000000953674"
2018-08-13 18:15:56.839 Error: Error opening url: http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page0.vFont.val=0
2018-08-13 18:15:56.904 Error: Error opening url: http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page0.vLight.val=0
2018-08-13 18:15:56.963 Error: Error opening url: http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page0.vErf.val=0
2018-08-13 18:15:57.059 (E16Config) Light/Switch (E16Conf)
2018-08-13 18:15:57.049 Status: dzVents: Debug: Processing device-adapter for LivingThSP: Thermostat setpoint device adapter
2018-08-13 18:15:57.049 Status: dzVents: Debug: dzVents version: 2.4.7
2018-08-13 18:15:57.049 Status: dzVents: Debug: Event triggers:
Re: Error using http
Posted: Monday 13 August 2018 18:33
by felix63
In my scripts I supply the value to the variable url as a string
Code: Select all
domoticz.openURL({
url = 'http://xxx.xxx.xxx.xxx/control?cmd=NEXTION,page3.b5.bco=1024'
})
Would that help?
Re: Error using http
Posted: Monday 13 August 2018 18:57
by BertB
I tried that too, but it does not help.
I tried another string and that one works fine, so I think the problem is in ESPEasy.
Sorry for bothering you, I will first follow that lead.
Re: ON HOLD Error using http
Posted: Monday 13 August 2018 19:23
by waaren
You could try to put your URL in a veriable.
Some chars mess up your URL when used directly.
example:
Code: Select all
local url = "http://api.waqi.info/feed/geo:".. location .. "/?token=" .. apiKey
dz.openURL({ url = url,
method = "GET"
})
Re: ON HOLD Error using http
Posted: Monday 13 August 2018 22:50
by BertB
waaren wrote: Monday 13 August 2018 19:23
You could try to put your URL in a veriable.
Some chars mess up your URL when used directly.
example:
Code: Select all
local url = "http://api.waqi.info/feed/geo:".. location .. "/?token=" .. apiKey
dz.openURL({ url = url,
method = "GET"
})
Thank you, but my problem was caused by a lack of response by ESPEasy.
That is solved now.