LG TV Binding

I use the LG TV Binding v1 addon in my smart home (https://www.openhab.org/addons/bindings/lgtv1/)
I configured the sitemap by adding Selection
Selection label = “[% s]” item = Flat_LivingRoom_LGTV_GetApps icon = “none”
But I can’t figure out how to display the contents of the GET_APPS constant in the Selection element.
As far as I understand, GET_APPS allows you to get a list of applications installed on the TV. I want to get them and run them through Selection.
If anyone has come across a similar one, please give a small explanation of how I can resolve the issue.
Thank you very much in advance.

It looks like you are misunderstanding the Selection sitemap element. The item in this case is not a list that provides the possible values, it is the item that will receive the one value that is selected when the element is used.

In order to provide the list of options in the Selection element, you have to use the “mappings” parameter. Unfortunately, sitemaps are fairly static with only a few dynamic options related to element visibility, icons, and a few other cosmetic things. Mappings is a static parameter and not something that a sitemap can dynamically change, so I’m not sure you’re ever going to get the behavior you are looking for here. See the Selection example and the discussion of mappings in the docs:

habPanel probably offers you an UI experience closer to what you are looking for, but I suspect you will have to create the channel selection widget yourself.

Yes, I thought that you can display the data array obtained in Flat_LivingRoom_LGTV_GetApps in the Selection element

Is there an implementation of this function in BasicUI?

Not to my knowledge. You would need to have a system that automatically updates the actual text of the sitemap file when the list of tv apps changes.

1 Like

I got it, thank you for the clarification

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.