Skip to content

Commit d7ca140

Browse files
author
Marko Petzold
committed
docs: improve definition-schema.json for AI agent readability
1 parent 8cca061 commit d7ca140

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

src/definition-schema.json

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,50 @@
11
{
22
"title": "InputData",
3+
"description": "A toggle switch widget for displaying and controlling binary device states. Use this widget to show ON/OFF status indicators that can also trigger device actions when clicked. Supports configurable state mapping to interpret various data values as ON, OFF, or UNKNOWN states. When connected to a device action, clicking the switch sends commands to control physical devices or trigger backend operations. Multiple switches can be displayed in one widget. Ideal for IoT device control panels, smart home interfaces, equipment control dashboards, or any scenario requiring visual toggle controls with action capabilities.",
34
"type": "object",
45
"properties": {
56
"title": {
67
"title": "Title",
8+
"description": "The main heading displayed above the switch controls. Use to describe the control group (e.g., 'Light Controls', 'Pump Switches').",
79
"type": "string",
810
"order": 1
911
},
1012
"subTitle": {
1113
"title": "Subtitle",
14+
"description": "Secondary text displayed below the title. Use for additional context like location, device group, or instructions.",
1215
"type": "string",
1316
"order": 2
1417
},
1518
"dataseries": {
1619
"title": "Switches",
20+
"description": "Array of switch configurations. Each entry creates a toggle switch with its own state mapping and optional device action binding.",
1721
"type": "array",
1822
"order": 3,
1923
"items": {
2024
"type": "object",
2125
"properties": {
2226
"label": {
2327
"title": "Label",
24-
"description": "The label for the switch.",
28+
"description": "Display text identifying this switch. Should clearly describe what the switch controls (e.g., 'Main Power', 'Pump 1', 'Night Mode').",
2529
"type": "string",
2630
"order": 1
2731
},
2832
"stateMap": {
2933
"title": "State Map",
30-
"description": "Specify the values for the ON and OFF states. Any value that does not match to either an ON or OFF state will be considered as UNKNOWN.",
34+
"description": "Defines how data values are interpreted as switch states. Configure which values represent ON and OFF. Values not matching either state display as UNKNOWN (neutral position).",
3135
"type": "object",
3236
"required": true,
3337
"order": 2,
3438
"properties": {
3539
"on": {
3640
"title": "ON Values",
37-
"description": "The value or list of values that represent the ON state. You can also use an expression like <4 or >33 to specify a numeric range. If a value matches an ON and an OFF state, the ON state will be used.",
41+
"description": "Values that indicate the ON state. Can be: a single value ('1', 'true', 'ON'), comma-separated list ('1,true,ON'), or numeric expression ('<4' means values below 4 are ON, '>33' means values above 33 are ON). If a value matches both ON and OFF, ON takes precedence.",
3842
"type": "string",
3943
"required": true
4044
},
4145
"off": {
4246
"title": "OFF Values",
43-
"description": "The value or list of values that represent the OFF state. You can also use an expression like <4 or >33 to specify a numeric range. If a value matches an ON and an OFF state, the ON state will be used.",
47+
"description": "Values that indicate the OFF state. Can be: a single value ('0', 'false', 'OFF'), comma-separated list ('0,false,OFF'), or numeric expression ('<4' means values below 4 are OFF, '>33' means values above 33 are OFF). Values matching neither ON nor OFF show as UNKNOWN.",
4448
"type": "string",
4549
"required": true
4650
}
@@ -49,43 +53,45 @@
4953
"value": {
5054
"title": "Switch State",
5155
"type": "string",
52-
"description": "Is not strictly required, but is strongly recommended to be connected to the backend column that represents the switch state. This keeps the switch visual state consistent with its physical state.",
56+
"description": "The current state value from the backend, used to display the correct switch position. Strongly recommended to bind this to the actual device state column to keep the visual state synchronized with the physical device state.",
5357
"required": false,
5458
"order": 3
5559
},
5660
"actionDevice": {
5761
"title": "Action Device Target",
58-
"description": "The device that should handle the click on the switch. The 'Device ID' column can be used here when using data driven mode.",
62+
"description": "The device that receives commands when the switch is clicked. In data-driven mode, bind to a 'Device ID' column to dynamically target different devices per row.",
5963
"type": "actionDevice",
6064
"order": 4
6165
},
6266
"actionApp": {
6367
"title": "Action App",
64-
"description": "The app that should handle the click on the switch.",
68+
"description": "The application/service on the target device that handles the switch command. Select from available apps installed on the device.",
6569
"dataDrivenDisabled": true,
6670
"type": "actionApp",
6771
"order": 5
6872
},
6973
"actionTopic": {
7074
"title": "Action App Topic",
71-
"description": "The action topic that is called at the selected app at the selected device when clicking the switch. The arguments will be True for 'ON' and False for 'OFF'. Refer to the documentation of the app for available topics to call.",
75+
"description": "The specific command/topic sent to the app when the switch is clicked. Arguments sent are: True for turning ON, False for turning OFF. Refer to the app's documentation for available topics.",
7276
"type": "string",
7377
"order": 6
7478
},
7579
"styling": {
7680
"title": "Styling",
77-
"description": "",
81+
"description": "Visual styling options for the switch and its label.",
7882
"type": "object",
7983
"order": 9,
8084
"properties": {
8185
"labelColor": {
8286
"title": "Label Color",
87+
"description": "Color of the switch label text.",
8388
"type": "color",
8489
"color": true,
8590
"order": 4
8691
},
8792
"valueColor": {
8893
"title": "Value Color",
94+
"description": "Color of the state value text displayed with the switch.",
8995
"type": "color",
9096
"color": true,
9197
"order": 5

0 commit comments

Comments
 (0)