[feature request] Option to make a data dumb of all your logic values

Maybe someone is looking for an idea for creating a app or tool.

Don’t know if it is possible but it would be nice to have an option to create a (json) data dump of all your logic_values.

I often create a flow card to write a log file (using papertrails or simple log) and eachtime I have to select the data i wish to log into the flow card.
It would be great if there was an option to trigger to create a snapshot/data dumb of all logic values currently in Homey and output them into a json string which then can be save (or send/used). When doing this jou just have all logic values and when looking for an error/bug in your flows you can lookup the data of the time the dumb was created.

I think you mean data dump ?
Here’s a start:

const logicVars = await Homey.logic.getVariables()
for (var iLogicVar in logicVars){
  if (logicVars[iLogicVar].name != "")

    console.log(`"${logicVars[iLogicVar].type}-variable","${logicVars[iLogicVar].name}","value","${logicVars[iLogicVar].value}",`);

}

return(true);



Thx but i cannot get it to work as i want it.
I cannot get the output into a text card which i can then save using simple log.

The code @Arie_J_Godschalk wrote works fine
return JSON.stringify(await Homey.logic.getVariables());
but it is not filtered as in your demo.

So youre code does what i want, but now only i need it as a string as in Arie example

Use this in the HS Run Code - Return TextTag

let str='';
const logicVars = await Homey.logic.getVariables()
for (var iLogicVar in logicVars){
  if (logicVars[iLogicVar].name != "")

    str+= `"${logicVars[iLogicVar].type}-variable","${logicVars[iLogicVar].name}","value","${logicVars[iLogicVar].value}",`;

}

return str;

image

[TEF:FLOWS:H4sIAAAAAAACA32S32+CMBDH/5XuskTNqEGKFDG8bFmyhz3NZC9iYsXimmAhpTgN4X9fW3/sxe2B0nzvc3ffu7QDDUkHebUfM/1lTvPxU5MrUbuAhATerLQ4S33vAYNk2YEwETLzGad+gOMJzXEYRTHeTIoIEzolzOcBoSwGzxV5PbJ9XXL0TJQ2EodEq5Z7kNsuJJjN4gmJMKXhFIeEhnhDgxlmvAiDggY+mXDLHSGJfA9OkMTmV5myzm7C6jq5P4LnfKpWvlRb/sF1q2Sz0ErInQmZCYHlWlQS3FR2D1vTCEquUaNVOhjMM5XJvJKNRmW1E/knUw1KEftmQiO3mLHTxzuuTUywTcmb4chmFZVCwwNTSLxfMpGQv1VGnYUQEgUa3sTljV2NJdtz9JCiDDJwBc88ss6eUrTO4LG7m6hPNe/x4eImA+9P0rboHXBgZfsv6gDLrudXL/31otxera+5eSB9v+p/AHY38yVXAgAA]
2 Likes

Thx, this works!

1 Like