RealTime value of the rollershutter state

Hi,

I’m using the FGR222 Roller Shutter 2 to control the blinds.
Which is all working. No problems.
But, I have an issue with reading the actual “state” if the blinds are moving. I’m problably doing something wrong.

I’m sending a command with values for (0, 25, 50, 75, 100) to set the blinds in the corresponding position.
However, I would like to read the value of the current position WHILE it is moving.
This way, I can map this value against an icon, which I use in HabPanel to show the postion of the blinds…
This creates a “interactive” display of icons when lowering or pulling up the blinds.

But, I can’t seem to get the actual value from the thing, cause it seems to report the value of the thing at start and is only updated when it’s done.

Here’s the rules:

var Timer tBlind = null
rule "update Icon Value"

when 
    Item FF_Blinds_TobiasShutterPosition received command
then
    if(tBlind === null){
        logInfo("rules.blinds","tBlind is NULL")
        logInfo("rules.blinds", "Initial state: " + ZWaveNode006FGR222RollerShutter2_BlindsControl.state as Number) 
        logInfo("rules.blinds", "Shutter position: " + FF_Blinds_TobiasShutterPosition.state as Number) 
        logInfo("rules.blinds", "Received command: " + receivedCommand as Number)
        tBlind = createTimer(now.plusMillis(100), [|
            var Number nDim = 0
            var Number counter = receivedCommand as Number
            var Number current = ZWaveNode006FGR222RollerShutter2_BlindsControl.state as Number
            logInfo("rules.blinds", "Initial state2: " + ZWaveNode006FGR222RollerShutter2_BlindsControl.state as Number) 
            logInfo("rules.blinds", "Shutter position2: " + FF_Blinds_TobiasShutterPosition.state as Number) 
            logInfo("rules.blinds", "Received command2: " + receivedCommand as Number)
            if( current != counter){  
                logInfo("rules.blinds", "loop Received Command: " + receivedCommand)  
                logInfo("rules.blinds", "loop current shutter position: " + FF_Blinds_TobiasShutterPosition.state as Number)
                logInfo("rules.blinds", "loop current state as Number FF_Blinds_Tobias: " + ZWaveNode006FGR222RollerShutter2_BlindsControl.state as Number)
                nDim = 200
            }
            if(nDim > 0 ){
                tBlind.reschedule(now.plusMillis(nDim))
            }
            else 
            {
                logDebug("rules.blinds","delete timer.")
                tBlind = null
            }
        ])
    }
    
end

*A bit of a mess at, but I wanted to see all the different values in the different parts of the rule. *
I’m using two items…for two channels of the thing to see if there is any difference…

No, the problem is that the “state” of the blindsControl is not updated during the move of the blinds. So I can’t do anything with that value since it stays the same, until it reached the SET value…

logfile:

2019-11-17 17:55:18.057 [INFO ] [.smarthome.model.script.rules.blinds] - Initial state2: 4
2019-11-17 17:55:18.058 [INFO ] [.smarthome.model.script.rules.blinds] - Shutter position2: 77
2019-11-17 17:55:18.058 [INFO ] [.smarthome.model.script.rules.blinds] - Received command2: 77
2019-11-17 17:55:18.059 [INFO ] [.smarthome.model.script.rules.blinds] - loop Received Command: 77
2019-11-17 17:55:18.059 [INFO ] [.smarthome.model.script.rules.blinds] - loop current shutter position: 77
2019-11-17 17:55:18.060 [INFO ] [.smarthome.model.script.rules.blinds] - loop current state as Number FF_Blinds_Tobias: 4
2019-11-17 17:55:18.261 [INFO ] [.smarthome.model.script.rules.blinds] - Initial state2: 4
2019-11-17 17:55:18.262 [INFO ] [.smarthome.model.script.rules.blinds] - Shutter position2: 77
2019-11-17 17:55:18.262 [INFO ] [.smarthome.model.script.rules.blinds] - Received command2: 77
2019-11-17 17:55:18.263 [INFO ] [.smarthome.model.script.rules.blinds] - loop Received Command: 77
2019-11-17 17:55:18.263 [INFO ] [.smarthome.model.script.rules.blinds] - loop current shutter position: 77
2019-11-17 17:55:18.264 [INFO ] [.smarthome.model.script.rules.blinds] - loop current state as Number FF_Blinds_Tobias: 4
2019-11-17 17:55:18.465 [INFO ] [.smarthome.model.script.rules.blinds] - Initial state2: 4
2019-11-17 17:55:18.466 [INFO ] [.smarthome.model.script.rules.blinds] - Shutter position2: 77
2019-11-17 17:55:18.466 [INFO ] [.smarthome.model.script.rules.blinds] - Received command2: 77
2019-11-17 17:55:18.467 [INFO ] [.smarthome.model.script.rules.blinds] - loop Received Command: 77
2019-11-17 17:55:18.468 [INFO ] [.smarthome.model.script.rules.blinds] - loop current shutter position: 77
2019-11-17 17:55:18.468 [INFO ] [.smarthome.model.script.rules.blinds] - loop current state as Number FF_Blinds_Tobias: 4
2019-11-17 17:55:18.671 [INFO ] [.smarthome.model.script.rules.blinds] - Initial state2: 4
2019-11-17 17:55:18.672 [INFO ] [.smarthome.model.script.rules.blinds] - Shutter position2: 77
2019-11-17 17:55:18.672 [INFO ] [.smarthome.model.script.rules.blinds] - Received command2: 77
2019-11-17 17:55:18.673 [INFO ] [.smarthome.model.script.rules.blinds] - loop Received Command: 77
2019-11-17 17:55:18.673 [INFO ] [.smarthome.model.script.rules.blinds] - loop current shutter position: 77
2019-11-17 17:55:18.674 [INFO ] [.smarthome.model.script.rules.blinds] - loop current state as Number FF_Blinds_Tobias: 4
2019-11-17 17:55:18.877 [INFO ] [.smarthome.model.script.rules.blinds] - Initial state2: 77
2019-11-17 17:55:18.877 [INFO ] [.smarthome.model.script.rules.blinds] - Shutter position2: 77
2019-11-17 17:55:18.878 [INFO ] [.smarthome.model.script.rules.blinds] - Received command2: 77
2019-11-17 17:55:18.878 [DEBUG] [.smarthome.model.script.rules.blinds] - delete timer.

Is there anyway to read the ACTUAL state during the move of the blinds?
So e.g. we start at ‘0’ and it is set to ‘50’ that I can read the state of 0,1,2,3,4,5,6 etc etc untill 50?

/Jasper

What you really want is that device to report position changes at each step or 5% or each second while moving, or somesuch.
That’s not really good use of the zwave mesh; I’ve no idea if the FGR222 allows you to do that.

You might be able to construct a rule that polls the position with REFRESH each second, until motion ceases.

Hi @rossko57,
I understand what you are saying. No need for reporting this. But I assume it’s possible to get the information. I mean, in the classic UI the icons also change during movement…so that information needs to be there in “realtime”.
That’s exactly what I’m looking for. Is there a way to “force” the refresh when polling? Cause that’s basically what I’m doing…if I’m correct in the rule. I’m asking for the state until the Set and Current are equal…

thanks!

The binding is capable of honouring REFRESH commands. Whether or not they do anything useful is down to fine detail of the binding<->device configuration.

Try it out.

rule "test refresh"
when
   Item myTestButton changed
then
   myPositionItem.sendCommand(RefreshType.REFRESH)
     // that's a workaround if you are still on stable OH)
end
rule "test response"
when
   Item myPositionItem received update
then
   logInfo("test", "Update to value " + myPositionItem.state.toString)
      // will of course log routine updates as well as possible REFRESSH responses
end

Thank you, I’ll do some testing with it…