Motionblinds bluetooth - default disconnect time too short
The problem
Default disconnection time is currently 15sec after connection is made. In some cases this is too short, for example when the blind is completely opening or closing. Parameters like position are not accurately represented since this will only be updated when opening / closing is finished (by that time the devices is already disconnected).
My suggestion is to make the disconnect time configurable, maybe multiple options can be offered:
- Permanent connection
- Configure fixed disconnection time after initial connection
- Configure fixed disconnection time after the blind is confirmed to be still / not moving
The last one option would make the most sense to me. If the blind is not operated, it will be disconnected after the configured time (e.g. 15sec). If the blind is operated, it will await the complete movement and disconnect accordingly after configured time (e.g. 15sec).
What version of Home Assistant Core has the issue?
2024.6.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Motionblinds bluetooth
Link to integration documentation on our website
https://www.home-assistant.io/integrations/motionblinds_ble/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
Hey there @lennp, @jerrybboy, mind taking a look at this issue as it has been labeled with an integration (motionblinds_ble) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of motionblinds_ble can trigger bot actions by commenting:
@home-assistant closeCloses the issue.@home-assistant rename Awesome new titleRenames the issue.@home-assistant reopenReopen the issue.@home-assistant unassign motionblinds_bleRemoves the current integration label and assignees on the issue, add the integration domain after the command.@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue.@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
(message by CodeOwnersMention)
motionblinds_ble documentation motionblinds_ble source (message by IssueLinks)
- Permanent connection
- Configure fixed disconnection time after initial connection
These options have been added as part of PR #120110. You could already test it for yourself if you change the integration at homeassistant/components/motionblinds_ble with the list of changes.
- Configure fixed disconnection time after the blind is confirmed to be still / not moving
This one I still need to have a look at. I could make it an option (enabled/disabled) for home assistant to first receive feedback that the blind is not moving anymore before a disconnect timer is started with the disconnection time that the user configured (or else the default 15 seconds if not configured).
- Configure fixed disconnection time after the blind is confirmed to be still / not moving
I do not yet have the time to test this myself, but if you want to I can give you a version shortly where this is enabled by default. So then home assistant will:
- create a disconnect timer when connected to the blind
- the disconnect timer will be cancelled when the blind is moving (e.g. up/down)
- the disconnect timer will be created again when the blind has moved to the position (so the blind is not moving anymore)
- if for some reason the blind does not have end positions or a favorite position the disconnect timer will start immediately when the command is called
That sounds as a great approach. If you have anything I can install easily let me know. I can do some testing in the coming week or so.
Try out this, the option is enabled by default so it should only start the disconnect timer after the blind stops moving (you can probably check the debug logs to verify this):
python -m pip install --force-reinstall --no-cache-dir --no-deps git+https://github.com/LennP/PyPi-MotionBlinds_BLE@disconnect_timer_after_still
I set it to version 0.0.9. If you have updated your home assistant in the meantime, let me know then I will set it to 0.1.0 (the version that is in the next home assistant update)
Great! I just installed it and performed some quick tests, so far it works as expected. Logging attached for your info:
home-assistant_motionblinds_ble_2024-06-28T12-45-55.099Z.log
FYI: my blind requires ~36 seconds to fully open/close, this can also be confirmed in the logging. Accordingly it takes 15seconds to disconnect. It also works when I stop the blind manually or when I simply connect or perform an entity_update service call.
This saves me some automation to get the positions right after operating the blinds. What is btw the reason that the current_position attribute is only showed when the blind is connected?
Thanks for your help and effort!
Seems to be working as expected then! I added a few extra logs when you enable these options and when the disconnect timer is canceled:
python -m pip install --force-reinstall --no-cache-dir --no-deps git+https://github.com/LennP/PyPi-MotionBlinds_BLE@disconnect_timer_after_still
What is btw the reason that the current_position attribute is only showed when the blind is connected?
The way the integration works I think it provides for a better user experience if the current_position of the blind goes to unknown, since then the slider in home assistant also goes to unknown, making it easier to know when the blind is disconnected.
Seems to be working as expected then! I added a few extra logs when you enable these options and when the disconnect timer is canceled:
python -m pip install --force-reinstall --no-cache-dir --no-deps git+https://github.com/LennP/PyPi-MotionBlinds_BLE@disconnect_timer_after_still
Just installed the version and do some long term testing. So far the previous one has been working great!
The way the integration works I think it provides for a better user experience if the
current_positionof the blind goes to unknown, since then the slider in home assistant also goes to unknown, making it easier to know when the blind is disconnected.
Makes sense!
EDIT: I just updated HA to 2024.7 which bumps the motionblinds_ble integration to 0.1.0 including the additional sensors and configurable disconnect time. Looks great! Can you also make a pip install command which adds the disconnect_timer_after_still ? Then I can continue testing this function. Thanks!
Good to hear! I will think about making this either an option that can be enabled or enabling it by default. I'm not sure if there exist a situation in which the motor does not report back the end position, causing a permanent connection, so I will have to do some testing.
Can you also make a pip install command which adds the disconnect_timer_after_still ? Then I can continue testing this function. Thanks!
I changed the version of the branch to 0.1.0 so you should be able to use this command again, then the disconnect_timer_after_still is again enabled by default
python -m pip install --force-reinstall --no-cache-dir --no-deps git+https://github.com/LennP/PyPi-MotionBlinds_BLE@disconnect_timer_after_still
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Just to add another data point, this integration was working fine for me in 2024.6.4. I upgraded from that version to 2012.10.2 and now I need to manually press "connect" in order to control the blind. My automations also stopped working, because the blind is always "unknown".
@jantman interesting. Could you create a separate issue for this?
My automations also stopped working, because the blind is always "unknown".
Why is it always unknown? You first need to connect to the blind before the states are updated. Once the blind disconnects, the position goes to unknown again. As far as I know this was also the case in 2024.6.4, so I am not sure why your automations stopped working?
@jantman interesting. Could you create a separate issue for this?
My automations also stopped working, because the blind is always "unknown".
Why is it always unknown? You first need to connect to the blind before the states are updated. Once the blind disconnects, the position goes to unknown again. As far as I know this was also the case in 2024.6.4, so I am not sure why your automations stopped working?
I've opened #128494 for my issue. And please disregard my comment about the entity being unknown; yes, that's always been the behavior, and is obviously not the problem here, sorry for my confusion.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.