stfn82
(Stefan)
December 12, 2021, 11:00am
1
The following code in my sitemap:
Switch item=Beamer_Reachable mappings=[ON="Bereikbaar", OFF="Onbereikbaar", NULL="Onbereikbaar"]
gives me this output:
Is it possible to combine the OFF
and NULL
in 1 mapping, so I only see 1 button with ONBEREIKBAAR
instead of 2?
I was thinking of using the visibility
parameter but that would result in a lot of lines with code. I’m hoping for a more simplistic option.
OH 3.2M5
rossko57
(Rossko57)
December 12, 2021, 11:05am
2
I’m afraid sitemaps are simplistic.
It’s only two lines
Switch item=Beamer_Reachable mappings=[ON="Bereikbaar", OFF="Onbereikbaar"] visibility=[Beamer_Reachable != NULL]
Switch item=Beamer_Reachable mappings=[ON="Bereikbaar", NULL="Onbereikbaar"] visibility=[Beamer_Reachable == NULL]
You may need to think about UNDEF state too.
My personal preference would be just the on/off buttons, leaving neither highlighted if there is a NULL or UNDEF state, so there’s a visual indication its offline or whatever.
1 Like
stfn82
(Stefan)
December 12, 2021, 11:09am
3
Thanks again for your insights. I will leave it as it is for now, which corresponds with your personal preference.
BTW those 2 lines grow to 60+ lines, I have 30+ devices
O well, another reason to ditch the sitemaps and unleash the full power of OH3. I just need some time.