ioBroker / ioBroker.vis-hqwidgets

High Quality Widgets for ioBroker.vis
MIT License
18 stars 11 forks source link

shutter: added up/down and stop support #12

Closed Garfonso closed 5 years ago

Garfonso commented 5 years ago

Use case: My blinds (merten controller connected via KNX) can be controlled by setting position between 0 and 100. But this is done by the controller using a time estimation for a complete up/down cycle and is quite brittle (especially if the controller does not know where the blinds actually are after a reset). Additionally I have a state for up/down movement that I can use. Setting this state to true will cause the blind to close and setting it to false will cause the blind open (ie. go up). Also there is a state for stop, setting it to true will stop any blind movement.

I thought it would be nice (and also easy) to add those oids to the current shutter widget so that the big buttons for up/down in the popup do not send min/max but set the up/down oids. The stop functionality is a bit more complicated and probably needs a bit more work.

So here is what I did: Added oids for up/down (true/false) and stop (true = stop). Send on these oids, if present, when user clicks on "big button". Second click on "same" button will send "stop". To enable this, a variable "stopMode" is set when sending up/down. "stopMode" should get disabled when blinds stopped moving. Not sure how to ensure that. My blinds do send the current position when they are done, but this is probably not true for all blinds. Working-ID would be one thing (but I did not yet understand the code for this and also have no working id for testing). Another possibility would be to add another parameter for a timeout, ie afte pressing up/down the button will issue stop for x seconds, after that the button will become up/down again.

Another possibility would be to add a dedicated stop button if there is a stop oid. But I lack CSS (and design) knowledge to implement this.

Signed-off-by: Achim Königs garfonso@mobo.info

GermanBluefox commented 5 years ago

I think, that this is rather specific behavior of this shutter und should be implemented in JS as a script. STOP button is really required and must be implemented sometime in the future, but I don't know when..

Garfonso commented 5 years ago

Actually groupaddresses (i.e. a command) for Up/Down is common for shutters in KNX systems. But I think I can create a script for the functionality, yes.

GermanBluefox commented 5 years ago

I will close it for now without merge and we are looking forward to implement stop button in shutter.