Java Runtime Environment: Zulu as per installation recommendation
openHAB version: 3.4
Issue of the topic:
I do have some problems with counting in groups and textual configuration. Basically I want to count all lights switched “on” in my house and indicate this in the UI card with a “Number” that tells me how many lights are switched on. As binding I do use KNX.
This works fine already fine for all lights that are setup as “Switches” . But I do also have some dimmer lights which are not counted…
The KNX GA 0/4/17 is the ON/OFF return address of the dimmer. Actually if I do run the ETS monitor and read this 0/4/17 address it shows correctly on/off depending on if turned on, but it looks like this one is perhaps not passed on to the group counting as it is a “dimmer item” ?
Here my config
The things file config of the dimmer:
Type dimmer : EG_Esszimmer_Tisch_Dimmer [ switch="0/1/17+<0/4/17", position="0/3/17+<0/5/17", increaseDecrease="0/2/17+<0/5/17" ]
I was thinking of creating a dummy switch item just with the on/off status that is not member of the corresponding room so that it does not show up but I would rather prefer to have this working as designed.
Neither increaseDecrease nor ga is needed (there is no parameter named ga for a dimmer channel anyway).
openHAB will always control the dimmer through absolut positioning (1/1/41 in your case) and will set the status to the absolute position (received at 1/1/45)
I quite like your elegant solution to use a regular expression . Also I assume the “ON” and the [1-9] are then managed both as strings, so of same type.
But I am not a regex specialist. Have checked your suggestion on regex101. The suggested:(ON|[1-9][0-9]*) passed the test but Visual Studio Code is not happy and giving me some errors…
OpenHab.log also confirms the missing 3rd EOF error but I guess this is just a follow-up error not able to manage the initial error with the “|” pipe/or char…?
Any idea how to cast this in a different way so that all “ON” and everthing between 01-100 is “counted” ?