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 "send_stop_at_ends: False" #14

Open
levveisman opened this issue Jul 21, 2024 · 5 comments
Open

Add "send_stop_at_ends: False" #14

levveisman opened this issue Jul 21, 2024 · 5 comments
Labels
question Further information is requested

Comments

@levveisman
Copy link

Is there an option to add "send_stop_at_ends: False"?
It would be very useful in case if the blind was opened 50% with HA, and then closed with remote or a switch, then HA “thinks” that it needs to send a STOP when you're trying to close it again, and stops it half way, even if want it to be closed completely.

@Sese-Schneider
Copy link
Owner

Hey @levveisman
I'm not 100% sure about your question, can you please let me know the actual behavior and the desired behavior

@Sese-Schneider Sese-Schneider added the question Further information is requested label Aug 26, 2024
@adrinewborn
Copy link

Hello, I am also interested in adding the "send_stop_at_ends" feature.
That feature exists under the Cover Time Based Synced component from kotborealis.

That function allows inhibiting the stop command. It's useful in certain cases, particularly for full closure (0%) or full opening (100%) commands.

@adrinewborn
Copy link

Hello,
For the moment i have custom cover.py with :

async def auto_stop_if_necessary(self):
    """Do auto stop if necessary."""
    current_position = self.travel_calc.current_position()
    if self.position_reached():
        _LOGGER.debug("auto_stop_if_necessary :: calling stop command")
        **if current_position() > 0 and current_position() < 100:** 
            self.travel_calc.stop()
            if self._has_tilt_support():
                self.tilt_calc.stop()
            await self._async_handle_command(SERVICE_STOP_COVER)

@levveisman
Copy link
Author

Hi.
Can you please explain how to use it? Should I just add this code to cover.py?

@adrinewborn
Copy link

adrinewborn commented Sep 30, 2024

Hello,

To begin, I would like to explain why I am making these modifications.
My shutters are on a proprietary radio protocol. To automate them, I have therefore wired in parallel to each switch, a 2-channel Zigbee relay card. It works exactly as if the user was pressing the button (push button). The cover stops by itself at the top or bottom if no stop command is sent.

This implementation is not really clean. It would be necessary to add the "send_stop_at_ends" property.

Now, it works like this:

        if current_position() > 0 and current_position() < 100: """If the position is different from 0 or 100, we call the stop, otherwise we do nothing."""
            self.travel_calc.stop()
            if self._has_tilt_support():
                self.tilt_calc.stop()
            await self._async_handle_command(SERVICE_STOP_COVER)

Another modification:

  • The additional modification allows forcing the sending of Up and Down commands even when the cover is already at 100% or 0%. (Not having any feedback on the position of the cover)
    async def async_close_cover(self, **kwargs):
        """Turn the device close."""
        _LOGGER.debug("async_close_cover")
        if self.travel_calc.current_position() > 0:
            self.travel_calc.start_travel_down()
            self.start_auto_updater()
            self._update_tilt_before_travel(SERVICE_CLOSE_COVER)
            await self._async_handle_command(SERVICE_CLOSE_COVER)
        else:
            await self._async_handle_command(SERVICE_CLOSE_COVER)
    async def async_open_cover(self, **kwargs):
        """Turn the device open."""
        _LOGGER.debug("async_open_cover")
        if self.travel_calc.current_position() < 100:
            self.travel_calc.start_travel_up()
            self.start_auto_updater()
            self._update_tilt_before_travel(SERVICE_OPEN_COVER)
            await self._async_handle_command(SERVICE_OPEN_COVER)
        else:
            await self._async_handle_command(SERVICE_OPEN_COVER)

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

No branches or pull requests

3 participants