Can't get TCP to work - OpenHAB 2 send String

Hello

i am new to OpenHab and I tried my best to find a solution. I created an item - a switch hat just sends a string to my TV to power on/off. I used a network sniffer but i can’t see any data on the port. With “PacketSender” everything works fine.
Here’s what i wrote into my items file:

Switch TVSW “TV Schalter” {tcp=“>[ON:192.168.178.65: 20060:‘*SCPOWR0000000000000001\n’], >[OFF:192.168.178.65: 20060:‘*SCPOWR0000000000000000\n’]”}

In the sitemaps file i wrote:

sitemap home label=“Jonas-SmartHouse”
{
Frame label=“Wohnzimmer”
{
Switch item=TVSW
}
}

I can see the switch in the Basic-UI but not in the Paper UI. Can this (old?) package only be edited and connected “the old fashioned way”?
I also added my hue and they show up and are configured quite easily in the Paper UI.

I also tried to follow this Guide but i had no success.

I don’t use the TCP & UDP Binding but it seems that you have a space after the IP and before the TCP port in your item config. If it’s not a typo during copy/paste, check if removing the space will help.

If not, try to increase the log level on the binding to see if some more interesting stuff are popping up at the openhab.log
From the openHAB console:

log:set TRACE org.openhab.binding.tcp

Correct. This binding is a compat1x binding and the items bound to it won’t show up in PaperUI automagically.
You should use flat config text files to define your items and then use a sitemap to display them.

Hi! Thanks for the fast reply!

removing the space didn’t help.

the log throws this at me:
17:47:35.607 [ERROR] [ing.tcp.AbstractSocketChannelBinding] - there is no channel that services [itemName=TV_Cmd, command=SCPOWR0000000000000001]

Do i need to add a channel? If yes, how? :slight_smile:

PS: I cant see the Item in the Paper UI even after i configured it in the items and sitemap files.

Thank you!

I have no clue :slight_smile: I checked a bit the thread that you linked in your first post and I am lost also :stuck_out_tongue:

Have you configured anything in your /etc/openhab2/services/tcp.cfg ?

Hmmm. the “manual” for the tcp udp package says normally you don’t have to touch the config …

Jonas,

If I’m reading your attempt right - you are trying to automate a Sony TV using SimpleIP? If so, you do realize there is a full binding already doing this and already support SimpleIP?

Tim