Different label for same type channels

Hello,

As I’m working on an AirZone binding, I have declared the following channel type in the XML definition file:

<channel-type id="stage" advanced="true">
	<item-type>Number</item-type>
	<label>@text/channel-type.airzone.zone.stage.label</label>
	<description>@text/channel-type.airzone.zone.stage.description</description>
	<category>Number</category>
	<state min="1" max="3" />
</channel-type>

That channel type is meant to be used for the “heat stage” and the “cold stage” that are available on each zone, so I have declared the channels like this:

<channel id="heatStage" typeId="stage" />
<channel id="coldStage" typeId="stage" />

While this works fine, it has an annoying effect in that both channels have the same label in the GUI, making them hard to differentiate:

image

I could not find a clear definition of what’s acceptable in the XML in the channels definition, so is there a way to give a different label to two channels using the same type?
Sure, I could duplicate the type definition, but it doesn’t feel right.

Both channels are mapped to the same channel-type id, therefore you get the same label. You will need different channel types.

I should have read the XML document better, there is an XSD import at the top:

xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"

And looking in that XSD file, we see the following:

<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>

So the id and typeId attributes are required but one should be able to specify child elements among which the label one looks promising.
So I left the default label on the channel type definition but I modified my channel declarations like this:

<channel id="heatStage" typeId="stage">
	<label>@text/channel-type.airzone.zone.heatStage.label</label> 
</channel>
<channel id="coldStage" typeId="stage">
	<label>@text/channel-type.airzone.zone.coldStage.label</label>
</channel>

And sure enough, the default label is overwritten by that label definition:

image

So the conclusion is that it is possible, just that I need to refresh my XSD reading skills.