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

Add buffer for the final position of the blinds #34

Closed
marekhalmo opened this issue May 27, 2020 · 6 comments
Closed

Add buffer for the final position of the blinds #34

marekhalmo opened this issue May 27, 2020 · 6 comments

Comments

@marekhalmo
Copy link
Contributor

marekhalmo commented May 27, 2020

If you command the blinds to go to a specific position the motor might go a bit too far or a bit too short.

The code checks the actual position already and if this happens the node wont be in the proper state and will still be marked as moving.

Example:
Command: customPositon, position 60
Blind goes to 58 and stops (good enough).. the node is stuck in state "Going to 60%"

I assume there should be some sort of buffer (e.g. 2-5%) in the code in tahoma.ts (line 28)
if (currentPosition === expectedState.position)

.. i'm not that good with javascript, i'm sure it would be easy to add some sort of (abs(currentPosition-expectedState.position) < 5) check

would also be nice to have some sort of status reporting output (actual state)

Thank you!

@nikkow
Copy link
Owner

nikkow commented May 28, 2020

Hi @marekhalmo,

Thanks for the improvement suggestion. This is indeed a good idea. I will definitely add a buffer. I will run some tests on my appliances to determine the best value for this.

@marekhalmo
Copy link
Contributor Author

@nikkow how long does it take from the command untill your blinds move? It seems that the somfy app has a latency somewhere around 500ms but my blinds take sometimes more than 5seconds to move.. might be someting wrong with my setup..

@nikkow
Copy link
Owner

nikkow commented Jul 26, 2020

Hi @marekhalmo,

Sorry, I kinda missed your last comment. I did a couple of tests and did not observe any high latency. The blinds tend to move instantly after being triggered. Can you be a bit more specific about your setup? Mine is pretty basic:

node-red instance hosted on a wired RPi on the same LAN than the Tahoma (even if it should not have any impacts, since everything goes through their cloud). Also tried to set up a brand-new instance of node-red on my (wireless) MacBook and did not manage to reproduce high latencies.

@marekhalmo
Copy link
Contributor Author

Hello @nikkow. It seems that it depends on the connection to some US servers + latest update seems to decrease the time between when the next blind moves (if you command multiple blinds). The original issue still persists, did you make any proggress??

@nikkow nikkow self-assigned this Aug 10, 2020
nikkow added a commit that referenced this issue Aug 10, 2020
…d as valid when checking for a device's state (#34)
@nikkow
Copy link
Owner

nikkow commented Aug 10, 2020

@marekhalmo, I have added a 5% buffer to the expected position check. If you set a customPosition of 50, the node will consider the range 47,5-52,5 as valid (though I'm not sure Somfy returns decimals).

I've also added an exception. When the expected position is 0 or 100, then the buffer is disabled (if I want to fully close the blinds, I'd expect them to be fully closed, not 95% closed).

This will be included in the next release.

@marekhalmo
Copy link
Contributor Author

@nikkow That is awesome.. thank you!

nikkow added a commit that referenced this issue Aug 20, 2020
feat(tahomaNode): add buffer to allow neighbor values to be considered as valid when checking for a device's state (#34)
@nikkow nikkow closed this as completed Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants