Mark_VG
(Mark)
February 2, 2021, 11:37am
#1
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:
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
chrismast
(chris)
February 2, 2021, 1:04pm
#2
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.
Mark_VG
(Mark)
February 2, 2021, 1:15pm
#3
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
chrismast
(chris)
February 2, 2021, 1:25pm
#4
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
Mark_VG
(Mark)
February 2, 2021, 1:33pm
#6
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:
Thanks again.
Mark_VG
(Mark)
February 2, 2021, 1:34pm
#7
Thanks - but the link doesn’t work for me:
Oops! That page doesn’t exist or is private.
Cheers
EDIT - Fixed.