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

Feature Request: Third reed sensor. #4

Open
Wheemer opened this issue Oct 29, 2023 · 11 comments
Open

Feature Request: Third reed sensor. #4

Wheemer opened this issue Oct 29, 2023 · 11 comments

Comments

@Wheemer
Copy link

Wheemer commented Oct 29, 2023

Hello;

I would like to use a third reed sensor at a position where my door is just slightly opened. I'd call it my "vent" position.

I often need to have the door opened in this position. Would this be possible?

Thanks, I used your nice work to replace the MyQ paperweight.

@juaigl
Copy link
Owner

juaigl commented Nov 1, 2023

Hello

Actually, I am a bit busy to do the needed modifications, but I will give you some ideas

If I’m not wrong the door supports position control. You can request it to open just a 10% and it will stop once 10% reached. You can calculate how much percentage is the position in which you want and try using that. This will not need a 3rd reed switch.

If this approach is not valid for you, I have some simple ideas (not the best, but should work):

  • Similar to previous one, but we will use the 3rd reed switch to update cover position. Calculate the percentage of position for the 3rd reed switch. Add a third sensor in cover.yaml and when it is reached, update door position to the percentage calculated. To command you just need to request door to open/close to that percentage of position.
  • Add the 3rd reed switch to cover.yaml and when reached send stop action. If you just want to stop on this reed switch when opening and not when closing, you can do a simple if checking the cover operation with “current_operation”. The con of this approach is that if you want to full open it will stop anyway in the 3rd reed switch and you will to request a second open to get full opening.

@Wheemer
Copy link
Author

Wheemer commented Nov 1, 2023

I tried dragging the slider or calling the service to set position to 10%. Both result in just a full open or close.

I've adjusted the timing and the percentage already matches the actual position. But the stop doesn't seem to happen.

@juaigl
Copy link
Owner

juaigl commented Nov 1, 2023

I reviewed the code (develop branch) and seems I'm only using position to determine action to do.
I will try to do and update this weekend to support position control.

@juaigl
Copy link
Owner

juaigl commented Nov 4, 2023

@Wheemer I just pushed a commit that adds the position control feature.

I did not test it yet, but it should work (that sounds like what a developer will say 😄). If you find any issue let me know please.

While doing the changes I saw this deprecation warning; https://esphome.io/components/cover/custom
I have to migrate this from custom component to external component. Once done I will merge develop into master, but sadly this will take some time.

@Wheemer
Copy link
Author

Wheemer commented Nov 5, 2023

Awesome, it's sort of working. At least it does from closed position. However from open, if I close it to 10% it thinks it can stop at 10% but my opener will only reverse direction when the signal is sent during closing. So it would be really nice if it instead fully closed and then reopened to the desired amount. Is that logic even possible? I really appreciate your work, this is already working very well.

@Wheemer
Copy link
Author

Wheemer commented Nov 5, 2023

It also seems I am unable to open it to anything less than 10-15%.

EDIT: Reduce push interval to fix this.

@Wheemer
Copy link
Author

Wheemer commented Nov 5, 2023

Sorry to bother again. I also have another problem with closing. If I close from 5% it will always bounce back and open. If I close from 10% it closes fine. Is there any way that if I close it from 5% it can know to stop after the bounce back at 10% and then close again?

@juaigl
Copy link
Owner

juaigl commented Nov 5, 2023

I think the issue could be related to config times or end sensors are not working properly

Please, check next values in your .yaml file:
image

For the first 2 you will need to measure time your door need to open and close (they can be different).
The last one is the time between relay activations. My doors ignore them if are under 1s, so I set it to 1,5 s. As you already noticed, reducing this one will increase precision allowing your door to do more little steps.

In the example, the minimum step the door can do is: 1500 * 100 / 30000 = 5%. So if you command a operation bellow that, door will be not able to do it and will do the minimum step it can (5% in this case), but if you are near to the ends and the end is reach it will stop at end (it should not bounce back, but could happen as this behaviour is difficult to predict)

So please check your times. And sorry if I say something obvious, I just want to be sure.

If your times are ok, then we can debug it.

  • Easy way with HA: Fom full close, request full open and while door is moving you have to check in HA the position reported. If it reports 100% or quite bellow that after door fisichally reaches the end, you need to adjust your time. Repeat same operation for opposite operation.
    Once we have this, ok, lets try to reproduce your scneario. Request full open, then request 10% and check position reported in HA to try figure out whats happening.
    Lastly, again from full open, this time request full close, but when you see your door at desired position, hit stop button. Then check reported position in HA, and this should be the good one to use.

  • Second way: Do the same steps as before, but this time we will be using ESPHome dashboard to get debug messages, as this reports position with higher frecuency.
    Change in your .yaml log level to DEBUG (currently INFO). Add next line:
    image
    Then in ESPHome dashboard connect to your door and check log while door is moving. It will print a lot of messages. Also here you can check when it reports that end sensors was released or reached.

Sorry to bother again. I also have another problem with closing. If I close from 5% it will always bounce back and open. If I close from 10% it closes fine. Is there any way that if I close it from 5% it can know to stop after the bounce back at 10% and then close again?

Confirm me if I'm understanding it well. Door is at 5% (nearly to be closed) and you request it to go to full close (0%). When you request it, reaches end and then bounces back?

@Wheemer
Copy link
Author

Wheemer commented Nov 8, 2023

Currently I have push interval at 500 and I can request 5% from service call no problem.

So only problem remaining is that it bounces back on close from 5%.

To close I issue set position to 10% and it will close and stop at 10% on the way back up. I have a delay of 3.6 seconds and issue a set position 0%.

This makes it do the dance and end up closed. So it is working for my needs well. I have an automation tied to an input boolean and my vent switch works well.

Thanks for this great way to control my older garage door. I now have much better control then I believe is even possible with anything else available.

I was thinking of how I can control the light... I see a capacitor inline within the control switch, that might be my next task.

Thanks for your help!

I really appreciate your great work.

@juaigl
Copy link
Owner

juaigl commented Nov 11, 2023

Nice to hear that finally works for you!

@Wheemer
Copy link
Author

Wheemer commented May 14, 2024

I finally updated my config to take advantage of the latest version of your code. So much neater as an external component.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants