Variable in URL

Moderator: leecollings

Post Reply
stemeh
Posts: 3
Joined: Thursday 27 December 2018 7:53
Target OS: Linux
Domoticz version:
Contact:

Variable in URL

Post by stemeh »

Hello,

I want to send a Line to ESPEASY and i want to send this for Example http://192.168.2.161/control?cmd=TaskValueSet,10,1,5
this is ok. but when I change the 5 to a Variable (SollTemp1) http://192.168.2.161/control?cmd=TaskVa ... &SollTemp1
then Domoticz send &SollTemp1 and not the value of SollTemp1.
INFO_Blocky.png
INFO_Blocky.png (21.67 KiB) Viewed 754 times
Pleasy Help me I have no more Idea
SweetPants

Re: Variable in URL

Post by SweetPants »

Switch to dzVentz, it has a steap learning curve, but much more flexible then Blockly
stemeh
Posts: 3
Joined: Thursday 27 December 2018 7:53
Target OS: Linux
Domoticz version:
Contact:

Re: Variable in URL

Post by stemeh »

Hy,

Thanks for your Info . Can you me please send a simple Example for this Found at google many thinks but I understand .

Stefan
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Variable in URL

Post by waaren »

stemeh wrote: Friday 28 December 2018 10:14 Hy,

Thanks for your Info . Can you me please send a simple Example for this Found at google many thinks but I understand .

Stefan
Please have a look at this page first and use code below to test.

Code: Select all

-- sendTemp2ESP.lua
 
return {
        on      = { devices  = { "Stube" }},
        
    execute = function(dz, item)
       dz.openURL("http://192.168.2.161/control?cmd=TaskValueSet,10,1," .. item.temperature) 
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
stemeh
Posts: 3
Joined: Thursday 27 December 2018 7:53
Target OS: Linux
Domoticz version:
Contact:

Re: Variable in URL

Post by stemeh »

Hy Waaren ,
Thanks for The Solution Idea . I send my Setpoint now with this code

-- sendTemp2ESP.lua

return {
on = { devices = { "SollTemp1" }},

execute = function(dz, SollTemp1Input)
dz.openURL("http://192.168.2.161/control?cmd=TaskValueSet,10,1," .. SollTemp1Input.setPoint)
end
}

Stefan
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest