New Binding some Questions

Hello,

i’m writing a new Binding and i have a short question. How can i change the name of “Value” and “Switch”?

All Channels have the same name.This is my thing-types.xml… Did i miss a Description or somthing else?

<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="timetree"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:thing="https://openhab.org/schemas/thing-description/v1.0.0"
	xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd">

	<bridge-type id="account">
		<label>TimeTree Account</label>
		<description>TimeTree Account</description>

		<config-description>
			<parameter name="personalAccessToken" type="text" required="true">
				<label>Personal Access Token</label>
				<description><![CDATA[The Personal Access Token, created by TimeTree. Look at https://timetreeapp.com/personal_access_tokens]]></description>
			</parameter>
			<parameter name="refresh" type="integer" unit="min" min="15">
				<default>30</default>
				<label>Refresh in Minutes</label>
				<description>Time between to API requests in minutes. Minimum 15 minutes.</description>
			</parameter>
		</config-description>
	</bridge-type>

	<thing-type id="calendar">
		<supported-bridge-type-refs>
			<bridge-type-ref id="account"/>
		</supported-bridge-type-refs>

		<label>Calendar</label>
		<description>Calendar</description>

		<channel-groups>
			<channel-group id="calendarDetails" typeId="calendarDetails">
				<label>Calendar Details</label>
			</channel-group>

			<channel-group id="event1" typeId="event">
				<label>Event 1</label>
			</channel-group>

			<channel-group id="event2" typeId="event">
				<label>Event 2</label>
			</channel-group>

			<channel-group id="event3" typeId="event">
				<label>Event 3</label>
			</channel-group>

			<channel-group id="event4" typeId="event">
				<label>Event 4</label>
			</channel-group>

			<channel-group id="event5" typeId="event">
				<label>Event 5</label>
			</channel-group>

			<channel-group id="event6" typeId="event">
				<label>Event 6</label>
			</channel-group>

			<channel-group id="event7" typeId="event">
				<label>Event 7</label>
			</channel-group>

			<channel-group id="event8" typeId="event">
				<label>Event 8</label>
			</channel-group>

			<channel-group id="event9" typeId="event">
				<label>Event 9</label>
			</channel-group>

			<channel-group id="event10" typeId="event">
				<label>Event 10</label>
			</channel-group>

		</channel-groups>
	</thing-type>

	<channel-group-type id="calendarDetails">
		<label>Calendar Details</label>
		<description>Details of the Calendar</description>
		<channels>
			<channel id="calendarName" typeId="calendarName"/>
		</channels>
	</channel-group-type>

	<channel-group-type id="event">
		<label>Event</label>
		<description>This is a Event-Channel</description>
		<channels>
			<channel id="category" typeId="category" />
			<channel id="title" typeId="title" />
			<channel id="allDay" typeId="allDay" />
			<channel id="startAt" typeId="startAt" />
			<channel id="startTimeZone" typeId="startTimeZone" />
			<channel id="endAt" typeId="endAt" />
			<channel id="endTimeZone" typeId="endTimeZone" />
			<channel id="description" typeId="description" />
			<channel id="location" typeId="location" />
			<channel id="url" typeId="url" />
			<channel id="updatedAt" typeId="updatedAt" />
			<channel id="createdAt" typeId="createdAt" />
		</channels>
	</channel-group-type>

	<channel-type id="category">
		<item-type>String</item-type>
		<label>Category</label>
		<description>Category of the Event</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="title">
		<item-type>String</item-type>
		<label>Title</label>
		<description>Title of the Event</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="allDay">
		<item-type>Switch</item-type>
		<label>All-Day</label>
		<description>All-Day Event.</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="startAt">
		<item-type>DateTime</item-type>
		<label>Start-Time</label>
		<description>Start time of the Event.</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="startTimeZone">
		<item-type>DateTime</item-type>
		<label>Start-Time-Timezone</label>
		<description>Timezone of the Event start.</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="endAt">
		<item-type>DateTime</item-type>
		<label>End-Time</label>
		<description>Start time of the Event.</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="endTimeZone">
		<item-type>String</item-type>
		<label>End-Time-Timezone</label>
		<description>Timezone of the Event end.</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="description">
		<item-type>String</item-type>
		<label>Description</label>
		<description>Textual description of the Event.</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="location">
		<item-type>String</item-type>
		<label>Location</label>
		<description>The Country of the Event.</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="url">
		<item-type>String</item-type>
		<label>Url</label>
		<description>Optional URL of the Event.</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="updatedAt">
		<item-type>DateTime</item-type>
		<label>Updated-At</label>
		<description>Update time of the Event.</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="createdAt">
		<item-type>DateTime</item-type>
		<label>Created-At</label>
		<description>Create time of the Event.</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="calendarName">
		<item-type>String</item-type>
		<label>Description</label>
		<description>Textual description of the warning.</description>
		<state readOnly="true"/>
	</channel-type>

	<channel-type id="updates">
		<kind>trigger</kind>
		<label>Updated</label>
		<description></description>
		<event>
			<options>
				<option value="NEW">New</option>
			</options>
		</event>
	</channel-type>

</thing:thing-descriptions>

Patrik, your binding does the right thing. What you see in the Control panel in each box are all the items you have defined for that thing. If you give an item a label it will replace Value/Switch/etc.

I think it would be a great idea to add the behavior that you expected to the Control panel: If no item label is provided default to the channel name, not the channel type. Do you want to file an enhancement request for that?

1 Like

Items may have no channels linked, or several.