mongoose-os-apps / shelly-homekit

Apple HomeKit firmware for Shelly's
Other
1.71k stars 127 forks source link

Roller Shutter: positioning accuracy #204

Open heili1094 opened 3 years ago

heili1094 commented 3 years ago

Hy, the Software for Homekit is WOW!!! I face one issue which is only cosmetic 😊 Possible to change the percentage which displays in HomeKit App? F.i. 37% roller shutter position is in real 15% so possible to off set manual?

Thanks BR René

rojer commented 3 years ago

yeah, this one may not be as easy to tackle as simply add an offset. while working on #5 i deliberately put off positioning accuracy because of the differences. for example, it's been mentioned that some shutters have non-linear dependency between the amount of movement time and position. so let's start gathering data. for your shutters, can you measure actual position in 10% increments? as in - set position to 10% in homekit, measure actual position, set to 20%, measure, etc up to 90%. also, don't do it sequenctially 10-12-30-... (becasue error will accumulate), do 0-10-0-20-0-30-..., up to 90 (0 being fully closed position).

heili1094 commented 3 years ago

Hy,

stupid question- how should i measure? With measure tape? Thanks

Sent from 

Am 17.10.2020 um 21:27 schrieb Deomid Ryabkov notifications@github.com:

 yeah, this one may not be as easy to tackle as simply add an offset. while working on #5 i deliberately put off positioning accuracy because of the differences. for example, it's been mentioned that some shutters have non-linear dependency between the amount of movement time and position. so let's start gathering data. for your shutters, can you measure actual position in 10% increments? as in - set position to 10% in homekit, measure actual position, set to 20%, measure, etc up to 90%. also, don't do it sequenctially 10-12-30-... (becasue error will accumulate), do 0-10-0-20-0-30-..., up to 90 (0 being fully closed position).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

rojer commented 3 years ago

pretty much, yeah.

heili1094 commented 3 years ago

https://www.icloud.com/iclouddrive/0I7PrVtKQHjyausFshEOycgpg

Hy, enclosed the link and hope it helps to find a solution

Br René

Sent from 

Am 18.10.2020 um 12:52 schrieb Deomid Ryabkov notifications@github.com:

 pretty much, yeah.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

rojer commented 3 years ago

thank you! so, it looks like about 1/4 of movement from closed actually goes to open gaps between the slats. when the curtain starts moving, from 30% on, we have the following values for number of cm per 10%: 13, 13, 14, 17, 19, 22. this non-linearity towards the end is a bit puzzling. and the end position is not that far off from the 90% - it's around 80% by my quick calculation.

come to think of it, non-linearity is expected - there's less curtain to lift, so more of the energy goes to movement rather than counteracting gravity, so it goes faster per unit time.

heili1094 commented 3 years ago

Hy, so and Solution for this „cosmetic“ issue? Thanks

Am 18.10.2020 um 22:18 schrieb Deomid Ryabkov notifications@github.com:

 thank you! so, it looks like about 1/4 of movement from closed actually goes to open gaps between the slats. when the curtain starts moving, from 30% on, we have the following values for number of cm per 10%: 13, 13, 14, 17, 19, 22. this non-linearity towards the end is a bit puzzling. and the end position is not that far off from the 90% - it's around 80% by my quick calculation.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

rojer commented 3 years ago

i'll need some more data from users to decide what to do.

heili1094 commented 3 years ago

Ok Thanks

Am 19.10.2020 um 09:46 schrieb Deomid Ryabkov notifications@github.com:

 i'll need some more data from users to decide what to do.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

juansf99 commented 3 years ago

Hello, For a few weeks I have installed the firmware on a door blind. The operation of the blind is completely correct. The installed firmware version is 2.3.0 The measurements have been made following the pattern: 0%-10%-0-20-0-30-0-40 ...

% | cm 10% | 4.5 20% | 18 30% | 32 40% | 50 50% | 69 60% | 89 70% | 111 80% | 135 90% | 162 100% | 194

As discussed above, a non-linearity is observed in the path of the blind. At the beginning it goes up a little and at the end of the route it goes up very fast. I hope that this data can be of help to be able to add some parameter in the web interface and correct this behavior.

Thanks, JASF

rojer commented 3 years ago

@juansf99 thank you! what i'm thinking here is maybe we'll be able to offer a number of curves for the user to choose, linear being the default and then various options. let's collect some data to know which options to offer.

i added a note tot he wiki page to send new users here if they are not satisfied with the positioning.

ken-sa commented 3 years ago

hi rojer,

thank you for your great work. i have the same problem.

Her the mesaurment from my roller.

10% | almost close 20% | IMG_0033 30% | 6 40% | 26 50% | 46.5 60% | 71 70% | 97 80% | 122.5 90% | 158 100% | 216

tomorrow i will give you a feedback from the second one.

domke24 commented 3 years ago

Hi Rojer,

at first: the HomeKit Firmware is amazing! Thanks for that!

I have the same problem. I use a shelly for one of my windows. The problem is that when it´s fully closed the home app thinks it is nearly 25% opened. So in the home app the roller shutter are always open and never closed.

I would be perfect if you can find a solution.

Thanks in advance!

ken-sa commented 3 years ago

I tried it today with the stock firmware and it worked. After that I loaded the HomeKit firmware and calibrated it again. In the attachment you can find the log, maybe it can help. shelly_calibration.txt

And here is the result, after the calibration. IMG_0066 IMG_0067

chstoll commented 3 years ago

I really don't know if there is an issue here. I have roller shutter modules from fibaro (z-wave) and some really old marmitek X10 and they all calibrate in a similar way (just like the shellys with rojers homekit firmware). What do you expect 50% should be? In fact, the picture above seems exactly 50%, because the motor has to run quite a bit to get from closed (with open slots) to fully closed. So, knowing that just take 60% to get the shutter to an "optical" 50%.

ken-sa commented 3 years ago

If I want to reach the optical 50% I have to open the shutters to 74%, but that is not the point. We want to improve the firmware that works very well and bring it to another level. This is not a criticism from my side but rather a suggestion to get better. Please do not misunderstand.

rojer commented 3 years ago

50% in home app should mean exactly half open, half closed. meanwhile, let's continue collecting data.

yuvalbeck commented 3 years ago

Shutter.pdf Hi Rojer, I had some time I put tapes every few cm on the window and filmed it - attached the numbers. Not 100% accurate but maybe could help.

thatslolo commented 3 years ago

I spotted a problem on my blinds that there on different positions when set to the same, depending from which state they started to move to the desired position. It's obviously the same problem. I'll try to document it asap.

andyblac commented 3 years ago

sounds to me we need 3 positions for calibration FULLY OPEN, CLOSED, and MOTOR REST.

OPEN = shade at open position CLOSED = shade at visible closed position MOTOR REST = let the shade motor go to fully closed posotion, so all slats compress into the fully closed position.

@rojer would this be posible ?, maybe we need a new Roller Shutter option called Roller Slats.

thatslolo commented 3 years ago

I don't think that can be represented in HomeKit tbh. But it could be used to determine the actual position of the shutter when set to a specific open state in percentage.

andyblac commented 3 years ago

why not, 1% could be CLOSE, and 0% could be REST. so if 10% is called for you actually get 10% etc. if in REST and you call 1% the shade open to CLOSED position.

i doubt hardly anyone will acually have a real world use for 1%, and even if they did the differance between 1% and 2% would hardly anything to complain about.

thatslolo commented 3 years ago

And why not make it configurable as an advanced option, so you can set the lower 10% for just changing the state of slats e.g. Just an idea. :)

andyblac commented 3 years ago

And why not make it configurable as an advanced option, so you can set the lower 10% for just changing the state of slats e.g. Just an idea. :)

thats why i suggested in a aditional 'Roller Slats" option, "Roller Shutter" would stay as is, for normal material shades.

pivale commented 3 years ago

why not, 1% could be CLOSE, and 0% could be REST. so if 10% is called for you actually get 10% etc. if in REST and you call 1% the shade open to CLOSED position.

i doubt hardly anyone will acually have a real world use for 1%, and even if they did the differance between 1% and 2% would hardly anything to complain about.

I actually use a lot the "only slats" open in my shutters :) In the summer to prevent the house from overheating but still have some light... Or to have some light in the rooms when my kids have their afternoon naps...

I like the idea of 0-10% being for slats and the rest for normal opening.

To configure this correctly, I would suggest that before calibration, the user sets the shutters to only slats open and start from there. That could give you an educated guess of what should be the slats time (i suspect really fast).

andyblac commented 3 years ago

why not, 1% could be CLOSE, and 0% could be REST. so if 10% is called for you actually get 10% etc. if in REST and you call 1% the shade open to CLOSED position. i doubt hardly anyone will acually have a real world use for 1%, and even if they did the differance between 1% and 2% would hardly anything to complain about.

I actually use a lot the "only slats" open in my shutters :) In the summer to prevent the house from overheating but still have some light... Or to have some light in the rooms when my kids have their afternoon naps...

I like the idea of 0-10% being for slats and the rest for normal opening.

To configure this correctly, I would suggest that before calibration, the user sets the shutters to only slats open and start from there. That could give you an educated guess of what should be the slats time (i suspect really fast).

what i was saying is do you do a REAL 1% open, (forget about open slats), i was saying that we could have 1% as "open slats", and 2% as a REAL 1%, so in home kit when you ask for 1% it just opens slats.

i can't see how you could have 10% to open slats and also have a REAL 50% open????

pivale commented 3 years ago

i can't see how you could have 10% to open slats and also have a REAL 50% open????

You can if you have a non linear counting of the percentage. You could have something like: 0-all closed 10-slats fully open/shutter down to the ground 50-shutter half open 100-shutter fully open

Still, I would be happy with something like 10% for slats, even if that meant that "real half open" would be 45%... I can deal with a 5% error 😉

andyblac commented 3 years ago

i can't see how you could have 10% to open slats and also have a REAL 50% open????

You can if you have a non linear counting of the percentage. You could have something like: 0-all closed 10-slats fully open/shutter down to the ground 50-shutter half open 100-shutter fully open

Still, I would be happy with something like 10% for slats, even if that meant that "real half open" would be 45%... I can deal with a 5% error 😉

thats my point i very much doubt HomeKit slider willl support none linear percentage. thats why sugested 1% as "open slats"

so in calibration you would have 3 postions 100% = open, 1% = Open Slats, 0% = Fully closed.

pivale commented 3 years ago

Hey,

Here is my data, I have a "small" window and a "big" window. Although I set it to round numbers, in the end home app reported a different percentage. The values here are the ones reported by home app after stopping.

Small at 6% the shutter is touching the ground but slats are all open 0-9% - 2cm 0-21% - 12cm 0-30% - 21cm 0-40% - 32cm, 0-50% - 44cm 0-59% - 55cm 0-69% - 69cm 0-79% - 84cm 0-89% - 101cm 0-100% - 120cm

Big at 8% the shutter is touching the ground but slats are all open 0-9% - 1cm 0-19% - 15cm 0-29% - 31cm 0-39% - 49,5cm, 0-50% - 68cm 0-59% - 90cm 0-69% - 113,5cm 0-79% - 139,5cm 0-89% - 167cm 0-100% - 210cm

DarkAppleLead commented 3 years ago

Hey rojer, first of all thank you for your great project!

I have a problem with one of my shutters. It says my window is fully open, but it isn‘t 😅 ![Uploading image.jpg…]()

CyberMrProper commented 3 years ago

Hi @rojer, here are my numbers:

10% - 0 cm : all time is spent opening the slats, no visual window is opened 20% - 13 cm 30% - 28 cm 40% - 46 cm 50% - 65 cm 60% - 87 cm 70% - 109 cm 80% - 135 cm 90% - 159 cm 100% - 192 cm

Thanks!

funkosgr1410 commented 3 years ago

Hello Rojer,

Many thanks for this software which is really awesome. With regards to calibration, I use a shelly 2.5 which controls multiple shutters (it has been installed on a shutter central switch that controls all shutters). This means that calibration is not applicable as each window has its own position for the same time that switch is open. As such calibration now fails and there is no alternative to set manually a timer (e.g. 26 seconds) for open close time. This is not related to this specific software as calibration was also failing with original shelly software. How likely could it be to develop an override option that could use open/close based on a predefined time interval?

For the record, calibrating shelly 2.5 devices that are individually installed on each shutter works perfectly and thanks again for your excellent development.

Thanks!

greensouth commented 3 years ago

For this issue, please take a look at the approach made by Jose, the author of HAA firmware about how to set a modifier for Window Covering: https://github.com/RavenSystem/esp-homekit-devices/wiki/Window-Covering

HomeKit Position = motorPosition / (1 + ((100 - motorPosition) * correctionValue * 0.0002))

In there, you set a correction value and see if it visually matches with the slider position. It's just a question of trying some values until you fine-tune the visual aspect.

Lausbuab1 commented 3 years ago

Hi Rojer,

as also mentioned above, your work is awesome! Thank you for that.

Sadly, I also have the same issue with my shutter and shelly 2.5, that the shutter is about 50% closed and the app says, it's 80 percent closed.

Is it possible to add a manual calibration? Like entering the percent if the we can control it by ourselves?

janigro commented 3 years ago

come to think of it, non-linearity is expected - there's less curtain to lift, so more of the energy goes to movement rather than counteracting gravity, so it goes faster per unit time.

Hi Rojer, even if the motor manages to keep a constant speed at all times, the radius of the rolled shutter must be taken into account. In the attached picture, you can see that one full turn of the roller lifts 4 slats at first, while the same full turn at the end will lift 12 slats! That's 3 times more per turn of the roller. This heavily depends on the shutter type. The typical shutter in Spain (like the one attached in the picture), has a very thick slat (around 10mm + the spacing while rolled). However, a cloth blinder has probably 2mm at most. The first case will be much less accurate than the second.

I think I can work out a formula that takes into account the slat thickness and the initial radius of the roller (i.e., the roller before rolling any slats).

I have not received my Shelly 2.5 yet, but I'll try to figure it out when I get my hands on it. I'll report back.

blinds

Marcusg562 commented 3 years ago

Thanks @andyblac haven‘t seen it... but yeah, I have the same issue.

greensouth commented 3 years ago

no improvements on this?

WaW1190 commented 3 years ago

Hi, first of all I want to say a HUGE thanks for this, this made managing my smart home so much more easy.

I do have the same issue, running FW 2.8.2.

50% opening in HomeKit or the Web interface is roughly 75% closed. Everything else works flawlessly

jtolsa commented 2 years ago

HI Rojer,

Many thanks for the software, it's just awesome.

Below my measurements. Would be great to these curves somehow implemented in the code... doesn't need to be to the mm but a rough approximation would be great!

10% - 1.0 cm 20% - 11.5 cm 30% - 24.0 cm 40% - 37.5 cm 50% - 53.0 cm 60% - 69.0 cm 70% - 87.0 cm 80% - 105.0 cm 90% - 125.5 cm 100% - 153.0 cm

Many thanks again!

Geert92 commented 2 years ago

Hi I’m new to this. I started using the shelly 2.5 for my roller shades (not blinds). It seems to work sort off, When calibrating it does not go down. So I xannot fully controll it at all. Can someone advise me on what to do? Thanks 🙏

jekruege commented 2 years ago

Hello, I have problems with the calibration, too. It goes down 1 second und goes up 1 second and repeat it 50 times. Can I calibrate manual?

Geert92 commented 2 years ago

Hi I’m new to this. I started using the shelly 2.5 for my roller shades (not blinds). It seems to work sort off, When calibrating it does not go down. So I xannot fully controll it at all. Can someone advise me on what to do? Thanks 🙏

Small side note. Im using a motor that has a limiter build in, so it cuts off at to min and maximum hight.

marvin743 commented 2 years ago

I tried it today with the stock firmware and it worked. After that I loaded the HomeKit firmware and calibrated it again. In the attachment you can find the log, maybe it can help. shelly_calibration.txt

And here is the result, after the calibration. IMG_0066 IMG_0067

Same for my installation. Did you adjust anything else so that 50% is really 50% open?

greensouth commented 2 years ago

Hi! No further news on this? Latest post can't be more explanatory :P

marcus-aa commented 2 years ago

OK, would be good to improve on the non-linearity calibration.

There are mainly 2 parts of this problem.

1: many shutters are adjusted so the end position is quite a lot further than when the slats are in the lowest position. The motor turns a bit longer until it reaches it's limit switch. So when opening, it first turns without moving the slats correspondingly. This can be around 10% in my test installation. So at 10%, we are still fully closed.

Now, the motor starts to lift the slats, but many of them are made so they will first separate slightly to let light in. Now we can be at 15%, and we see light through them, but the lowest one is still all the way down. This position is often wanted in automations and it would be good to be able to calibrate so that all of them are at the same % in this position.

This is a fixed offset that could be entered. "seconds to transparancy position, set that to 1% and then start counting normally as it starts to lift.

So, 0% - fully closed, 1% lifted to see-through position but bottom slat still in lowest position. 2% - bottom slats starts lifting.

2: The next problem is the increasing size of the roll that pulls up the slats.

Many shutters work on a 3" / 76-80mm pipe (but there are also other sizes). So, the first turn will then pull up 78x3.14 (pi) = 245mm of the shutter. Then a layer of the slats has been added, with some extra space as they are not optimally formed around themselves (assumed to 25% here). So the second layer of 12mm slats will have a diameter of 78 + 2x 12 x 1,25 = 108mm, and lifts 108x3.14 = 340mm

The third layer will lift (78 + 4 x 12 x 1.25 ) x pi = 433mm 4th : 528 mm

and so on.

to fully compensate for this we would need to input the base pipe diameter, the slat thickness and the length of the shutter.

But, the pipe dia is just an offset, pi is of course constant, and the length is relative to the travel time.

So, the actual influence is the slat thickness. It decides the slope of the curves that show the increasing change of position as a function of turns, time, length.

image

ingski commented 1 year ago

Hi, just let me thank you for this great work. I have a bunch of Shelly devices in our home, all with your firmware and they work like a charm. This includes one roller shutter with a 2.5 shelly.

However - today I flashed a Shelly 2.5 that is attached to three roller shutters that are controlled simultaneously and the calibration turned out to not discover full open or closed state even close :-(

Depending on where the shutters are before I calibrate it kind of expands from there:

Actually instead of the automatic calibration a timer would be great, since all shutters are equipped with an automated stopping switch at either end...

... and it's already here: https://github.com/mongoose-os-apps/shelly-homekit/pull/449 latest Firmware for the 2.5 with this alpa feature: https://rojer.me/files/shelly/misc/shelly25-449.zip

Working like a charm :-)

Ingo

IMG_6039 IMG_6038 IMG_6037

desek90 commented 1 year ago

Hello, is there any progress on this topic?