- Platform information:
- Hardware: RPI 3B+
- OS: latest openhabian image / Linux 9 stretch
- Java Runtime Environment: which java platform is used and what version
- openHAB version: openHAB 2.4.0-1 (Release Build)
I read out several status strings from a website like “ok, warning, error” which are in one group. For this group I want to have a color indicator light, so I need to know the group status itself.
Group ServiceStatus "service status [%s]"
String ServiceStatus1 "service status 1 [%s]" (ServiceStatus) {http="<[ServiceStatus:600000:REGEX(.*?}
String ServiceStatus2 "service status 2 [%s]" (ServiceStatus) {http="<[ServiceStatus:600000:REGEX(.*?}
Group state in this case is always null.
If there would be just two states I would be able to “map” e.g. ok and error to ON/OFF to virtual switch items, group (with Group:Switch:OR(ON,OFF) m ) them and control the light according .
But with this three states I have no good and easy idea how to achieve this.
My idea is to create a rule for each group, which is triggered on every item change and then check inside the rule if either at least one item is error (then light becomes red) or warning (then set light to orange) otherwise set the light to green.
Or can I map the string state I get from the HTTP binding to a numeric value like 1=ok, 2=warning and 3=error and then it would be possible to check the group state with “Group:Number:MAX”?