Command <ON or OFF> not supported for channel: online

Hi There,

I am running openhab 2.2.0-SNAPSHOT Build 1094, manual install

The network binding is giving me a DEBUG info:

2018-01-25 14:43:23.450 [DEBUG] [] - Command OFF is not supported for channel: online
2018-01-25 14:59:08.186 [DEBUG] [] - Command ON is not supported for channel: online

Item definition:

Switch sensor1_phone (gPresent) {channel="network:pingdevice:phone:online"}

This happens whether I send the command through the sitemap or console.

Any idea why this is being shown?

I’m pretty sure this channel is read only. You’re not allowed to send a command at all.

The channel should give you the status for a device on the network, either connected or not. You cannot send a command to it, because you cannot control via openHAB whether that device is on the network or not. If you explain what you are trying to achieve, we may help you accomplish that if possible.

Changing the item via a switch in the sitemap causes a command to be sent to the item (just standard openhab behavior). I was changing the state manually for rule testing purposes and noticed the debug message. Perhaps I should have a helper item which is updated via a rule from the pingdevice:online item instead.

The point is, though you can use a switch widget in your sitemap, this is wrong, as the channel, the item is bound to, is read only. So it’s normal to get a debug message.
instead of

Switch item=sensor1_phone label="some label"

just use

Text item=sensor1_phone label="some label [%s]"

and get rid of a switch which is no switch :wink:

I assume you want me to change the switch to string in the items file. If that is the case, the documentation needs updated:

The docs show the item defined as a switch.

Switch MyDevice { channel="network:pingdevice:devicename:online" }

Evidently it should be defined as string and the switch should be in the sitemap?

Edit: evidently I need the helper item, and I should never issue commands to the actual online channel item.

The Item and not the Channel accepts ON/OFF … but here Read Only … Write to a Ping Item makes no Sense…

No, I don’t.
I want you only to change the Switch Widget to a Text Widget.

Please, don’t mix up Widgets and Items. While the former are views of items in the sitemap, the latter is the store of a value.

Except the correct use of the sitemap element (text)…
You could also try to use a Contact type of Item for the online channel. I am not sure if the network binding allows this.
This is what we do over at the Unifi world for the online channel :slight_smile:

Though it could be very handy if one uses " (very) long" ping intervals on things and an explicit write then immediately retries the ping via the channel.
If this ping fails, one has an immediate result back without the need to wait for a scanloop.