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:
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.