i found my own fault, i set setdate with month 9, of course it had to be 8
with your correction, i have tested it, and now it works!!!
thank you very much!!
my whole script is now:
let BLVarName=“DatumVanMorgen”; //the variable for BetterLogic
let CurrentDate = new Date();
//CurrentDate = new Date(2020,8,30)
CurrentDate.setDate(CurrentDate.getDate() + 1);
const TomorrowDate = ‘d-m-Y’
.replace(‘d’, (‘0’ + CurrentDate.getDate()).toString().slice(-2))
.replace(‘m’, (‘0’ + (CurrentDate.getMonth() + 1)).toString().slice(-2))
.replace(‘Y’, CurrentDate.getFullYear());
console.log(TomorrowDate);
let BLApp = await Homey.apps.getApp({id:“net.i-dev.betterlogic” });
let result = await BLApp.apiPut("/" + BLVarName + “/” + TomorrowDate);
return true;