HomeyScript: Any sane ways to use args?

On a similar line to @homeypro solution, but without needing to parse the args every time is to add the following as the first line of the script:
const flow_args = JSON.parse(args[0]);

then just use flow_arg.arg1, etc, to get the values.

You can also assign more meaningful names and use tags:

Notice the quotes around the Weather token as that is a string.

9 Likes