[SOLVED] Remove redundant http path configuration in configs?

I have some http enabled switches, and every time I have to write lines like this:

Switch Relais "Relais" <poweroutlet> {http=">[ON:POST:http://<username>:<password>@<host>/xml/jsonswitch.php?id=42&set=1] >[OFF:POST:http://<username>:<password>@<host>/xml/jsonswitch.php?id=42&set=0]" }

The whole path part (except the IDs) repeats serveral times within the configuration. How can I reduce the repeat only specify the IDs, so I don’t have so many repeated paths (and so many changes when I sometimes change the password)? (Without having to write a Java binding? ^^)

Using http.cfg didn’t work as I didn’t find a way to specify only a part of the path (without the IDs).

Thanks in advance.

It is a bit redundant, unfortunately. Thankfully, modern text editors make this really easy. :wink: If you’re using VS Code to maintain your items and rules, you can make wholesale changes in almost the same time as it takes to make a single change.

1 Like

Yeah, but including the problem to change too much / not enough with a global replace. There’s always a risk included, and configuration isn’t readable so easily. Being able to use a HTTP Cache like this would make life easier:

Just as idea :wink: