{
    "i18n": true,
    "type": "tabs",
    "tabsStyle": {
        "width": "calc(100% - 100px)"
    },
    "items": {
        "tabOptions": {
            "type": "panel",
            "label": "Options",
            "items": {
                "deviceType": {
                    "type": "selectSendTo",
                    "label": "wMBus Receiver",
                    "command": "listReceiver",
                    "noTranslation": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 6,
                    "lg": 4,
                    "xl": 4
                },
                "wmbusMode": {
                    "type": "selectSendTo",
                    "label": "wMBus Mode",
                    "command": "listWmbusMode",
                    "jsonData": "{\"deviceType\": \"${data.deviceType}\"}",
                    "alsoDependsOn": ["deviceType"],
                    "onChange": {
                        "alsoDependsOn": ["deviceType"],
                        "calculateFunc": "const modes = {\"ebi\":[\"C\",\"S\",\"T\"],\"amber\":[\"C\",\"S\",\"T\",\"CT\"],\"imst\":[\"CA\",\"CB\",\"S\",\"T\"],\"imstv2\":[\"S\",\"T\",\"C/T\",\"C\",\"Tx\"],\"cul\":[\"S\",\"T\",\"C\"],\"simple\":[\"A\",\"B\"]}; const valid = modes[data.deviceType] || []; return valid.includes(data.wmbusMode) ? data.wmbusMode : (valid[0] || '');"
                    },
                    "noTranslation": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 6,
                    "lg": 4,
                    "xl": 4
                },
                "serialPort": {
                    "type": "autocompleteSendTo",
                    "label": "serialPort",
                    "command": "listUart",
                    "freeSolo": true,
                    "help": "serialPortHelp",
                    "newLine": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 6,
                    "lg": 4,
                    "xl": 4
                },
                "serialBaudRate": {
                    "type": "select",
                    "label": "serialBaudRate",
                    "noTranslation": true,
                    "options": [
                        { "label": "110", "value": 110 },
                        { "label": "150", "value": 150 },
                        { "label": "300", "value": 300 },
                        { "label": "600", "value": 600 },
                        { "label": "1200", "value": 1200 },
                        { "label": "2400", "value": 2400 },
                        { "label": "4800", "value": 4800 },
                        { "label": "9600", "value": 9600 },
                        { "label": "19200", "value": 19200 },
                        { "label": "38400", "value": 38400 },
                        { "label": "56000", "value": 56000 },
                        { "label": "57600", "value": 57600 },
                        { "label": "115200", "value": 115200 }
                    ],
                    "xs": 12,
                    "sm": 12,
                    "md": 6,
                    "lg": 4,
                    "xl": 4
                },
                "optionsHeader": {
                    "type": "header",
                    "text": "Other options",
                    "size": 2,
                    "newLine": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "xl": 12
                },
                "alwaysUpdate": {
                    "type": "checkbox",
                    "label": "Update unchanged states",
                    "newLine": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 6,
                    "lg": 4,
                    "xl": 4
                },
                "forcekWh": {
                    "type": "checkbox",
                    "label": "Force energy units to kWh",
                    "xs": 12,
                    "sm": 12,
                    "md": 6,
                    "lg": 4,
                    "xl": 4
                },
                "autoBlocklist": {
                    "type": "checkbox",
                    "label": "Temporarily block device after consecutive failures",
                    "newLine": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 6,
                    "lg": 4,
                    "xl": 4
                },
                "ignoreUnknownDevices": {
                    "type": "checkbox",
                    "label": "Only handle devices that already have an object tree",
                    "help": "ignoreUnknownDevicesHelp",
                    "xs": 12,
                    "sm": 12,
                    "md": 6,
                    "lg": 4,
                    "xl": 4
                }
            }
        },
        "tabKeys": {
            "type": "panel",
            "label": "AES keys",
            "items": {
                "keysInfo": {
                    "type": "staticText",
                    "text": "aesKeysHint",
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "xl": 12
                },
                "keysIgnoredInfo": {
                    "type": "staticText",
                    "text": "keysIgnoredHint",
                    "hidden": "!data.ignoreUnknownDevices",
                    "newLine": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "xl": 12
                },
                "importNeedsKey": {
                    "type": "sendTo",
                    "label": "Check for new devices that need a key",
                    "command": "importNeedsKey",
                    "jsonData": "{\"aeskeys\": ${JSON.stringify(data.aeskeys || [])}}",
                    "disabled": "!!data.ignoreUnknownDevices",
                    "useNative": true,
                    "result": {
                        "devicesAdded": "importNeedsKeyAdded",
                        "noNewDevices": "importNeedsKeyNothing"
                    },
                    "variant": "contained",
                    "icon": "search",
                    "confirm": {
                        "title": "Check for new devices that need a key",
                        "text": "importNeedsKeyConfirm"
                    },
                    "newLine": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 6,
                    "lg": 4,
                    "xl": 4
                },
                "aeskeys": {
                    "type": "table",
                    "newLine": true,
                    "items": [
                        { "type": "text", "attr": "id", "title": "Device address", "width": "40%", "filter": true, "sort": true },
                        { "type": "text", "attr": "key", "title": "AES key", "width": "60%" }
                    ],
                    "uniqueColumns": ["id"],
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "xl": 12
                }
            }
        },
        "tabManufacturer": {
            "type": "panel",
            "label": "Manufacturer specific data",
            "items": {
                "manufacturerSpecificInfo": {
                    "type": "infoBox",
                    "text": "manufacturerSpecificHint",
                    "boxType": "info",
                    "closeable": false,
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "xl": 12
                },
                "descriptionsHeader": {
                    "type": "header",
                    "text": "Descriptions per manufacturer",
                    "size": 3,
                    "newLine": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "xl": 12
                },
                "descriptionsEditorHint": {
                    "type": "staticText",
                    "text": "manufacturerSpecificEditorHint",
                    "newLine": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "xl": 12
                },
                "manufacturerSpecific": {
                    "type": "jsonEditor",
                    "label": "Descriptions per manufacturer",
                    "help": "manufacturerSpecificFieldReference",
                    "helpLink": "https://github.com/lvogt/wireless-mbus-parser#describing-a-blob-instead-of-decoding-it",
                    "allowEmpty": true,
                    "newLine": true,
                    "xs": 12,
                    "sm": 6,
                    "md": 4,
                    "lg": 3,
                    "xl": 2
                },
                "checkManufacturerSpecific": {
                    "type": "sendTo",
                    "label": "Check the descriptions",
                    "command": "checkManufacturerSpecific",
                    "jsonData": "{\"descriptions\": ${JSON.stringify(data.manufacturerSpecific || '')}}",
                    "variant": "outlined",
                    "icon": "search",
                    "xs": 12,
                    "sm": 6,
                    "md": 4,
                    "lg": 3,
                    "xl": 2
                },
                "exampleManufacturerSpecific": {
                    "type": "sendTo",
                    "label": "Insert an example",
                    "command": "exampleManufacturerSpecific",
                    "jsonData": "{\"descriptions\": ${JSON.stringify(data.manufacturerSpecific || '')}}",
                    "useNative": true,
                    "result": {
                        "manufacturerSpecificExampleInserted": "manufacturerSpecificExampleInserted"
                    },
                    "variant": "outlined",
                    "icon": "add",
                    "xs": 12,
                    "sm": 6,
                    "md": 4,
                    "lg": 3,
                    "xl": 2
                },
                "previewHeader": {
                    "type": "header",
                    "text": "Try a description on a telegram",
                    "size": 3,
                    "newLine": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "xl": 12
                },
                "previewHint": {
                    "type": "staticText",
                    "text": "manufacturerSpecificTelegramHelp",
                    "newLine": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "xl": 12
                },
                "manufacturerSpecificTelegram": {
                    "type": "text",
                    "label": "Telegram as hex",
                    "placeholder": "2C446532821851582C067AE1000000046D19...",
                    "newLine": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 6,
                    "xl": 5
                },
                "previewManufacturerSpecific": {
                    "type": "sendTo",
                    "label": "Decode it with the descriptions",
                    "command": "previewManufacturerSpecific",
                    "jsonData": "{\"descriptions\": ${JSON.stringify(data.manufacturerSpecific || '')}, \"telegram\": ${JSON.stringify(data.manufacturerSpecificTelegram || '')}}",
                    "useNative": true,
                    "result": {
                        "manufacturerSpecificPreviewOk": "manufacturerSpecificPreviewOk",
                        "manufacturerSpecificNoTelegram": "manufacturerSpecificNoTelegram",
                        "manufacturerSpecificReport": "manufacturerSpecificReport"
                    },
                    "variant": "outlined",
                    "icon": "play",
                    "xs": 12,
                    "sm": 12,
                    "md": 6,
                    "lg": 4,
                    "xl": 3
                },
                "manufacturerSpecificPreview": {
                    "type": "table",
                    "label": "What it would write",
                    "noDelete": true,
                    "items": [
                        { "type": "text", "attr": "state", "title": "State", "width": "32%", "readOnly": true },
                        { "type": "text", "attr": "name", "title": "Name", "width": "32%", "readOnly": true },
                        { "type": "text", "attr": "value", "title": "Value", "width": "18%", "readOnly": true },
                        { "type": "text", "attr": "unit", "title": "Unit", "width": "8%", "readOnly": true },
                        { "type": "text", "attr": "source", "title": "Source", "width": "10%", "readOnly": true }
                    ],
                    "newLine": true,
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "xl": 12
                }
            }
        },
        "tabBlocklist": {
            "type": "panel",
            "label": "Blocked Devices",
            "items": {
                "blocklistInfo": {
                    "type": "staticText",
                    "text": "blocklistHint",
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "xl": 12
                },
                "blacklist": {
                    "type": "table",
                    "newLine": true,
                    "items": [
                        { "type": "text", "attr": "id", "title": "Device address", "width": "100%", "filter": true, "sort": true }
                    ],
                    "uniqueColumns": ["id"],
                    "xs": 12,
                    "sm": 12,
                    "md": 12,
                    "lg": 12,
                    "xl": 12
                }
            }
        }
    }
}
