Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rollershutterposition] Initial contribution #13259

Merged
merged 5 commits into from
Feb 26, 2023

Conversation

jsjames
Copy link
Contributor

@jsjames jsjames commented Aug 13, 2022

Rollershutter Position emulation

Description

This transform will emulate setting of absolute position for rollershutters which only support Up/Down/Stop commands. By specifying the time it takes for the rollershutter to fully extend or close, the transform will estimate the time it will take for the rollershutter to move to an absolute position.

@jsjames jsjames requested a review from a team as a code owner August 13, 2022 22:38
@jsjames jsjames force-pushed the rollershutterposition branch 2 times, most recently from a9fd172 to f0d71b8 Compare November 1, 2022 01:10
@jsjames jsjames force-pushed the rollershutterposition branch 2 times, most recently from f292924 to bb580ec Compare December 29, 2022 16:39
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Some minor feedback provided.

@jsjames jsjames force-pushed the rollershutterposition branch 2 times, most recently from a61c85f to 55eace3 Compare February 26, 2023 18:34
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few last comments.

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this transformation add-on. LGTM.

@jlaur jlaur merged commit fe0f49e into openhab:main Feb 26, 2023
@jlaur jlaur added this to the 4.0 milestone Feb 26, 2023
@jsjames jsjames deleted the rollershutterposition branch February 26, 2023 22:42
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Feb 28, 2023
@jlaur jlaur changed the title [rollershutterposition] Initial contribution [transform.rollershutterposition] Initial contribution Mar 3, 2023
@jlaur
Copy link
Contributor

jlaur commented Mar 3, 2023

@jsjames - can you create a follow-up PR adding the file src/main/resources/OH-INF/addon/addon.xml? I missed this during review, and only now discovered that when also started to work on a transformation.

@jlaur
Copy link
Contributor

jlaur commented Mar 8, 2023

@jsjames - gentle ping. 🙂

@jsjames
Copy link
Contributor Author

jsjames commented Mar 8, 2023 via email

@jlaur
Copy link
Contributor

jlaur commented Mar 9, 2023

Will definitely get to this this weekend. Just traveling now.

That's okay. I have created #14559 trying to squeeze it into the M1 build. You might want to have a look - I copied name and description from pom/readme.

miloit pushed a commit to miloit/openhab-addons that referenced this pull request Mar 10, 2023
* Initial contribution

Signed-off-by: Jeff James <[email protected]>
Signed-off-by: miloit <[email protected]>
@kaikreuzer kaikreuzer changed the title [transform.rollershutterposition] Initial contribution [rollershutterposition] Initial contribution Mar 10, 2023
renescherer pushed a commit to renescherer/openhab-addons that referenced this pull request Mar 23, 2023
@Openhabber
Copy link

Openhabber commented Mar 24, 2023

Is there a possibility to add functionality for blinds that can open/close (angle of the blades)?

I mean the type that opens the blades when going up and closes them when going down.

So depending on the wanted open/close state, the shutter has to move in the opposite direction for a short time at the end.

Also some shutters like mine have a feedback for full open and fully closed. It would be nice if it could be used to adjust the times automatically, and/or to recalibrate.

@jsjames
Copy link
Contributor Author

jsjames commented Mar 24, 2023

Is there a possibility to add functionality for blinds that can open/close (angle of the blades)?

What item type are you using to control the open/close - a Contact or Switch? I think this would be possible and could look at this with you.

So depending on the wanted open/close state, the shutter has to move in the opposite direction for a short time at the end.

I don't follow what you mean here?

Also some shutters like mine have a feedback for full open and fully closed. It would be nice if it could be used to adjust the times automatically, and/or to recalibrate.

I think that would be possible as well. Let me know if you want to work on this together?

@Openhabber
Copy link

Wow, thank you!

I'm talking about this type of shutter:
https://www.storen.ch/fileadmin/_processed_/b/1/csm_EC80_mit_Profilfuehrung_gross_HRes_RGB.tif_da7f47f1cf.jpg

I'm using the elero binding, but it should be adaptable to other bindings as well

The shutter is controlled via 0..100%, and responds also with 0..100. it's kinda awkward as it ignores most commands and also only reports 0, 50, and 100.

But generally speaking, it is controlled via UP, DOWN, and STOP.
Physically, when issuing an UP command, the blades first tilt open and then the shutter goes up.
If you issue a down command, the blades first close and then the shutter goes down.

So if you go down, but want the blades open, you have to move it down to the desired position, STOP, and then go UP again for a second.

The elero binding even has separate commands that do that for you (OPEN and CLOSE).

They are really common here (not generally elero, but the type of blinds that have tilting blades).

I'm unsure how this could be added in a general way to this function (feedback fully open, feedback fully closed, and the tilting command after reaching the target position)

@jsjames
Copy link
Contributor Author

jsjames commented Mar 24, 2023

In looking at the elerotransmitterstick binding, I don't see how it supports the OPEN/CLOSE commands, it looks like there is only a rollershutter type channel and a read-only status channel. Am I looking at the right binding?

If I understand how the shade works, the basic function of the transform should work as-is if you set the uptime/downtime to equal the total time it takes for the blind to tilt open/close + move the shade fully up or down. The angle of the blades would just be controlled based on the last few percentages (i.e. 98%, 99%, 100%) - i'm not sure what percent of the tilt time is to the total time of tilt time down + close time so this may not give the granularity you want. But the limit here is how fast openhab + transmitter will send a UP command and then a quick STOP command once the position is reached is likely going to limit the level of accuracy you can achieve.

An enhancement could be made to the transform so that if the value being set is close to the extreme (i.e. 98% closed), then it could recalibrate by sending DOWN command to get to 100% and then send UP command followed by STOP.

Regarding looking at the status to recalibrate - the transform will recalibrate automatically to the full up / down position even without feedback from the handler. If a 0% or 100% command is issued, the transform will an UP or DOWN command to the handler without a stop.

@Openhabber
Copy link

Openhabber commented Mar 25, 2023

You're right. It does not support close and open commands.
I actually do that from rules so I can issue open and close through a button press (up, wait, stop and down, wait, stop).

As for the percentages, you're right that this should work.
Also the recalibration should also be ok like you described it.

In a perfect world, I would imagine the following:
-being able to optionally define a TILT_OPEN_TIME and TILT_CLOSE_TIME (in the 0.5..3s range typically)
-being able to issue a TILT_OPEN and TILT_CLOSE command in addition to up, down, stop. If the shutter is currently moving, those commands have immediate effect and stop the shutter. It also updates the switch described in the following point.
-an optional second control of type switch that controls the wanted state for TILT. If I change it, it has the same effect as TILT_OPEN/TILT_CLOSE but does not stop a moving shutter (it will be issued after moving is done).
If the shutter is done moving through the percentage control or even full up/down commands, it will be adjusted according to TILT if it did move in the other direction.

Im also willing to test if I can get the transform running in OH3.4? I sadly can't upgrade to 4.0 just for testing at the moment. Also this can wait is is not urgent (it's just a wishful idea :) )

Thanks very much!

@jsjames
Copy link
Contributor Author

jsjames commented Mar 25, 2023

There is as version of the transform compiled for openhab3 here: https://drive.google.com/file/d/1b-3cpLOFW2T51h_2tWvq1zagcwvSpVVs/view?usp=share_link which you can try.

Since this is a transform, I don't believe it can accept different types of commands vs. what the item type can support - so a Rollershutter item type would only support UP, DOWN, STOP and percent. If you are thinking to combine multiple items to the handler via the transform, I don't believe that would be supported either. I wonder if the best way to handle this is with scripts?

@Openhabber
Copy link

Thanks, I guess then it won't make sense to adjust anything, as you would need to control the tilt independently from the opening. I will have to go via scripts then I guess :) wouldve just been nice to have.

Thanks anyway!

FordPrfkt pushed a commit to FordPrfkt/openhab-addons that referenced this pull request Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants