The topic you asked this on was over two years old There have been a few changes since… So I have moved youe question into a new topic.
We recommend you start any project by checking out the Documentation, Help Center and Sketch builder… Links all at the upper right of this screen.
You didn’t mention the type of hardware device you are using, but here is a Widget and Hardware pin state sync example with ESP8266. If you have different hardware, just make the relevant changes in the Sketch Builder: