How to read and Set the logic variables with HomeyScript?

you really don’t need lodash to convert an object into an array so you can find a variable by a field property. you can just write:

const myVar = Object.values(await Homey.logic.getVariables()).find(({name}) => name === "Variable name");