[SOLVED] Error using http

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

Moderator: leecollings

Post Reply
BertB
Posts: 72
Joined: Tuesday 24 June 2014 19:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: struggling and stumbling. Amsterdam area
Contact:

[SOLVED] Error using http

Post 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?
Last edited by BertB on Monday 13 August 2018 22:49, edited 2 times in total.
Set 1= RPI 3B, latest Beta, RFLink USB, RFLINK WIFI, Zwave
Set 2= RPI 2B, Latest Beta, OTGW (USB), SBFSpot (Bluetooth)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Error using http

Post by waaren »

@BertB, what is the relation with dzVents ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
BertB
Posts: 72
Joined: Tuesday 24 June 2014 19:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: struggling and stumbling. Amsterdam area
Contact:

Re: Error using http

Post 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
})
Set 1= RPI 3B, latest Beta, RFLink USB, RFLINK WIFI, Zwave
Set 2= RPI 2B, Latest Beta, OTGW (USB), SBFSpot (Bluetooth)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Error using http

Post 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

Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
BertB
Posts: 72
Joined: Tuesday 24 June 2014 19:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: struggling and stumbling. Amsterdam area
Contact:

Re: Error using http

Post 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: 
Set 1= RPI 3B, latest Beta, RFLink USB, RFLINK WIFI, Zwave
Set 2= RPI 2B, Latest Beta, OTGW (USB), SBFSpot (Bluetooth)
User avatar
felix63
Posts: 244
Joined: Monday 07 December 2015 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Gouda
Contact:

Re: Error using http

Post 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?
BertB
Posts: 72
Joined: Tuesday 24 June 2014 19:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: struggling and stumbling. Amsterdam area
Contact:

Re: Error using http

Post 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.
Set 1= RPI 3B, latest Beta, RFLink USB, RFLINK WIFI, Zwave
Set 2= RPI 2B, Latest Beta, OTGW (USB), SBFSpot (Bluetooth)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: ON HOLD Error using http

Post 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"                
           })

Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
BertB
Posts: 72
Joined: Tuesday 24 June 2014 19:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: struggling and stumbling. Amsterdam area
Contact:

Re: ON HOLD Error using http

Post 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.
Set 1= RPI 3B, latest Beta, RFLink USB, RFLINK WIFI, Zwave
Set 2= RPI 2B, Latest Beta, OTGW (USB), SBFSpot (Bluetooth)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest