Introduction

Things5 platform syncs all recipes available on the device once. So that when a user on things5 needs to get a recipe can do so even if the device is offline.
To do so things5 sends both a Read recipes request and a List recipes request.

If your hardware has very limited hardware resources and cannot send all recipes at once subscribe to list recipes request and ignore read recipes request. Things5 will send a separate Read recipe request for each recipe id provided.
Choose this method also if there are a lot of recipes since the mqtt payload cannot be over 128KB

Otherwise subscribe to Read recipes request and send all device recipes as a response.

When the user creates/edits a recipe things5 sends a write recipe request This request is expected to write the edited/new recipe on the device without touching the other recipes on the device.

NOTE: to support legacy apis things5 also sends a write recipes request when creating/editing a recipe. Please ignore it.

There are 11 topics:

Subscribe

Publish

Recipe structure

nametypedescriptionexample
idstringrecipe id. Can be any unique string. If present update the recipe, otherwise create a new recipe"83412jnjasdlfnha1234"
can_be_editedboolean
can_be_deletedboolean
namestringrecipe name"Pollo con patate"
descriptionstringrecipe description
indexintegerthe recipe index starting from 0. Can be used by device to order the recipes.
phasesobjects arrayan array of objects with a values property that lists each variable name, value and type. Values type can be integer, float, string, boolean. Dosages is optional.
dosages type can be integer or float
[
{
"values": [
{ "name": "tim", "value": "5", "type": "integer" },
{ "name": "wrk", "value": "PREPARATION", "type": "string" },
{ "name": "s1", "value": "0", "type": "integer" },
{ "name": "s2", "value": "0", "type": "integer" },
{ "name": "tmp", "value": "0", "type": "integer" }
],
"dosages": [
{
"name": "2",
"unit": "g",
"quantity": "10000",
"type": "integer",
"metadata": [{ "name": "wait", "value": "0", "type": "integer" }]
}
]
},
{
"values": [
{ "name": "tim", "value": "480", "type": "integer" },
{ "name": "wrk", "value": "V1", "type": "string" },
{ "name": "s1", "value": "0", "type": "integer" },
{ "name": "s2", "value": "0", "type": "integer" },
{ "name": "tmp", "value": "0", "type": "integer" }
],
"dosages": []
}
]
metadataobjectCustom attributes. Type can be integer, float, string, boolean[
{ "name": "max_t", "value": "0", "type": "integer" },
{ "name": "weight", "value": "16830", "type": "integer" },
{ "name": "pieces", "value": "48", "type": "integer" }
]