To use logic variabels you use code like this
let Logic = await Homey.logic.getVariables()
console.log(Logic);
updateVariable
await Homey.logic.updateVariable({id: yourid, variable: yourVar})
You have access to the API https://developer.athom.com/docs/api
so Homey.whatyouwannareach gives alot of options. send me a question if you need more help.