MQTT reading Mosquitto broker status

This is not working. Is there a need for escape character? Using OpenHab 1.7.

{ mqtt="<[ohab:$SYS/broker/clients/active:state:REGEX((.*))]" }

This item should read the number of active clients but is not reading anything (reamins Uninitialized). Testing with other MQTT client and it works fine.

You might need to escape the ‘$’ but I also notice in the Mosquitto man pages that $SYS/broker/clients/active is deprecated and they want you to use $SYS/broker/clients/connected instead.

active works for me.
My items looks like:

 { mqtt="<[broker:$SYS/broker/clients/active:state:default]" }
1 Like

:slight_smile: Works if assignet to number item. I was using String before

In my version the new path is not implemented yet :slight_smile: