How do I use members of an equipment group in a custom widget?

Hello all,

I am in the process of creating my first widget. The widget should access the members of the group gKuecheHVAC. I tried in the widget code to access the group member nKuecheSoll via props.item+“_nKuecheSoll” (The groupitem gKuecheHVAC was assigned to the parameter item). Unfortunately, this does not work for me. Does this not work in general or do you have any idea what I am doing wrong here?

The group is created as follows:

Group                       gKuecheHVAC                         "Küche Fußbodenheizung"                  <temperature>   (gKueche)           ["HVAC"]
Number                      nKuechentemperatur                  "Temperatur Küche [%.1f °C]"             <temperature>   (gKuecheHVAC)       ["Measurement", "Temperature"]          { channel="knx:device:bridge:dTastsensorKueche:Temperatur" }
Number                      nKuecheSoll                         "Soll [%.1f °C]"                         <temperature>   (gKuecheHVAC)       ["Setpoint", "Temperature"]             {channel="knx:device:bridge:dHeizaktorEG:T_Kueche_Soll"}
Number                      nKuecheStellwert                    "Stellwert Küche in % [%.1f %%]"         <temperature>   (gKuecheHVAC)       ["OpenLevel", "Valve"]                  {channel="knx:device:bridge:dHeizaktorEG:T_Kueche_Stellwert"}
Number                      nHVACMode                           "HVAC Betriebsart [%d]"                  <temperature>   (gKuecheHVAC)       ["HVAC"]                                {channel="knx:device:bridge:dHeizaktorEG:HVAC_Kueche_Status"}
Number                      nHVACState                          "HVAC Status [%d]"                       <temperature>   (gKuecheHVAC)       ["HVAC"]                                {channel="knx:device:bridge:dHeizaktorEG:HVAC_Kueche_Status"}
uid: ATest
tags: []
props:
  parameters:
    - description: Titelzeile
      label: Titel (wenn leer, dann Gerätename)
      name: titel
      required: false
      type: TEXT
    - context: item
      description: Thermostat Item
      label: Item
      name: item
      required: true
      type: TEXT
timestamp: Dec 15, 2022, 8:18:27 PM
component: f7-card
config:
slots:
  content:
    - component: oh-stepper-card
      config:
        noShadow: true
        color-theme: gray
        item: = props.item+"_nKuecheSoll"
        min: 5
        max: 30
        step: 0.5
    - component: f7-card
      config:
        title: '=(props.item) ? "State of " + props.item : "Set props to test!"'
        footer: =props.prop1
        content: =items[props.item+"_nKuecheSoll"].state

I would be grateful for any advice.

This just creates a string that equals “gKuecheHVAC_nKuecheSoll” which is not a viable name for any of your items.

There are two standard ways to do this:

  1. Create a naming scheme that is consistent enough that you can use a simple string formula to crate the name of each item. So in this case, you would want the name of your temperature item to be something like “gKuecheHVAC_Temperatur” so that you could use the formula:
props.item + "_Temperatur"
  1. The oh-repeater component has an option to iterate through all the members of a group. This will be a little different than you are doing above because then you will be inside the repeater loop and each of the returned objects is the whole item, not just the name.

Thank you very much for your help.
I was thinking in completely the wrong direction here. But now I understand how this works