Reading item state vs. channel state directly in a rule

Hi!
I need some help figuring something out…

I have a Fibaro Roller Shutter 2 module for controlling my blinds and I am trying to create a rule for my wall switches to move the rollers up/down if not already moving, but stop if they are already moving. And I am detecting the movement by checking the current power used by the shutter module.

This is (part) the rule that works fine:

  else if ((Zgoraj_AndrejSoba_SwitchMain_Input.state == 4)) {
    // Input for main blind down
    // Stop if already moving, else move down
    if (zwave_device_ebf2caa1_node2_sensor_power.state > 5) {
      sendCommand(Zgoraj_AndrejSoba_Rolete_Output, STOP)
    } else {
      sendCommand(Zgoraj_AndrejSoba_Rolete_Output, 77)
    }
  }
  else if ((Zgoraj_AndrejSoba_SwitchMain_Input.state == 8)) {
    // Input for main blind down
    // Stop if already moving, else move down
    if (zwave_device_ebf2caa1_node2_sensor_power.state > 5) {
      sendCommand(Zgoraj_AndrejSoba_Rolete_Output, STOP)
    } else {
      sendCommand(Zgoraj_AndrejSoba_Rolete_Output, 0)
    }
  }

But if I define my zwave_device_ebf2caa1_node2_sensor_power in items file as:

Number Zgoraj_AndrejSoba_Rolete_CurrentPower "Rolete - trenutna moč" (Zgoraj_AndrejSoba) {channel="zwave_device_ebf2caa1_node2_sensor_power"}

And then use Zgoraj_AndrejSoba_Rolete_CurrentPower instead of using zwave_device_ebf2caa1_node2_sensor_power directly it doesn’t work as expected - the blinds won’t stop moving if I press the same button again. So why does accessing a channel directly in a rule work fine, but not accessing it via an item state? What am I doing wrong?

You are not referring to a channel in your rule, zwave_device_ebf2caa1_node2_sensor_power is definitely an Item (or else it would not have a state)
From the name, I guess it is an auto created Item. You should be able to find it in PaperUI.
You should be able to see the actual channel reference there. Should take a form more like
channel=“zwave:device:ebf2caa1:node2:sensor_power”

If you’re setting up Items in a file, you may want to decide whether to keep the auto-generate-Item feature.

Oh dear. I didn’t even notice that. You are right. All of my other times are configured correctly, but apparently I manged to screw this one up and not even notice it.

I will think about the auto-item generation though.