Create dictionary
To create a new dictionary, preform the following actions:
-
Open the system configuration window: on the toolbar, press the username in the top right corner and select the "Configuration" item.
-
Go to the "Dictionaries" section:
List of dictionaries -
Press the
button. -
In the window to the right of the list, enter the dictionary’s name and set its values.
-
Press the
button.
REST API
You can create dictionary via REST API with Create dictionary request.
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:
-
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.
Adding the "Counter" widget
-
-
Select the "Counter" widget type.
-
Fill the key and value fields.
You can use both text and numerical values as keys and values. -
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
or 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.