IoT Cloud On Change functionality

When I create an IoT Cloud sketch, it adds a onChange function for each variable (such as onTemperatureChange).

I have added a Serial.printing to them but the don’t seem to be triggered.

Is there documentation on these? How can they be used?

i doubt anyone will know which sketch you may have downloaded or written yourself nor any libraries it may be using without more information.

Fair enough.
Here is the code:

  Sketch generated by the Arduino IoT Cloud Thing "Untitled" 

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  CloudPercentage moisture;
  CloudElectricPotention battery;
  float temperature;
  CloudIlluminance illumination;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.

#include "thingProperties.h"

void setup() {
  // set up analog pins
  pinMode(A0, INPUT); //temperature
  pinMode(A1, INPUT); //illumination
  pinMode(A2, INPUT); //moisture

  // Initialize serial and wait for port to open:
  // This delay gives the chance to wait for a Serial Monitor without blocking if none is found

  // Defined in thingProperties.h

  // Connect to Arduino IoT Cloud
     The following function allows you to obtain more information
     related to the state of network and IoT Cloud connection and errors
     the higher number the more granular information you’ll get.
     The default is 0 (only errors).
     Maximum is 4

void loop() {
  // Your code here 
  float temperatureRaw = analogRead(A0);
  float temperaturemV = 3300.0 * (temperatureRaw / 1023.0);
  Serial.print("Temperature C = ");
  float illuminationRaw = analogRead(A1);
  illumination = (illuminationRaw/1023.0)*100.0; //measure in %. Bright resistance @ 10 lux = 50-100 kOhm; 0 lux=5 MOhm
  Serial.print("Illumination % = ");
  float moistureRaw = analogRead(A2);
  moisture = (moistureRaw/1023.0)*100.0;
  Serial.print("Moisture = ");
  int batteryValue = analogRead(ADC_BATTERY);
  float voltage = batteryValue * (4.3 / 1023.0);
  // print out the value you read:


void onMoistureChange() {
  // Do something
  Serial.println("Moisture Change");

void onTemperatureChange() {
  // Do something
  Serial.println("Temperature Change");

[b]void onIlluminationChange()[/b] {
  // Do something
  Serial.println("Illumination Change");

The "on...Change" routines were added by the IoT Cloud IDE.

I figured it out. When a variable is Read/Write, it triggers the routine if a new value is being written to the Thing.