Currently no. I think there's already feature request for it. You should express interest there.
Okay. I have since found a quick and dirty workaround:
I define the custom commands as SMS.
In addition to the traccar server, I run an httpd instance with a CGI script, which is referenced by the SMS gateway URL in traccar.xml. The script replaces the variable names with their actual values and distinguishes between a standard SMS and a command: if it is an SMS, it is forwarded to the SMS gateway; otherwise, the command is sent back to the traccar server (to http://127.0.0.1/api/commands/send) via a POST request and executed there.
However, I have one more question: How can I receive and display the response SMS sent back by the device?
Is it SMS or a normal message?
It is a SMS:
Example: I send an SMS from the Traccar server, via the SMS gateway, to my PAJ-Finder: "sleep,123456,0". The finder responds with an SMS - either "SET OK" or "Password Error" - which is received by the SMS gateway.
Receiving SMS replies from a gateway is currently not supported in Traccar. You would need to view those replies in the SMS gateway itself.
Is there a way to use variables within
Settings > Saved Commands > Custom command?
The issue is that the 'h02' command to turn on the light includes the device's identifier (YYY...Y)
for example:
*HQ,YYYYYYYYYY,X2,062108,1#and I would prefer not to have to save a separate command for every single device.
Instead, I would like to have one command that works for all of them, like this
*HQ,{uniqueId},X2,062108,1#