0
HTTP command with added dynamic value (and no script)
Nikolay Rusanov 8 jaar geleden
in Applications / Studio (Server editor)
•
bijgewerkt 8 jaar geleden •
8
I need to send http://dweet.io/dweet/for/_channel_?data=XY
and XY should be changed according to external tag from schemes:

And I donot want to use scripts, as it is a very simple task
Thank you
Customer support service by UserEcho
My HTTP channel is setup like this already, I just need $V value from external tag added
any support person see this?
Nikolay, what's the difficulty of adding a small JS code? You use schemes - but this is also JS.
IR.AddListener(IR.EVENT_CHANNEL_SET, IR.GetDevice("AV & Custom Systems (HTTP)"), function(name, value) { switch(name) { case "dweet": IR.Log("send value: "+value); IR.GetDevice("AV & Custom Systems (HTTP)") .Send(['GET,/dweet/for/_channel_?data='+value]); break; case "other": IR.Log("Other"); break; } });Set in Custom HTTP (TCP) Script Mode = Script Only, leave command URI empty
for server: http://support.iridiummobile.net/topics/11960-http-commands/
scripts are hard to use if you not a programmer (and iRidium is not for programmers, it is for installers).
Where is +value taken from? Can we use it as data modification, like this? (so tag which has this function selected sends data to http)? If yes, it would be a nice solution
for server best to use Virtual Channel (as in http://support.iridiummobile.net/topics/11960-http-commands/#comment-72483)
function modify_send (in_Type, in_Name, in_Value) { IR.Log("in_Type: " + in_Type + "in_Name: " + in_Name + "in_Value: " + in_Value); IR.GetDevice("AV & Custom Systems (HTTP)") .Send(['GET,/dweet/for/_channel_?data='+in_Value]); }server:
client:
nice, thank you last thing: what if we can replace _channel_ with the name of the tag?
I tried
.Send(['GET,/dweet/for/'+in_Name'?value='+in_Value]);
But did not work
IR.GetDevice("AV & Custom Systems (HTTP)")+.Send(['GET,/dweet/for/'+in_Name+'?data='+in_Value]);
Thank you very much!