A dynamic standalone widget that shows only those services that are offline. The widget assumes that all the Items indicating status are Switch Items or String Items where “OL” indicates online (support for the NUT binding’s online status for an UPS).
The configuration assumes a single Switch Item that is the roll-up of all service status Items. For example a Group:Switch:OR(OFF,ON) which will be OFF if one or more of that Group’s members are OFF. Other options are supported as well, such as a Switch populated via a rule. This controls the header text.
The second parameter is a comma separated list of Item tags that indicate that an Item represents a service status. The Item must have all the listed tags to be included. Semantic tags can be used (e.g. Status,Power) or you can define your own custom tag(s).
uid: rlk_all_services
tags:
- card
- marketplace:128041
- services
props:
parameters:
- context: item
description: All Services Status Item, ON means all services are online
label: Rollup status
name: rollup
required: true
type: TEXT
- context: tag
description: Comma separated list of Item tags that indicate a service status
label: Service Item Tags
name: tags
required: true
type: TEXT
- defaultValue: All Services Online
description: Title when all services are online
label: Online Title
name: online_title
required: false
type: TEXT
- defaultValue: Offline Services
description: Title when one or more services are offline
label: Offline Title
name: offline_title
required: false
type: TEXT
parameterGroups: []
timestamp: Nov 28, 2022, 8:04:48 AM
component: f7-card
config:
title: '=(items[props.rollup].state == "ON") ? props.online_title : props.offline_title'
slots:
default:
- component: oh-list
slots:
default:
- component: oh-repeater
config:
filter: items[loop.item.name].state != "ON" && items[loop.item.name].state != "OL"
for: item
fragment: true
itemTags: =props.tags
sourceType: itemsWithTags
slots:
default:
- component: oh-list-item
config:
badge: OFFLINE
badgeColor: red
icon: f7:wifi_slash
iconColor: red
item: =loop.item.name
title: =loop.item.label
It seems your Widget is what I like, but I dont get it working.
I have network Items (switch status ON/OFF) called “Paul” “Erwin” and some other, all are in a Group “Online”. (Host “Erwin” is currently offline )
In an old Sitemap the Group “Online” is Off and if I open the group one Host is Offline as expected
In your Widget I added the groupItem “Online”, you wrote:
“The second parameter is a comma separated list of Item tags that indicate that an Item represents a service status.”
But where do I have to place the Items? Or what are “Item tags” ?
The Group which is used to determine if all are online or one or more is offline. This manages the title of the widget (“All Services Online” when ON and “Offline Services” when OFF
Tags which are used to identify those Items that are to be shown when they are not ONLINE
You need to add a list of Item tags to tell the widget which Items are relevant and should be shown when they are OFF.
Nowhere. You probably want them to be a member of the Group but that’s not necessary.
I never used the Tags before, still migrating from an old 2.x instance.
I tried to configure it in the repeater component but I had to put my Group-Name “Online” at “Rollup status” and the Tag “ServiceChek” behind “Service Item Tags”
@rlkoshak the addon got broken now: Perhaps you should have used defaultValue, not default?
Unable to parse YAML: Unrecognized field "default" (class <SNIP>ConfigDescriptionParameterDTO), not marked as ignorable (22 known properties: <SNIP>, "defaultValue", <SNIP>])
2022-11-28 18:28:38.494 [ERROR] [munity.CommunityUIWidgetAddonHandler] [org.openhab.core.addon.marketplace] - Unable to parse YAML: Unrecognized field "default" (class org.openhab.core.config.core.dto.ConfigDescriptionParameterDTO), not marked as ignorable (22 known properties: "readOnly", "max", "limitToOptions", "groupName", "name", "stepsize", "context", "defaultValue", "min", "label", "filterCriteria", "verify", "type", "description", "options", "required", "advanced", "unit", "multipleLimit", "pattern", "multiple", "unitLabel"])
at [Source: (StringReader); line: 20, column: 35] (through reference chain: org.openhab.core.ui.components.RootUIComponent["props"]->org.openhab.core.config.core.dto.ConfigDescriptionDTO["parameters"]->java.util.ArrayList[2]->org.openhab.core.config.core.dto.ConfigDescriptionParameterDTO["default"])
2022-11-28 18:28:38.495 [ERROR] [munity.CommunityUIWidgetAddonHandler] [org.openhab.core.addon.marketplace] - Widget from marketplace is invalid: Unable to parse YAML
data: {"topic":"openhab/addons/marketplace:128041/failed","payload":"[\"marketplace:128041\",\"Widget is not valid.\"]","type":"AddonEvent"}