Get item from group causes item not found in registry error

Hello,
i added 3 dimmer group items to another group item as follows:

In a blockly rule i now select items from the group item by its index as follows:

  1. Create a variable to store the list of items:

    (In the log i plot the items via a for loop and the output is as expected:

    )
  2. I now have a variable “index” that holds the index of the item in the list that i want to control (index is within 1 and the length of the list of items (for shure)) and i try to get the item in the following line:

And this causes the following error, saying that the requested element is not found in the item registry (never heard about that):

To make the story completely weird, if i try to set the items values via a for loop, the items can be accesed and states change as expected:

I am total lost at the moment since i cant understand whats the root cause. Even a restart of the OH service did not solve the problem. Is it required to update the item registry manually? If so, can someone please guide me doing this?

I am not an expert and I am sure one of our pros will give you a precise answer. Until then here are my thoughts:
gewaehltes_item_dimmen receives an item-object, not a name
what action do you do with this variable?

please also provide logs and code whenever possible as text in code fences

In addition, it helps us if you click on the code and paste the JS that the Blockly turns into to the forum. The button is at the bottom. Please use code fences.

```
code and logs goes here
```

@Oliver2 nailed the root problem right on the head. The error is sendCommand is expecting the name of an Item and you are passing it the whole Item Object.

What are you trying to accomplish here? HAve you tried just sending the command to the parent Group without the rule? Commands sent to a Group get passed on to all the Group’s members. I’m not sure though if the command will flow down to subGroups or not. But it’s super easy to try it out.

If it doesn’t work, Items can be members or more than one Group. You can add each light Item individually to the parent Group and then it definitely will work to just send the command to the Group. No rule required.

Without the JS code and the logs as text it’s really hard to offer much else.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.