Need Help with Sending Values to Complex Variable Types in Arduino IoT Cloud Using Node.js

Hello,

I have recently been experimenting with Node.js to implement my program ideas for Arduino IoT Cloud. Since I am new to this environment, I am relying on example documentation of JavaScript/Node.js on Arduino's site to do basic tasks like sending values to the cloud to update variables, such as updating an integer or string variable (which is included in the example documentation). However, as my project demands the use of complex variable types like DimmedLight and CloudScheduler, I can't seem to figure out how to send values or update these variables through Node.js since there are no examples available. Below, I have included my original code which attempts to send values, but nothing happens on the cloud. Can anyone guide me?

Code that attempts to send values to dimmedlight variable type:

import { ArduinoIoTCloud } from "arduino-iot-js";
import dotenv from 'dotenv';
dotenv.config();

// Example values for CloudDimmedLight (DimmedLight)
let dimmedLight = {
  bri: 69.5, // Example brightness value as string
  swi: false // Example switch state as string
};

// Connect to Arduino IoT Cloud
(async () => {
  try {
    const client = await ArduinoIoTCloud.connect({
      deviceId: process.env.ARDUINO_CLOUD_DEVICEID,
      secretKey: process.env.ARDUINO_CLOUD_SECRETKEY,
      onDisconnect: (message) => console.error("Disconnected:", message),
    });

    // Send CloudDimmedLight (DimmedLight) to Arduino IoT Cloud
    client.sendProperty("dimmedLight", dimmedLight);

    // Logging for debug purposes
    console.log("Sent dimmedLight:", dimmedLight);

    // Example of handling additional complex variables
    client.onPropertyValue("dimmedLight", (value) => console.log("Received Dimmed Light:", value));

  } catch (error) {
    console.error("Error connecting to Arduino IoT Cloud:", error.message);
  }
})();

For CloudScheduler variable type I can't seem to figure anything out.

Can anyone link to any documentation that may touch on this or guide me here? Thanks!

Update [NOT RESOLVED YET]:

I seem to have figured out how dimmedLight updates. According to my code shared above, the state does change as needed on the dashboard. However, I learned that it only properly shows on the dashboard when turned on (i.e., swi: true in the code) but not when turned off (i.e., swi: false). In the latter case, the last value shows as {bri: [any value]} instead of {bri: [any value], swi: [any value]} format, and the dimmed light switch doesn't update on the dashboard.

As for cloudScheduler, can anyone guide me on what object and attributes need to be declared?