OH3 Pages with "mappings" like sitemap?

Hi There

I am trying to replicate what I created in OH 2.5 for my Alarm system (using sitemaps). I am using OH3 now and want to use Pages.

I am however stuck on this one:

In my sitemap version I used mappings as follows for my DISARM, STAY and EXIT buttons:

        Switch item=Partition3_Disarm   mappings=[ON="DISARM"]  label="Partition 3 Disarm"
        Switch item=Partition3_Stay     mappings=[ON="STAY"]    label="Partition 3 STAY"
        Switch item=Partition3_Exit     mappings=[ON="EXIT"]    label="Partition 3 Exit"

However I cannot work out how to achieve this with OH 3 and Pages.

I have tried adding “State Description” Meta Data, but still only get the following:

OH3 Pages

The YAML code for the list items is:

component: oh-toggle-item
config:
  item: Partition3_Disarm
  title: Partition 3 DISARM
  icon: oh:house
  iconUseState: true

Any ideas on how to achieve this?
Thanks
Mark

Should be in the items state descriptions meta data and then in the options field.
At least that works for me (i.e. 1=Home, 2=Away), each option on one line.

Hi Chris

Thansk for the reply. Tried:

value: " "
config:
  options: 1=DISARM,ON=DISARM

Still get the same (just a switch and not a “Push Button”

Starting to think that maybe this requires a Widget - Though strange that there would not be a default for this since there are options for RollerShutter, Play etc?

Cheers
Mark

I got the following setup for my home status:

On a page:

component: oh-label-card
config:
action: options
actionItem: homestatus
item: homestatus
icon: oh:presence
iconSize: 64

The item is a simple number item with the following state description:

value: " "
config:
options: 0=AWAY,1=HOME,2=WAKE,3=SLEEP

If i then click the page card I get a list of my above item states to choose from (not seperaten Buttons though).

1 Like

This looks related

EDIT - fixed link

I think I have found a workable solution now:

component: oh-list-card
config: {}
slots:
  default:
    - component: oh-list-item
      config:
        action: command
        actionCommand: ON
        actionItem: Partition3_Disarm
        title: DISARM
        listButton: true

Gives me a clickable link that does what the sitemap version did. Will have to work on alignment etc. though:
OH3 Disarm

Thanks again.

Thanks - but the link doesn’t work for me:

Oops! That page doesn’t exist or is private.

Cheers

EDIT - Fixed.

Hmmm…but why do I have still to fiddle around with some custom written code in OH3? Something like this should be possible directly from the GUI IMHO