Hidden Syncing Issues in Arduino IoT Cloud Affecting Relay Control

I recently ran into a frustrating issue with unexpected relay activations in my Arduino IoT Cloud dashboard. The relays were behaving oddly, interacting with other cloud variables in ways that didn’t make sense—especially when using a physical pushbutton to trigger them.

Problem Overview:
I had 2 independent relays with widget pushbuttons.

  • When activating Relay1, it would also sync with the two flip-flop state variables.
  • This caused unexpected behavior, affecting not just Relay1, but Relay2 as well.
  • Despite checking my code logic, the issue wasn’t in the sketch—it was buried in the Arduino IoT Cloud settings.
    How I Found the Issue:

I carefully compared my two Tank THINGS in the IoT Cloud setup and discovered an incorrect linkage.

  1. Go to the Arduino IoT Cloud page and select your THING.
  2. Look under the "Setup" tab at your cloud variables.
  3. Select "Relay1" and click "Edit Variable."
  4. The field "Sync with Other Things" should have been default—but instead, it was linked to both flip-flop states. (My code to handle push button toggling)
  5. This meant activating Relay1 wasn’t just affecting Relay1—it was syncing with other variables, causing cascading effects.

The Fix:

  • I manually removed the unwanted sync linkages, leaving Relay1 independent.
  • After that, the relays started behaving exactly as expected—the pushbutton worked, and there were no unwanted activations.

Key Takeaways:

:white_check_mark: Hidden sync settings in Arduino IoT Cloud can override your sketch logic.
:white_check_mark: Even if your code is correct, cloud-level links might interfere.
:white_check_mark: Always double-check "Sync with Other Things" for unexpected variable pairings.
:white_check_mark: Fixing this in the cloud setup—not the code—solved my issue instantly.

I’m posting this because I haven’t seen many discussions about this exact issue, and it could be affecting others without them realizing it. If you've run into something similar, now you know where to check.

Add Serial.println() statements to verify which triggers are causing changes.

Yes, that's what AI advised as well but because the ESP was at a remote location, I couldn't use a serial monitor. So much was done trial and error but in the end I found this "Sync with others" querk, by myself which I admit, was a complete fluke! One idea I have, (for the future) is to have a Rpi computer permanently connected to a ESP or Arduino and remote in. Then use serial monitor on the Rpi ?

An alternative could be to use a string type Arduino Cloud IoT Variable to get debug information from the Thing via the network. You can use a "Messenger" widget on your IoT dashboard to display the output.

Of course this is only useful in the case where you are able to achieve communication with the Arduino Cloud IoT system via that Variable.

Have only seen the message widget work the other way around. That is, on TechExplorations course, they send a message from the widget to a small OLED display at the ESP. It would be very useful if it could send a debug string.

.
.
Regards Jim

The "Messenger" widget is bidirectional. It will display the value of the Variable that is set by the Thing sketch program, and you can also set the value of the Variable from the dashboard.