Authorization Denied when using sendDeviceData

Authorization Denied when using sendDeviceData

Help! I think I'm doing everything correct, but I get an error. Below is the function, the error and my Access pic.

Function:
variable_to_write = {
variable: "eventrainin",
value: eventrainin,
unit: "inches",
};

result = await Resources.devices.sendDeviceData( my_device.id , variable_to_write );

I get this error:
[2024-10-17 14:40:05] node:internal/process/promises:289 triggerUncaughtException(err, true /* fromPromise */); ^ [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Authorization denied".] { code: 'ERR_UNHANDLED_REJECTION' } Node.js v20.14.0

I have created an Access permission: