[SOLVED] Group of status' (text) - rule not firing

I’ve got a group for my UPS status from NUT.
I currently have two real UPS and one test one that cycles from OL, OB and OL CHAR (online, on battery and only charge).

My rule sames on g_ups_status change (I tried received update with no difference), read through the group and let me know about about device not OL.

For some reason that rule is not firing. The only time I can get it firing, is to change from teh group received update to the test device since that cycles frequently.

I’m comfortable with the rule function as that’s doing what it should when I fire it with the test device.

If the fact the status is a string rather than a bool/int value the possible cause?

For arguments sake, here’ s the rule:

rule "UPS Check Rule"
when
          Item g_ups_status received update
          //Item g_ups_status changed
          //or Item apcdummy_Status received update

then
        logInfo("UPSCheckRule","Received Status update Command")
end

BTW the group is displaying properly in my site map (which shows me it has stuff in it).
Here are the items

Group g_ups "UPS" <energy>
Group g_ups_status "UPS Status Values" <energy> (g_ups)

Group g_apc1000 "APC 1000" <energy> (g_ups)
String apc1000_Status "UPS status [%s]" (g_apc1000,g_ups_status) {networkupstools="apc1000:ups.status"}

Group g_apc600 "APC 600" <energy> (g_ups)
String apc600_Status "UPS status [%s]" (g_apc600,g_ups_status) {networkupstools="apc600:ups.status"}

Group g_apcdummy "APC Dummy" <energy> (g_ups)
String apcdummy_Status "UPS status [%s]" (g_apcdummy,g_ups_status) {networkupstools="dummy:ups.status"}

I keep expecting to see in the events log the g_ups_status changed through item apcdummy_status

Groups get a state from an aggregation function like SUM or AND. That makes sense for numbers or binary ON/OFF group members, but not for a group of String types.
So there’s no trigger as your group has no type nor aggregation function, but there is no sensible option for you anyway.

You might be able to do what you want using Member of triggers, which can trigger a rule when one member of a group e.g. updates

Thanks for that. The member of worked for me.

Please publish your latest code and mark the thread as solved. Thanks

Full rule:

rule "UPS Check Rule"
when
          Member of  g_ups_status received update

then
        logInfo("UPSCheckRule","Received Status update Command")
        var message = "abc"
        if (! g_ups_status.allMembers.filter([state !=  'OL']).empty)
                {
                logInfo("UPSCheckRule","Found some item(s) not online")
                val report = g_ups_status.allMembers.map[
                    name + ": " + state
                ].join("\n")

                        message = "UPS status:\n" + report
                        logInfo("UPSCheckRule","Report produced: " + message)

                        val StringBuilder report2 = new StringBuilder(64)
                        g_ups_status.allMembers.forEach[g |
                                logInfo("UPSCheckRule","Item " + g.name + " state: " + g.state)
                                var currentState = g.state
                                logInfo("UPSCheckRule","Item " + g.name + " state: " + currentState)
                                if (currentState != 'OL')
                                {
                                        report2.append("Item " + g.name + " state: " + g.state + "\n")
                                        logInfo("UPSCheckRule","Not Online")
                                }

                        ]
                message = "Status:\n" + report2.toString()
                        Notify_Info.postUpdate(message)
        } else
                        logInfo("UPSCheckRule",String::format("No UPS not online"))
end

Basically it’s posts a message to a string item that’s tied to a mqttwarn queue, for when any of my UPS are reporting anything other than OL (online).