Am I missing Channels?

Newbie question about channels.

I’m still exploring the system, and so far I have setup a switch, and two lamps.
I have not yet set up any pages, I just wanted to see if I could turn the switch on and off, and if I could dim the lamps and change its color. Just getting a feel for the basics, so to say.

The switch (KASA) worked just as expected: I installed the TP-LINK binding, added a ‘Thing’: the device was not auto-detected, but once I entered its IP address, it WAS found, I then clicked on the Channels tab, and saw the Power channel, which I linked to an Item of type Switch.
Clicking on that item, I can now turn that switch on and off. So far so good.

Then I installed two lamps, 1 for which I installed the LIFX binding (this lamp was auto-detected), and a KASA one, for which I had to select the proper model code in the Binding, and I had to provide its IP address.

I created Items for the Color channel for both lamps, and I could change both lamps’ color.
However, looking at the available channels, it appears that the most important one is missing for both lamps: a Channel to turn the lamps on and off!
I ended up linking a 2nd Item to the Color Channel, and selecting a type ‘Switch’ for it. NOW I could switch the lamps on with that item, but it seems strange that I had to pick an unrelated channel for: that simply doesn’t sound right. Maybe I’m doing something wrong, or don’t fully understand the concept.

Here are some questions I have, hopefully some answers help me in better understanding all the underlying concepts.

a. What am I missing: why isn’t there a Channel as simple as ‘Power On/Off’ for my lamp ‘Things’?
b. Where are these Channels coming from? Are they defined by the Binding developer, or retrieved from the device itself?
c. I read up on the documentations for configuring Channels through files, so I thought maybe I can add a channel for turning the Things on and off, but the folder that should have all those files only has a readme file. Where are these Channels defined? Kept in a Database somewhere? Any way I can add channels?
d. There seems to be a lack of uniformity between channels for similar devices (say lamps); one has a Brightness channel, the other doesn’t so I have to add a link to a dimmer type item to the Color channel: aren’t there guide lines for developers of bindings (IF that’s where those channels come from)? One device lets me actually ‘Configure a channel’, the other simply has a link to ‘Channel details’. Is there a reason for not having uniform interfaces (channels) for similar devices?

a) It is more likely a misunderstanding of the concept, as it is in the docs. Brightness and Color channels accept ON/OFF commands as well.
so there is no need for different channels.
b) Binding developer
c) Not all bindings support adding channels manually. UI created Things are stored in the JSON db in userdata folder
d) Yes, this might not be consistent over all bindings, but might be due to different possibilities of the devices.

1 Like

A Color Item can accept Dimmer commands as well as Switch commands. So you can send ON/OFF to a Color Item and it will behave as a Switch. Dimmer, likewise can be commanded as a Switch too.

So if it’s a color bulb, all you need is the Color Channel to control it. You can use a toggle widget on the Color Item. You don’t need to create a separate Switch Item.

Because a Color Channel links to a Color Item which can be treated as if it were a Switch or a Dimmer. There is no need to have a separate Channel for all three.

It depends but most likely it’s the binding developer.

Everything you do through the UI gets saved to /var/lib/openhab/jsondb.

Some bindings allow the addition of Channels by design, others do not. It depends on the binding. But for something like this usually the answer is not. If there is no option to add a Channel on the Channels tab of the Thing the Binding does not support you adding your own Channels.

To some degree, but in general the developer of the add-on is the one who is the expert in the technology they are connecting to so they are given wide latitude to define things the way they want to. And what appears on the surface to be a similar device could be quite different in the technical details. So just because the two are bulbs doesn’t mean they operate and behave in a similar way when it comes to connecting to and controlling them.

There is also close to seven years of legacy carried around by some of these bindings. Many of them haven’t been significantly modified since they were first written and over time any standards there are have changed.