This example Thing is a controller. A controller controls other Things.
Let's build a thermostat controller.
Consider the house example below. In the bedroom, Thing 1 senses the temperature in the bedroom. In the basement is Thing 2 with two relays, one to turn a furnace on/off and one to turn air conditioning on/off. We've already built these two Things. Thing 1 is the Temperature/Pressure Sensor example. Thing 2 is the Relays example. We'll reuse those two examples Things and build a new one, Thing 3.
Thing 3 is our new controller Thing. It is connected inside the house to Thing 1 and 2 over Wifi.
Thing 3' is Thing Prime for Thing 3, so it's really just a copy of Thing 3 but running in the cloud.
Thing 3's controller job is pretty straight forward:
Monitor Thing 1 temperature
If temperature is greater than set-point, then turn on air conditioning and turn off furnace, via Thing 2
If temperature is less than or equal to set-point, then turn off air conditioning and turn on furnace, via Thing 2
User can adjust set-point from Thing 3 UI
User can adjust set-point from Thing 3' UI over the Internet
If the Internet connection goes down, Thing 3 continues to function as controller and the user can view Thing 3 UI over the local Wifi network. When the Internet comes back up, the user can view Thing 3' from anywhere.
Let's look at the UIs of all four Things. We've seen Thing 1 and 2 UIs before with the Temperature/Pressure Sensor and Relays examples. Thing 3 UI is a console for the thermostat showing which relay is on/off, the temperature at Thing 1 and a slider to adjust the set-point to the desired temperature. Thing 3' sees the same UI as Thing 3. Thing 3' UI is available over the Internet, so point your phone browser to its address to view. Things 1, 2, and 3 are only viewable from within the local Wifi network.
Here's a closer look at Thing 3 UI.
Run Thing 1, specifying Thing 3 as mother:
Run Thing 2, specifying Thing 3 as mother:
Run Thing 3, specifying Thing 3' as mother:
Finally, run Thing 3':