The online Channel is a sensor value. It makes no sense to sendCommand ON to an Item linked to this Channel. The Contact channel was created to represent binary sensors like this. I expect online Channel would allow linking to Contact type Items, if not only support Contact Items. Switch Items should be reserved for actuators.
Current Behavior
The online channel only supports linking to Switch type Items.
Possible Solution
To avoid too much disruption, add another Channel that supports linking to Contacts, or modify the Channel so it supports both (possible?). Ideally only Contact should be supported but it has been two years like this and the breaking changes could cause a lot of disruption.
Steps to Reproduce (for bugs)
Not Applicable
Context
Personally, it requires extra work to display and use these sensors values as read only on sitemap and HABPanel.
I've also had to spend time on the forums to deal with people who do not understand why noting happens when they sendCommand to an online Channel linked Item. Sending a command to this Channel should be an error (which would be the case if we used Contact).
It also makes it difficult to combine sensors from multiple bindings into a single Group as some binding authors use Switch and others use Contact. Thus if I have other bindings that report online status that require Contacts I can't use Group:Contact:OR(OFF, ON) to see if one is offline and instead have to write a Rule.
Your Environment
Version used: (e.g., openhab and addon versions): OH 2.4 SNAPSHOT #1380
Environment name and version (e.g. Chrome 39, node.js 5.4, Java 8, ...): Official openHAB Docker
Operating System and version (desktop or mobile, Windows 10, Raspbian Jessie, ...): Ubuntu 18.04 Server
Expected Behavior
The online Channel is a sensor value. It makes no sense to sendCommand ON to an Item linked to this Channel. The Contact channel was created to represent binary sensors like this. I expect online Channel would allow linking to Contact type Items, if not only support Contact Items. Switch Items should be reserved for actuators.
Current Behavior
The online channel only supports linking to Switch type Items.
Possible Solution
To avoid too much disruption, add another Channel that supports linking to Contacts, or modify the Channel so it supports both (possible?). Ideally only Contact should be supported but it has been two years like this and the breaking changes could cause a lot of disruption.
Steps to Reproduce (for bugs)
Not Applicable
Context
Personally, it requires extra work to display and use these sensors values as read only on sitemap and HABPanel.
I've also had to spend time on the forums to deal with people who do not understand why noting happens when they sendCommand to an online Channel linked Item. Sending a command to this Channel should be an error (which would be the case if we used Contact).
It also makes it difficult to combine sensors from multiple bindings into a single Group as some binding authors use Switch and others use Contact. Thus if I have other bindings that report online status that require Contacts I can't use Group:Contact:OR(OFF, ON) to see if one is offline and instead have to write a Rule.
Your Environment