{
    type: 'panel',
    label: 'Zigbee2MQTT',
    items: {
        _checkConfig: {
            // this component is not visible in the UI
            // it checks the configuration
            type: 'custom',
            bundlerType: 'module',
            i18n: true,
            url: 'custom/customComponents.js',
            name: 'ConfigCustomBackItUpSet/Components/CheckAllConfigInvisible',
        },
        _header: {
            type: 'header',
            size: 2,
            text: 'Zigbee2MQTT',
            xs: 12,
            sm: 12,
            md: 12,
            lg: 12,
            xl: 12,
        },
        zigbee2mqttType: {
            type: 'select',
            label: 'Source type',
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            options: [
                {
                    label: 'Remote',
                    value: 'remote',
                },
                {
                    label: 'Local',
                    value: 'local',
                },
            ],
            newLine: true,
        },
        zigbee2mqttPath: {
            hidden: "data.zigbee2mqttType == 'remote'",
            newLine: true,
            xs: 12,
            sm: 12,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'text',
            label: 'Zigbee2MQTT file path',
        },
        zigbee2mqttHost: {
            hidden: "data.zigbee2mqttType == 'local'",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'text',
            label: 'host',
            help: 'MQTT Hostname',
            validator: "data.zigbee2mqttHost && data.zigbee2mqttType == 'remote'",
            validatorNoSaveOnError: true,
            newLine: true,
        },
        zigbee2mqttPort: {
            hidden: "data.zigbee2mqttType == 'local'",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            min: 1,
            max: 65535,
            type: 'number',
            label: 'MQTT port',
            validator: "data.zigbee2mqttPort && data.zigbee2mqttType == 'remote'",
            validatorNoSaveOnError: true,
            help: 'default: 1885',
        },
        zigbee2mqttBaseTopic: {
            hidden: "data.zigbee2mqttType == 'local'",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'text',
            label: 'Base Topic',
            help: 'MQTT Base Topic',
            validator: "data.zigbee2mqttHost && data.zigbee2mqttType == 'remote'",
            validatorNoSaveOnError: true,
        },
        zigbee2mqttAuth: {
            type: 'checkbox',
            label: 'Authentication',
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            newLine: true,
        },
        zigbee2mqttUser: {
            hidden: "data.zigbee2mqttType == 'local' || !data.zigbee2mqttAuth",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'text',
            label: 'Username',
            help: 'MQTT Username',
            newLine: true,
        },
        zigbee2mqttPassword: {
            hidden: "data.zigbee2mqttType == 'local' || !data.zigbee2mqttAuth",
            xs: 12,
            sm: 9,
            md: 6,
            lg: 4,
            xl: 4,
            type: 'password',
            visible: true,
            label: 'Password',
            help: 'MQTT Password',
        },
    },
}
