Three Spark Cores - Send general message

Yes. You will just have to hardcode the device IDs into your firmware for all three devices. When the button is pushed on one device, you will have to make the Cloud Code API call too all three deivces to an exposed function that will change the relay state.

So in a nutshell:

  1. Expose function called SetRelay that takes a 1 or 0. This will either set the your digital output to High or Low - turning the light on or off.
  2. Hook up a button to an interrupt on a port. When the button is pushed, it will toggle the state of a local variable that tracks if the lights are on or off. After toggling the state, it will push the new state with three distinct Cloud Code calls for each device to set state.

The tricky part on #2 is making the REST calls from the firmware to your local server. There are some libraries to help: http://community.spark.io/t/spark-core-http-client-library/3251