Paulo Lopes
Published

Quick Demo (purpose)

Sharing and explanation of a purpose for quick demoing of Thingsee Creator and Thingsee device capabilities.

BeginnerProtip6 minutes837
Quick Demo (purpose)

Things used in this project

Hardware components

Thingsee One
Thingsee One
×1

Story

Read more

Schematics

Quick Demo (purpose)

Scheme of the actions that will be triggered by each task of the purpose.
Rectangles with borders are tasks. Lozenges are decisions or triggers. And rectangles without borders are annotations i.e. "Do noting" is simply an annotation meaning that no action will be activated from that outcome of the decision.

Code

PROFILE

JSON
{
  "pId": "1",
  "apiVersion": "00.18",
  "initPuId": 1,
  "purposes": [
    {
      "puId": 1,
      "name": "Quick Demo",
      "initStId": 0,
      "states": [
        {
          "stId": 0,
          "name": "Wait",
          "events": [
            {
              "evId": 0,
              "name": "Timer 30s",
              "actions": {
                "engine": {
                  "gotoStId": 1
                },
                "cloud": {
                  "sendEvent": true
                }
              },
              "causes": [
                {
                  "sId": "0x00080100",
                  "threshold": {
                    "count": 1,
                    "relative": true
                  },
                  "measurement": {
                    "log": true
                  },
                  "thresholds": {
                    "isOneOf": [
                      30
                    ]
                  }
                }
              ]
            },
            {
              "evId": 1,
              "name": "Gen Imp",
              "actions": {
                "cloud": {
                  "sendEvent": true,
                  "sendPush": false
                }
              },
              "causes": [
                {
                  "sId": "0x00050400",
                  "threshold": {
                    "count": 1
                  },
                  "measurement": {
                    "log": false
                  },
                  "thresholds": {
                    "isGt": 0.1
                  }
                }
              ]
            },
            {
              "evId": 2,
              "name": "Gen Bat",
              "actions": {
                "cloud": {
                  "sendEvent": true
                }
              },
              "causes": [
                {
                  "sId": "0x00030200",
                  "threshold": {
                    "count": 1
                  },
                  "measurement": {
                    "log": false,
                    "interval": 5000
                  },
                  "thresholds": {
                    "isAny": true
                  }
                }
              ]
            },
            {
              "evId": 3,
              "name": "Charger plugged?",
              "actions": {
                "engine": {
                  "gotoStId": 3
                },
                "cloud": {
                  "sendEvent": true,
                  "sendPush": true
                }
              },
              "causes": [
                {
                  "sId": "0x00030400",
                  "threshold": {
                    "count": 1
                  },
                  "measurement": {
                    "log": false,
                    "interval": 2000
                  },
                  "thresholds": {
                    "isOneOf": [
                      1
                    ]
                  }
                }
              ]
            }
          ]
        },
        {
          "stId": 1,
          "name": "Knock Me",
          "events": [
            {
              "evId": 0,
              "name": "Timer 45s",
              "actions": {
                "engine": {
                  "gotoStId": 0
                },
                "cloud": {
                  "sendEvent": true
                }
              },
              "causes": [
                {
                  "sId": "0x00080100",
                  "threshold": {
                    "count": 1,
                    "relative": true
                  },
                  "measurement": {
                    "log": true
                  },
                  "thresholds": {
                    "isOneOf": [
                      45
                    ]
                  }
                }
              ]
            },
            {
              "evId": 1,
              "name": "Impact 1g",
              "actions": {
                "engine": {
                  "gotoStId": 2
                },
                "cloud": {
                  "sendEvent": true
                }
              },
              "causes": [
                {
                  "sId": "0x00050400",
                  "threshold": {
                    "count": 1
                  },
                  "measurement": {
                    "log": false
                  },
                  "thresholds": {
                    "isGt": 1
                  }
                }
              ]
            },
            {
              "evId": 3,
              "name": "Gen Lux",
              "actions": {
                "cloud": {
                  "sendEvent": true
                }
              },
              "causes": [
                {
                  "sId": "0x00060300",
                  "threshold": {
                    "count": 1
                  },
                  "measurement": {
                    "log": false,
                    "interval": 5000
                  },
                  "thresholds": {
                    "isAny": true
                  }
                }
              ]
            },
            {
              "evId": 4,
              "name": "Charger plugged?",
              "actions": {
                "engine": {
                  "gotoStId": 3
                },
                "cloud": {
                  "sendEvent": true,
                  "sendPush": true
                }
              },
              "causes": [
                {
                  "sId": "0x00030400",
                  "threshold": {
                    "count": 1
                  },
                  "measurement": {
                    "log": false,
                    "interval": 2000
                  },
                  "thresholds": {
                    "isOneOf": [
                      1
                    ]
                  }
                }
              ]
            }
          ]
        },
        {
          "stId": 2,
          "name": "Hide me",
          "events": [
            {
              "evId": 0,
              "name": "Lux 2",
              "actions": {
                "engine": {
                  "gotoStId": 0
                },
                "cloud": {
                  "sendEvent": true
                }
              },
              "causes": [
                {
                  "sId": "0x00060300",
                  "threshold": {
                    "count": 1
                  },
                  "measurement": {
                    "log": false,
                    "interval": 2000
                  },
                  "thresholds": {
                    "isLt": 2
                  }
                }
              ]
            },
            {
              "evId": 1,
              "name": "Gen Env",
              "actions": {
                "cloud": {
                  "sendEvent": true
                }
              },
              "causes": [
                {
                  "sId": "0x00060200",
                  "threshold": {
                    "count": 1
                  },
                  "measurement": {
                    "log": false,
                    "interval": 5000
                  },
                  "thresholds": {
                    "isAny": true
                  }
                },
                {
                  "sId": "0x00060400",
                  "threshold": {
                    "count": 1
                  },
                  "measurement": {
                    "log": false,
                    "interval": 5000
                  },
                  "thresholds": {
                    "isAny": true
                  }
                }
              ]
            },
            {
              "evId": 2,
              "name": "Charger plugged?",
              "actions": {
                "engine": {
                  "gotoStId": 3
                },
                "cloud": {
                  "sendEvent": true,
                  "sendPush": true
                }
              },
              "causes": [
                {
                  "sId": "0x00030400",
                  "threshold": {
                    "count": 1
                  },
                  "measurement": {
                    "log": false,
                    "interval": 2000
                  },
                  "thresholds": {
                    "isOneOf": [
                      1
                    ]
                  }
                }
              ]
            }
          ]
        },
        {
          "stId": 3,
          "name": "Charging",
          "events": [
            {
              "evId": 0,
              "name": "Charger Unplugged?",
              "actions": {
                "engine": {
                  "gotoStId": 0
                },
                "cloud": {
                  "sendEvent": true
                }
              },
              "causes": [
                {
                  "sId": "0x00030400",
                  "threshold": {
                    "count": 1
                  },
                  "measurement": {
                    "log": false,
                    "interval": 2000
                  },
                  "thresholds": {
                    "isOneOf": [
                      0
                    ]
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Credits

Paulo Lopes

Paulo Lopes

2 projects • 1 follower
Startup evangelist working in an IoT company: Thingsee.

Comments