Create dictionary

To create a new dictionary, preform the following actions:

  1. Open the system configuration window: on the toolbar, press the username in the top right corner and select the "Configuration" item.

  2. Go to the "Dictionaries" section:

    list
    List of dictionaries
  3. Press the button.

  4. In the window to the right of the list, enter the dictionary’s name and set its values.

  5. Press the Apply button.

REST API

You can create dictionary via REST API with Create dictionary request.

Request example via curl
login=<...>
password=<...>
saymon_hostname=<...>
url=https://$saymon_hostname/node/api/dictionaries

curl -X POST $url -u $login:$password \
    -H "Content-Type: application/json" \
    -d @- <<EOF
{
    "name": "Door state",
    "content": {
        "0": "Closed",
        "1": "Opened"
    }
}
EOF

Create dictionary for Counter widgets via the Widget menu

You can also create a dictionary from the Widget menu. To do this, perform the following actions:

  1. Open the "Add Widget" menu:

    • in the end view press the button on the breadcrumbs panel;

    • in the standard view of the parent object, hover over the object and press the icon.

    • in the standard view of the parent object, hover over the widget and press the icon.

      extracted-media/media/image177
      Adding the "Counter" widget
  2. Select the "Counter" widget type.

  3. Fill the key and value fields.

    You can use both text and numerical values as keys and values.
  4. Press the button to add multiple rows to the dictionary.

You don’t need to save the created dictionary to apply it to the current widget. Dictionary will be applied when you press the Add or Save button. To save the created dictionary to reuse it on other widgets or other parts of the system, enter a name for a new dictionary and press the button.