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: Nudge for calibration? #77

Open
knissdesign opened this issue Sep 27, 2023 · 1 comment
Open

Feature Request: Nudge for calibration? #77

knissdesign opened this issue Sep 27, 2023 · 1 comment

Comments

@knissdesign
Copy link

Would there be any way to program a "nudge" command that could be used for calibration? For example, set the blind/motor to 50%, and then be able to nudge the motor a few steps at a time in either direction until the blinds physically match the 50% in Home Assistant, without actually changing the 50% set point. I have frequent power outages and the blinds tend to lose where they are, and it's a huge pain to get them back to correct.

@knissdesign
Copy link
Author

Alright, if anyone is following this, I've found a solution. Since I am using this on tilting horizontal blinds, the "open" and "close" functions that moved the blinds all the way up, and all the way down, respectively, never made sense, as "open" just closed them in the upward direction. I know this control is designed for lifting blinds, not tilting them. Nonetheless, I never used those controls. So, my solution was to modify those commands to move the motor 1 step at a time, without reporting the change to the "current position" so as to allow the calibration I'm looking for. I did this by replacing the "open" and "close" code with the following:

if (newTopic == USER_MQTT_CLIENT_NAME"/blindsCommand") 
  {
    if (newPayload == "OPEN")
    {
    #if DRIVER_INVERTED_SLEEP == 1
    shadeStepper.sleepON();
    #endif
    #if DRIVER_INVERTED_SLEEP == 0
    shadeStepper.sleepOFF();
    #endif
    shadeStepper.move(80, FORWARD);
    moving = true;
    #if DRIVER_INVERTED_SLEEP == 1
    shadeStepper.sleepOFF();
    #endif
    #if DRIVER_INVERTED_SLEEP == 0
    shadeStepper.sleepON();
    #endif
    moving = false;
    }
    else if (newPayload == "CLOSE")
    {
    #if DRIVER_INVERTED_SLEEP == 1
    shadeStepper.sleepON();
    #endif
    #if DRIVER_INVERTED_SLEEP == 0
    shadeStepper.sleepOFF();
    #endif
    shadeStepper.move(80, BACKWARD);
    moving = true;
    #if DRIVER_INVERTED_SLEEP == 1
    shadeStepper.sleepOFF();
    #endif
    #if DRIVER_INVERTED_SLEEP == 0
    shadeStepper.sleepON();
    #endif
    moving = false;
    }

Hope this can help someone else!

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

1 participant