I have a device defined that contains 30 different commands. I would like to replace, for example, a hard coded address present in all 30 commands with a variable. Ex:
POST /cgi-bin/toServerValue.cgi HTTP/1.1\x0D\x0AContent-Length: 14\x0D\x0AContent-Type: text/plain; charset=ISO-8859-1\x0D\x0AHost: 192.168.1.17:3388\x0D\x0AConnection: Keep-Alive\x0D\x0A\x0D\x0A{"remote":"w"}
So, could I replace that address with a variable such as:
POST /cgi-bin/toServerValue.cgi HTTP/1.1\x0D\x0AContent-Length: 14\x0D\x0AContent-Type: text/plain; charset=ISO-8859-1\x0D\x0AHost: [IP-address]:3388\x0D\x0AConnection: Keep-Alive\x0D\x0A\x0D\x0A{"remote":"w"}
??
Using variables as part of pre-defined device commands
Re: Using variables as part of pre-defined device commands
That is exactly how you would do it, with square brackets. If you create a label called "MyLabel" and use [MyLabel] anywhere in a command, the value of the label will be replaced before the command is sent.