1. Add a Switch
In the designer, drop a Switch and configure the command it sends in the Triggers tab. A command arrives at the device as structured JSON, for example:2. Handle the command in firmware
Register a handler and use the JSON helpers to pull out the command, action, and params:findCommand, findAction, and findParams navigate the incoming payload so you
don’t parse it by hand. See the
API reference.3. Test it
Flip the Switch in Preview. The device receives the command and toggles the pin.How it works
This is the down half of the core loop: a control widget →setUserCommandHandler on the device. Combined with Lesson 2, you now
have a full two-way device.
Next: store readings
Persist data to the product database.

