OH3: How to create push buttons for sitemaps (basicUI)?

Hi,
I’m a bit confused now…is there a possibility to create a push button in OH3?
And if so, how could I achieve this on an already created switch item?

Thank you,
Boby

Hi @Boby,
you have to define the default standalone and list widget in the metadata section of the item.
There you have some options to define Actions behind labels.

2 Likes

Thank you, but that’s not really the same.
I want to create push buttons for sitemaps which do work in the app as well.

For instance, the action on my HarmonyHub was defined this way:

Switch item=HarmonyHubWZ label="Aktion []" mappings=[PowerOff="Aus","Fernsehen"="SAT/TV","Apple TV"="Apple TV","DVD"="DVD", "RADIO"="Radio"]

This gave me five different push buttons in the sitemap and when I clicked one, the switch returned the value on the left side from the “=”. But this doesn’t seem to be possible anymore?

Oh of course, this works with e.g. a label card widget and the action type “command options”!

But it doesn’t work in basicUI (which is currently the one and only frontend available in the app)

In the Basic ui = sitemap there is no difference to oh2.5
Use your switch items with your mappings mentioned above.

Unfortunately, this doesn’t work anymore. I opened a github issue:

And it seems I’m not the only one:

I have to correct myself: It works; I was just using the wrong (non-existant) item in the sitemap. Sorry.

Thanks for the idea how to realise a push button.
As a beginner i had some trouble to implement the item. So here is the code for the list item i use to control my sunblind. I don’t need the label card because the sunblind is part of an equipment in my model.
Hope it helps if there is someone in the same situation as i was :wink:

value: oh-list-item
config:
  badgeColor: green
  actionCommand: ON
  badge: Öffnen
  actionCommandAlt: ON
  actionItem: sunblind_opening
  icon: f7:rectangle_split_3x1_fill
  iconColor: blue
  action: toggle

Here is how it looks like