One Item with two channels

Hi I found some ealier quistion on this, but it is possible to create on item with two channels like this:

Number CubeAngelRotationAngel "CubeAngelRotationAngel" { Channel="mihome:sensor_cube:158d0001135c14:rotationAngle", Channel="mihome:sensor_cube:158d0001108110:rotationAngle" }

I think it also could be implemented with a Group:OR or a rule, and I dont’ know which is better.

It depends on what you hope to get out of this Item.

On the surface, neither the two channel approach nor the Group:OR makes much sense to me.

What do want the CubeAndleRotationAngle Item to represent? The average of the two readings? The sum of the readings? The biggest of the two readings?

As written, your current Item will be whatever the most recent sensor_cube to report its angle happened to send. The Group:OR would simply not work at all.

I used to have one xiaomi cube that I use to control light and volume, amongst other, in my apartment. I set it in different mode and turn to cube to change e.g. the sound volume.
I have about 5 different modes that are set in a quit simple way (via an event)
It worked great, so I bought a second cube do the same, so I didn’t need to bring the cube with me.
I have 5 rules bound to the cube, and I need them to do exactly the same.

So I figured if could link the two channels from the two cube to one item, I would have an easy maintainable system.I would of cause have to added some extra code for the events.

I would like the most recent cube to set the state of the item, but I only seems to set it from the first channel.
Maybe I should recheck if everything is correctly set.

Based on your description, what you are trying to do is probably not the best way to go. The underlying assumption with an Item is that it represents one control point or sensor reading from one device. There are a ton of edge cases that I doubt anyone has thought about that would have to be dealt with to handle this.

A better approach would be to use either Groups or Proxy Items.

1 Like