<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:thing-description="https://openhab.org/schemas/thing-description/v1.0.0"
	xmlns:config-description="https://openhab.org/schemas/config-description/v1.0.0"
	targetNamespace="https://openhab.org/schemas/thing-description/v1.0.0">

	<xs:import namespace="https://openhab.org/schemas/config-description/v1.0.0"
		schemaLocation="https://openhab.org/schemas/config-description-1.0.0.xsd"/>

	<xs:element name="thing-descriptions">
		<xs:complexType>
			<xs:choice minOccurs="1" maxOccurs="unbounded">
				<xs:element name="thing-type" type="thing-description:thingType"/>
				<xs:element name="bridge-type" type="thing-description:bridgeType"/>
				<xs:element name="channel-type" type="thing-description:channelType"/>
				<xs:element name="channel-group-type" type="thing-description:channelGroupType"/>
			</xs:choice>
			<xs:attribute name="bindingId" type="config-description:idRestrictionPattern" use="required"/>
		</xs:complexType>
	</xs:element>

	<xs:complexType name="thingType">
		<xs:sequence>
			<xs:element name="supported-bridge-type-refs" type="thing-description:supportedBridgeTypeRefs"
				minOccurs="0"/>
			<xs:element name="label" type="xs:string"/>
			<xs:element name="description" type="xs:string" minOccurs="0"/>
			<xs:element name="category" type="xs:string" minOccurs="0"/>
			<xs:element name="semantic-equipment-tag" type="thing-description:semanticEquipmentTag" minOccurs="0"/>
			<xs:choice minOccurs="0">
				<xs:element name="channels" type="thing-description:channels"/>
				<xs:element name="channel-groups" type="thing-description:channelGroups"/>
			</xs:choice>
			<xs:element name="properties" type="thing-description:properties" minOccurs="0"/>
			<xs:element name="representation-property" type="xs:string" minOccurs="0"/>
			<xs:choice minOccurs="0">
				<xs:element name="config-description" type="config-description:configDescription"/>
				<xs:element name="config-description-ref" type="config-description:configDescriptionRef"/>
			</xs:choice>
		</xs:sequence>
		<xs:attribute name="id" type="config-description:idRestrictionPattern" use="required"/>
		<xs:attribute name="listed" type="xs:boolean" default="true" use="optional"/>
		<xs:attribute name="extensible" type="thing-description:namespaceIdListRestrictionPattern" use="optional"/>
	</xs:complexType>

	<xs:simpleType name="namespaceIdListRestrictionPattern">
		<xs:restriction base="xs:string">
			<xs:pattern value="[A-Za-z0-9\-_.]+(,( )?[A-Za-z0-9\-_.]+)*"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="bridgeType">
		<xs:complexContent>
			<xs:extension base="thing-description:thingType"/>
		</xs:complexContent>
	</xs:complexType>

	<xs:simpleType name="auto-update-policy">
		<xs:restriction base="xs:string">
			<xs:enumeration value="veto"/>
			<xs:enumeration value="default"/>
			<xs:enumeration value="recommend"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="channelType">
		<xs:sequence>
			<xs:element name="item-type" type="thing-description:itemType" minOccurs="0"/>
			<xs:element name="kind" type="xs:string" minOccurs="0"/>
			<xs:element name="label" type="xs:string"/>
			<xs:element name="description" type="xs:string" minOccurs="0"/>
			<xs:element name="category" type="xs:string" minOccurs="0"/>
			<xs:element name="tags" type="thing-description:tags" minOccurs="0"/>
			<xs:element name="state" type="thing-description:state" minOccurs="0"/>
			<xs:element name="command" type="thing-description:command" minOccurs="0"/>
			<xs:element name="event" type="thing-description:event" minOccurs="0"/>
			<xs:element name="autoUpdatePolicy" type="thing-description:auto-update-policy" minOccurs="0"/>
			<xs:choice minOccurs="0">
				<xs:element name="config-description" type="config-description:configDescription"/>
				<xs:element name="config-description-ref" type="config-description:configDescriptionRef"/>
			</xs:choice>
		</xs:sequence>
		<xs:attribute name="id" type="config-description:idRestrictionPattern" use="required"/>
		<xs:attribute name="advanced" type="xs:boolean" default="false" use="optional"/>
		<xs:attribute name="system" type="xs:boolean" default="false" use="optional"/>
	</xs:complexType>

	<xs:complexType name="channelGroupType">
		<xs:sequence>
			<xs:element name="label" type="xs:string"/>
			<xs:element name="description" type="xs:string" minOccurs="0"/>
			<xs:element name="category" type="xs:string" minOccurs="0"/>
			<xs:element name="channels" type="thing-description:channels" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="id" type="config-description:idRestrictionPattern" use="required"/>
	</xs:complexType>

	<xs:complexType name="supportedBridgeTypeRefs">
		<xs:sequence>
			<xs:element name="bridge-type-ref" type="thing-description:bridgeTypeRef" minOccurs="1"
				maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="bridgeTypeRef">
		<xs:attribute name="id" type="config-description:idRestrictionPattern" use="required"/>
		<xs:attribute name="bindingId" type="config-description:idRestrictionPattern" use="optional"/>
	</xs:complexType>

	<xs:complexType name="channels">
		<xs:sequence>
			<xs:element name="channel" type="thing-description:channel" minOccurs="1" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<xs:simpleType name="namespaceIdRestrictionPattern">
		<xs:restriction base="xs:string">
			<xs:pattern value="[A-Za-z0-9\-_.]+"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="channel">
		<xs:sequence>
			<xs:element name="label" type="xs:string" minOccurs="0"/>
			<xs:element name="description" type="xs:string" minOccurs="0"/>
			<xs:element name="properties" type="thing-description:properties" minOccurs="0"/>
			<xs:element name="autoUpdatePolicy" type="thing-description:auto-update-policy" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="id" type="config-description:idRestrictionPattern" use="required"/>
		<xs:attribute name="typeId" type="thing-description:namespaceIdRestrictionPattern" use="required"/>
	</xs:complexType>

	<xs:complexType name="channelGroups">
		<xs:sequence>
			<xs:element name="channel-group" type="thing-description:channelGroup" minOccurs="1" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="channelGroup">
		<xs:sequence>
			<xs:element name="label" type="xs:string" minOccurs="0"/>
			<xs:element name="description" type="xs:string" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="id" type="config-description:idRestrictionPattern" use="required"/>
		<xs:attribute name="typeId" type="config-description:idRestrictionPattern" use="required"/>
	</xs:complexType>

	<xs:simpleType name="itemTypeName">
		<xs:restriction base="xs:string">
			<xs:enumeration value="Call"/>
			<xs:enumeration value="Color"/>
			<xs:enumeration value="Contact"/>
			<xs:enumeration value="DateTime"/>
			<xs:enumeration value="Dimmer"/>
			<xs:enumeration value="Group"/>
			<xs:enumeration value="Image"/>
			<xs:enumeration value="Location"/>
			<xs:enumeration value="Number"/>
			<xs:enumeration value="Number:Acceleration"/>
			<xs:enumeration value="Number:AmountOfSubstance"/>
			<xs:enumeration value="Number:Angle"/>
			<xs:enumeration value="Number:Area"/>
			<xs:enumeration value="Number:ArealDensity"/>
			<xs:enumeration value="Number:CatalyticActivity"/>
			<xs:enumeration value="Number:Currency"/>
			<xs:enumeration value="Number:DataAmount"/>
			<xs:enumeration value="Number:DataTransferRate"/>
			<xs:enumeration value="Number:Density"/>
			<xs:enumeration value="Number:Dimensionless"/>
			<xs:enumeration value="Number:ElectricCapacitance"/>
			<xs:enumeration value="Number:ElectricCharge"/>
			<xs:enumeration value="Number:ElectricConductance"/>
			<xs:enumeration value="Number:ElectricConductivity"/>
			<xs:enumeration value="Number:ElectricCurrent"/>
			<xs:enumeration value="Number:ElectricInductance"/>
			<xs:enumeration value="Number:ElectricPotential"/>
			<xs:enumeration value="Number:ElectricResistance"/>
			<xs:enumeration value="Number:EmissionIntensity"/>
			<xs:enumeration value="Number:Energy"/>
			<xs:enumeration value="Number:EnergyPrice"/>
			<xs:enumeration value="Number:Force"/>
			<xs:enumeration value="Number:Frequency"/>
			<xs:enumeration value="Number:Illuminance"/>
			<xs:enumeration value="Number:Intensity"/>
			<xs:enumeration value="Number:Length"/>
			<xs:enumeration value="Number:LuminousFlux"/>
			<xs:enumeration value="Number:LuminousIntensity"/>
			<xs:enumeration value="Number:MagneticFlux"/>
			<xs:enumeration value="Number:MagneticFluxDensity"/>
			<xs:enumeration value="Number:Mass"/>
			<xs:enumeration value="Number:Power"/>
			<xs:enumeration value="Number:Pressure"/>
			<xs:enumeration value="Number:RadiationDoseAbsorbed"/>
			<xs:enumeration value="Number:RadiationDoseEffective"/>
			<xs:enumeration value="Number:RadiationSpecificActivity"/>
			<xs:enumeration value="Number:RadioactiveActivity"/>
			<xs:enumeration value="Number:SolidAngle"/>
			<xs:enumeration value="Number:Speed"/>
			<xs:enumeration value="Number:Temperature"/>
			<xs:enumeration value="Number:Time"/>
			<xs:enumeration value="Number:Volume"/>
			<xs:enumeration value="Number:VolumePrice"/>
			<xs:enumeration value="Number:VolumetricFlowRate"/>
			<xs:enumeration value="Player"/>
			<xs:enumeration value="Rollershutter"/>
			<xs:enumeration value="String"/>
			<xs:enumeration value="Switch"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="itemType">
		<xs:simpleContent>
			<xs:extension base="thing-description:itemTypeName">
				<xs:attribute name="unitHint" type="xs:string"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="tags">
		<xs:sequence>
			<xs:element name="tag" type="thing-description:semanticPropertyOrPointTag" minOccurs="1" maxOccurs="2"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="state">
		<xs:sequence>
			<xs:element name="options" type="thing-description:options" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="min" type="xs:decimal" use="optional"/>
		<xs:attribute name="max" type="xs:decimal" use="optional"/>
		<xs:attribute name="step" type="xs:decimal" use="optional"/>
		<xs:attribute name="pattern" type="xs:string" use="optional"/>
		<xs:attribute name="readOnly" type="xs:boolean" default="false" use="optional"/>
	</xs:complexType>

	<xs:complexType name="event">
		<xs:sequence>
			<xs:element name="options" type="thing-description:options" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="options">
		<xs:sequence>
			<xs:element name="option" type="thing-description:option" minOccurs="1" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="command">
		<xs:sequence>
			<xs:element name="options" type="thing-description:options" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="option">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="value" type="xs:string" use="required"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="properties">
		<xs:sequence>
			<xs:element name="property" type="thing-description:property" minOccurs="1" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="property">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="name" type="xs:string" use="required"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:simpleType name="semanticPropertyOrPointTag">
		<xs:restriction base="xs:string">
			<!-- Begin Allowed Semantic Property Tag Values -->
			<!-- DO NOT EDIT THIS LIST - Generated by generateTagClasses.groovy -->
			<xs:enumeration value="Airconditioning"/>
			<xs:enumeration value="Airflow"/>
			<xs:enumeration value="AirQuality"/>
			<xs:enumeration value="App"/>
			<xs:enumeration value="AQI"/>
			<xs:enumeration value="Brightness"/>
			<xs:enumeration value="Channel"/>
			<xs:enumeration value="CO"/>
			<xs:enumeration value="CO2"/>
			<xs:enumeration value="Color"/>
			<xs:enumeration value="ColorTemperature"/>
			<xs:enumeration value="Current"/>
			<xs:enumeration value="Duration"/>
			<xs:enumeration value="Enabled"/>
			<xs:enumeration value="Energy"/>
			<xs:enumeration value="Frequency"/>
			<xs:enumeration value="Gas"/>
			<xs:enumeration value="GeoLocation"/>
			<xs:enumeration value="Heating"/>
			<xs:enumeration value="Humidity"/>
			<xs:enumeration value="Illuminance"/>
			<xs:enumeration value="Info"/>
			<xs:enumeration value="Level"/>
			<xs:enumeration value="Light"/>
			<xs:enumeration value="LockState"/>
			<xs:enumeration value="LowBattery"/>
			<xs:enumeration value="MediaControl"/>
			<xs:enumeration value="Mode"/>
			<xs:enumeration value="Moisture"/>
			<xs:enumeration value="Motion"/>
			<xs:enumeration value="Noise"/>
			<xs:enumeration value="Oil"/>
			<xs:enumeration value="Opening"/>
			<xs:enumeration value="OpenLevel"/>
			<xs:enumeration value="OpenState"/>
			<xs:enumeration value="Ozone"/>
			<xs:enumeration value="ParticulateMatter"/>
			<xs:enumeration value="Pollen"/>
			<xs:enumeration value="Position"/>
			<xs:enumeration value="Power"/>
			<xs:enumeration value="Precipitation"/>
			<xs:enumeration value="Presence"/>
			<xs:enumeration value="Pressure"/>
			<xs:enumeration value="Price"/>
			<xs:enumeration value="Progress"/>
			<xs:enumeration value="QualityOfService"/>
			<xs:enumeration value="Radon"/>
			<xs:enumeration value="Rain"/>
			<xs:enumeration value="RSSI"/>
			<xs:enumeration value="SignalStrength"/>
			<xs:enumeration value="Smoke"/>
			<xs:enumeration value="SoundVolume"/>
			<xs:enumeration value="Speed"/>
			<xs:enumeration value="Tampered"/>
			<xs:enumeration value="Temperature"/>
			<xs:enumeration value="Tilt"/>
			<xs:enumeration value="Timestamp"/>
			<xs:enumeration value="Ultraviolet"/>
			<xs:enumeration value="Ventilation"/>
			<xs:enumeration value="Vibration"/>
			<xs:enumeration value="VOC"/>
			<xs:enumeration value="Voltage"/>
			<xs:enumeration value="Water"/>
			<xs:enumeration value="Wind"/>
			<!-- End Allowed Semantic Property Tag Values -->

			<!-- Begin Allowed Semantic Point Tag Values -->
			<!-- DO NOT EDIT THIS LIST - Generated by generateTagClasses.groovy -->
			<xs:enumeration value="Alarm"/>
			<xs:enumeration value="Calculation"/>
			<xs:enumeration value="Control"/>
			<xs:enumeration value="Forecast"/>
			<xs:enumeration value="Measurement"/>
			<xs:enumeration value="Setpoint"/>
			<xs:enumeration value="Status"/>
			<xs:enumeration value="Switch"/>
			<!-- End Allowed Semantic Point Tag Values -->
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="semanticEquipmentTag">
		<xs:restriction base="xs:string">
			<!-- Begin Allowed Semantic Equipment Tag Values -->
			<!-- DO NOT EDIT THIS LIST - Generated by generateTagClasses.groovy -->
			<xs:enumeration value="AccentLight"/>
			<xs:enumeration value="AirConditioner"/>
			<xs:enumeration value="AirFilter"/>
			<xs:enumeration value="AirFryer"/>
			<xs:enumeration value="AirQualitySensor"/>
			<xs:enumeration value="AlarmDevice"/>
			<xs:enumeration value="AlarmSystem"/>
			<xs:enumeration value="AlarmZone"/>
			<xs:enumeration value="Application"/>
			<xs:enumeration value="Aquarium"/>
			<xs:enumeration value="AudioVisual"/>
			<xs:enumeration value="BackDoor"/>
			<xs:enumeration value="Battery"/>
			<xs:enumeration value="Bed"/>
			<xs:enumeration value="Blinds"/>
			<xs:enumeration value="Boiler"/>
			<xs:enumeration value="Button"/>
			<xs:enumeration value="Camera"/>
			<xs:enumeration value="Car"/>
			<xs:enumeration value="CeilingFan"/>
			<xs:enumeration value="CellarDoor"/>
			<xs:enumeration value="Chandelier"/>
			<xs:enumeration value="Chlorinator"/>
			<xs:enumeration value="CleaningRobot"/>
			<xs:enumeration value="CO2Sensor"/>
			<xs:enumeration value="CoffeeMaker"/>
			<xs:enumeration value="Computer"/>
			<xs:enumeration value="ContactSensor"/>
			<xs:enumeration value="ControlDevice"/>
			<xs:enumeration value="Cooktop"/>
			<xs:enumeration value="COSensor"/>
			<xs:enumeration value="Dehumidifier"/>
			<xs:enumeration value="Dial"/>
			<xs:enumeration value="Dishwasher"/>
			<xs:enumeration value="Display"/>
			<xs:enumeration value="Door"/>
			<xs:enumeration value="Doorbell"/>
			<xs:enumeration value="Downlight"/>
			<xs:enumeration value="Drapes"/>
			<xs:enumeration value="DrinkingWater"/>
			<xs:enumeration value="Dryer"/>
			<xs:enumeration value="ElectricMeter"/>
			<xs:enumeration value="EVSE"/>
			<xs:enumeration value="ExhaustFan"/>
			<xs:enumeration value="Fan"/>
			<xs:enumeration value="FireDetector"/>
			<xs:enumeration value="Firewall"/>
			<xs:enumeration value="FlameDetector"/>
			<xs:enumeration value="FloodLight"/>
			<xs:enumeration value="FloorHeating"/>
			<xs:enumeration value="FoodProcessor"/>
			<xs:enumeration value="Freezer"/>
			<xs:enumeration value="FrontDoor"/>
			<xs:enumeration value="Fryer"/>
			<xs:enumeration value="Furnace"/>
			<xs:enumeration value="GarageDoor"/>
			<xs:enumeration value="GasMeter"/>
			<xs:enumeration value="Gate"/>
			<xs:enumeration value="Generator"/>
			<xs:enumeration value="GlassBreakDetector"/>
			<xs:enumeration value="HeatDetector"/>
			<xs:enumeration value="HeatPump"/>
			<xs:enumeration value="HeatRecovery"/>
			<xs:enumeration value="Horticulture"/>
			<xs:enumeration value="HotWaterFaucet"/>
			<xs:enumeration value="Humidifier"/>
			<xs:enumeration value="HumiditySensor"/>
			<xs:enumeration value="HVAC"/>
			<xs:enumeration value="IceMaker"/>
			<xs:enumeration value="IlluminanceSensor"/>
			<xs:enumeration value="InnerDoor"/>
			<xs:enumeration value="Inverter"/>
			<xs:enumeration value="Irrigation"/>
			<xs:enumeration value="Jacuzzi"/>
			<xs:enumeration value="Keypad"/>
			<xs:enumeration value="KitchenHood"/>
			<xs:enumeration value="Lamp"/>
			<xs:enumeration value="LawnMower"/>
			<xs:enumeration value="LeakSensor"/>
			<xs:enumeration value="Lightbulb"/>
			<xs:enumeration value="LightSource"/>
			<xs:enumeration value="LightStrip"/>
			<xs:enumeration value="LightStripe"/>
			<xs:enumeration value="Lock"/>
			<xs:enumeration value="MediaPlayer"/>
			<xs:enumeration value="Microwave"/>
			<xs:enumeration value="Mixer"/>
			<xs:enumeration value="MotionDetector"/>
			<xs:enumeration value="NetworkAppliance"/>
			<xs:enumeration value="NetworkSwitch"/>
			<xs:enumeration value="OccupancySensor"/>
			<xs:enumeration value="Oven"/>
			<xs:enumeration value="Pendant"/>
			<xs:enumeration value="PetCare"/>
			<xs:enumeration value="PetFeeder"/>
			<xs:enumeration value="PetFlap"/>
			<xs:enumeration value="PoolCover"/>
			<xs:enumeration value="PoolHeater"/>
			<xs:enumeration value="PowerOutlet"/>
			<xs:enumeration value="PowerSupply"/>
			<xs:enumeration value="Printer"/>
			<xs:enumeration value="Printer3D"/>
			<xs:enumeration value="Projector"/>
			<xs:enumeration value="Pump"/>
			<xs:enumeration value="RadiatorControl"/>
			<xs:enumeration value="Range"/>
			<xs:enumeration value="Receiver"/>
			<xs:enumeration value="Refrigerator"/>
			<xs:enumeration value="RemoteControl"/>
			<xs:enumeration value="Router"/>
			<xs:enumeration value="Sauna"/>
			<xs:enumeration value="Sconce"/>
			<xs:enumeration value="Screen"/>
			<xs:enumeration value="Sensor"/>
			<xs:enumeration value="Shower"/>
			<xs:enumeration value="SideDoor"/>
			<xs:enumeration value="Siren"/>
			<xs:enumeration value="Slider"/>
			<xs:enumeration value="Smartphone"/>
			<xs:enumeration value="SmartVent"/>
			<xs:enumeration value="SmokeDetector"/>
			<xs:enumeration value="SoilSensor"/>
			<xs:enumeration value="SolarPanel"/>
			<xs:enumeration value="Speaker"/>
			<xs:enumeration value="SpotLight"/>
			<xs:enumeration value="SwimmingPool"/>
			<xs:enumeration value="Television"/>
			<xs:enumeration value="TemperatureSensor"/>
			<xs:enumeration value="Thermostat"/>
			<xs:enumeration value="Toaster"/>
			<xs:enumeration value="Tool"/>
			<xs:enumeration value="Tracker"/>
			<xs:enumeration value="TrackLight"/>
			<xs:enumeration value="TransferSwitch"/>
			<xs:enumeration value="UPS"/>
			<xs:enumeration value="Valve"/>
			<xs:enumeration value="Vehicle"/>
			<xs:enumeration value="VibrationSensor"/>
			<xs:enumeration value="VoiceAssistant"/>
			<xs:enumeration value="WallLight"/>
			<xs:enumeration value="WallSwitch"/>
			<xs:enumeration value="WashingMachine"/>
			<xs:enumeration value="WaterFeature"/>
			<xs:enumeration value="WaterFilter"/>
			<xs:enumeration value="WaterHeater"/>
			<xs:enumeration value="WaterMeter"/>
			<xs:enumeration value="WaterQualitySensor"/>
			<xs:enumeration value="WaterSoftener"/>
			<xs:enumeration value="WeatherService"/>
			<xs:enumeration value="WeatherStation"/>
			<xs:enumeration value="WebService"/>
			<xs:enumeration value="Wellness"/>
			<xs:enumeration value="WhiteGood"/>
			<xs:enumeration value="WindGenerator"/>
			<xs:enumeration value="Window"/>
			<xs:enumeration value="WindowCovering"/>
			<xs:enumeration value="WirelessAccessPoint"/>
			<xs:enumeration value="Zone"/>
			<!-- End Allowed Semantic Equipment Tag Values -->
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
