Hi,
I have rollershutter and window actuator connected to KLF200
Question is, where I can see that window is moving ?
In the bridge status I can see all the time : GW_S_GWM/GW_SS_IDLE
Status is changing only when rollershutter is moving.
What do you mean? If you have (say) a Dimmer Item linked to the position channel of your window Thing then the state of that Item will change as the window is moving.
However note that the Velux Bridge Thing has a standard polling interval of 10 seconds, so position changes may only be updated at that interval. (However when the the position is commanded from OH then AFAIR the position state is updated more frequently).
Two questions:
Why are you looking at the Bridge when you want information about a window?
What made you think that GW_S_GWM/GW_SS_IDLE (or whatever) would have anything to do with the window position?
Ah. Not to be impolite, I think it is a case for “RTFM” =>
Rollershutter is an OH Item type that is used for controlling Thing Channels with UP/DOWN/STOP commands or Percentage Position commands. (It says exactly that on your screen shot).
In your screen shot for the “Window Position” channel if you press the blue down arrow button you will see such a Rollershutter Item linked to that channel. And its display will indicate the respective window percentage position. See example below…
it’s clear, but when I want open a window to 50%, I will send to this item value “50”.
But I don’t know if this position was already reached, because item value is still 50 and status is still the same (see my edit in previous post).
The default behaviour of OH is that when you send a command to an Item, its state is immediately “auto-updated” to the new commanded value (even though the device has not yet reached that value); and when on the next polling cycle (maybe 10 seconds later) the actual position is fetched from the device the Item will be updated with that value.
EDIT: you can override the “autoupdate” of the Item by setting its respective parameter…
so If I good understand, I can somehow set, that I will send to the item a value (for example 50), but item value will remain with default (start) value till new position is reached ?
No, you can‘t.
You need to trigger a rule which sends the command to your item and sends a „moving“ string to a second item which is then displayed in your widget.
Then it becomes complicated, when to set the second item to „not moving“ (or empty)?. Maybe your binding sends an item updateCommand? Otherwise you need to create a timer to read the first item until its state equals to the command value.
I can add even more complexity: If a rollershutter goes down and you stop the movement and move it in the opposite direction. This is also what you need to handle in this rule.
To be honest, I wouldn‘t do that and haven‘t heard of any ody yet, who has done it in that way.
Or you start this kind of project once you got more used to openhab.
OK, so maybe like this :
In the widget is button pressed. This action will set my custom item string (let say name is : rollershutter1) to the value which was pressed (let say : 50)
In the rule1 I will check if the value of the item rollershutter1 is changed. If yes, I will send a command to the rollershutter position item with the value in the rollershutter1 - so rollershutter will start a movement and into my second custom string item (let say rs_status) rule will send “MOVEMENT”
And in the rule2 I will check if the rollershutter position item will change a value (so we are on the final position) and rs_status is “MOVEMENT”. If yes, I will change a rs_status to “IDLE”.
To have complete information about rollershutter and window actuator - Means, I want to know if it’s moving to the new position or if it’s staying in any position…
To be very clear, with this binding, (and probably most other bindings), there is no way to read if the actuator is actually physically moving. That datum is simply not exported by the API. The only datum that is exported is the actual physical position of the actuator.
Personally I would simply assume that if you send a command to the actuator then it will indeed actually move to that position. (Why would it not move to that position?) In fact the only occasion when it would not move is when it is powered off or broken.
However if notwithstanding the above you really want an ‘is moving’ indication then you would need to create a model in OH with say the following inputs: the commanded value, the actual value, and the runtime of the actuator. Then during the proportion of the runtime that corresponds to the commanded position delta, you can say it is “moving”; and after that time has elapsed, and depending on whether there is a remaining position delta then you can say that the movement succeeded or failed.
EDIT: but just a warning, to repeat what I said in other words, if you would try to implement such a model (or the one suggested by @Oliver2 above), you are not creating any real actual physical knowledge about the state of motor; it is just a simulated guess; the only real actual physical knowledge is what you get back from the binding via the KLF API; personally I would forget about any simulated guesses and just stick to the facts. (… notwithstanding the current fashion to disregard facts …)
Clear is, that there is no way to read if the actuator is actually moving.
But yes, when command is sent, I’m calculating, that actuator is moving.
It’s good idea to compare two values. One is actual position (it must be not forced item) and one is requested position (value is set by button).
If they are the same, I can write information “In position” and if they are different, I can write “Moving”.
edit: I have also implemented a button, connected to the inputs of the KLF200 and information about using of this button I’m not able read. (only bridge status will change and only for rollershutter)