Question concerning SamsungTV from a newbie

Hi all

:exclamation:SITUATION:
I’m a newbie in OpenHAB and have OpenHAB installed on my QNAP NAS successfully. It works and I could create a sitemap of my house with all floors and rooms and currently a few items (without things to control them yet, since I only play with the first few components until I understand the concept)

On https://docs.openhab.org/v2.1/addons/bindings/samsungtv1/readme.html I read, that I have to add the binding for a Samsung TV in services/samsungtv.cfg, but I not have the file existent. Additionally I do not have any persistent bindings in services/addons.cfg and no xyz.things file in conf/things folder (even if my PAPERUI shows a thing for the SamsungTV) but I think these components (can not use “things” and “items” since these terms are already use for other components) are stored in the internal database.

On the page it’s written, that I can modify several Samasung TV’s (we have currently 3 in different rooms [living rooom, bed room, guest room]), by modifing the “host” part in the binding string:

Host and port of the first TV to control

Livingroom.host=192.168.0.12
Livingroom.port=55000

Host and port of the second TV to control

Bedroom.host=192.168.0.13
Bedroom.port=55000

But since I not have the samsungtv.cfg I can not modify anything there.
In my PAPERUI => Configuration => Things I found a thing with several channels (Volume, Power, Mute…) and this syntax:

samsungtv:tv:###x#x#x_x#xx_#x##_x###xx###x##x##x:volume (characters in channels replaced by “x”, numbers by “#”)
samsungtv:tv:###x#x#x_x#xx
#x##_x###xx###x##x##x:power (characters in channels replaced by “x”, numbers by “#”)
samsungtv:tv:###x#x#x_x#xx
#x##_x###_xx###x##x##x:mute (characters in channels replaced by “x”, numbers by “#”)

:question:QUESTION:
How I can implement the first TV (currently named: “SamsungTV_living” and later on the 2 others) in my BASIC UI (and in my Andoid OpenHAB app) to control it ?

Hi!,
How did you install the binding?
Because the binding I can see in the PaperUI binding section does not need those configuration see here:

So if you installed the binding (version 2.4.0) from PaperUI, your TVs should be autodiscovered if supported, and you should be able to configure everything from PaperUI.

If you have already a TV in Things section it means you added it or from the Inbox (autodiscovered) or manually.

If you have the thing, you can link those channels to respective items, then you can put those items into your sitemap to be shown in BasicUI and Android app.

You used the version 1 binding, that is stated on the page you linked!

Copy from that documentation page:
There is also a binding specifically for openHAB 2 here.

@alexxio:
I installed the binding within PAPERUI => Add-ons => Bindings and clicked on INSTALl to get it installed. I have binding-samsungtv - 2.2.0 installed and the TV’s were autodiscovered successfully (just now the second TV in sleeping room).
Under Configuration => Things I have currently both TV devices visible (with different ID’s [I think these cryptic strings are the ID’s]). They were autodiscovered and I added them as thing with modified names (SamsungTV_living; SamsungTV_sleeping instead the default names to better identify them). But I do NOT have any entries in any *.things file. The conf/things folder only contains the readme.txt file.

Since I’m a newbie, I have no clue how to link the chanels to the items.
I tried to add this line in my *.items file:

Thing samsungtv:tv:livingroom [ hostName=“192.168.0.108”, port=55000, refreshInterval=1000 ]

But this generates me a syntax error within my editor (Visual Studio Code) and the complete content of all defined floors and rooms (groups and subgroups) disappears in BASIUI and Andoid app

Any example codes somewhere available ?

@opus:
On the page you mentioned, there was an example:

Thing samsungtv:tv:livingroom [ hostName="192.168.1.10", port=55000, refreshInterval=1000 ]

I modified it to the value above (answer to alexxio), but as soon as I entered it, my sytax check will mark the first colon (Doppelpunkt) between samsungtv and tv with red waves under it.
Since the documentation is not very detailed on that, maybe it’s my fault with the syntax. I understand it like this:
samsungtv (name of binding)
tv (name of device)
livingroom (location)

Since I altered the name of device and IP and have a different location name, my string should maybe look more like:

Thing samsungtv:SamsungTV_living:living [ hostName="192.168.0.108", port=55000, refreshInterval=1000 ]

But this will not be accepted too. :frowning:

I think you are missing some Openhab basics.

In Openhab there is more than a way to configure your system, If you do everything with PaperUI you don’t need to create any text file. Everything is done in the UI and gets stored in the internal OH database (jsondb).

I would suggest sticking to the UI and leave the textual configuration to a time when you are more experienced if you would have the need.

At First Go to “Configuration -> System” via the menu on the left. Here you can find the basic system properties of your openHAB installation. Scroll down to “Item linking”, turn off the “Simple Mode” slider and click the “SAVE” .

Now you can go in the things section, enter the tv definition and click on a channel to link it to an item (it can be created in the linking process). And that’s it, the item is created an linked to the channel.

Please read this to get to know the process:

That should be in the “Things” file not “Items” file.

1 Like

Hello again,
first I want send all the best happy new year greetings to the whole OpenHAB community.

After completing lots of other things that not allowed me to spend some time with OpenHAB, I found now a few calm moments and reconfigured the Samsung TV in OH2. I achieved to mute the TV and raise/lower the volume as well as switching off. But switching on is not possible :frowning:

Another “issue” I have is that after each power off (by OH or by the Samsung remote control) the TV asks me to allow remote connectinon by OpenHAB which I always answer with “accept”. Is there a way to make this option persistent ? Maybe this could be the reason why the TV could not be powered-on ?

@Alessio: my simple mode setting was already configured to “off”. But I would prefer to have it done with the configuration files to better learn how it works as well as check the entries and settings. My OH2 project is currently only for playing around and not for “productive” use, so no tragedy if it’s not working for a while due to a misconfiguration. Anyway the *.sitemap, *.items and some *.cfg files have to be maintained manually anyway. Are the settings copied into the configuration files when I alternate the settings in “item linking” ? Or will all be lost ? Are there somewhere any example files how the entries should look ? Because when I all write all configurations to the internal OH DB, and can not check what ist written in there, I have no chance to learn how to make it correctly.

Cheers

Check and see if WOL binding will work for ON as it works for some others like LG.

Thanks a lot for the WOL binding hint. That works !

Please click the square box on the post with solution to mark topic as solved.
Thanks

I would open another topic related to group management for this question.

Answer edited, marked as solved and I will open the question in “Setup, Configuration and USE” - “Items & Sitemaps”.