Skip to content

Conversation

@starkillerOG
Copy link
Contributor

@starkillerOG starkillerOG commented Jul 31, 2025

Breaking change

The tilt position of Motion Blinds devices has been corrected to allign with the Home Assistant standards.
The new tilt position will be: 0 = closed/covering the window opening, 100 = open/letting light through.
The previous tilt position can be converted to the new tilt postion as follows:

  • new = 100 - old
  • current_tilt_position 100 -> 0
  • current_tilt_position 75 -> 25
  • current_tilt_position 50 -> 50
  • current_tilt_position 25 -> 75
  • current_tilt_position 0 -> 100
  • open_cover_tilt -> close_cover_tilt
  • close_cover_tilt -> open_cover_tilt

Any automations concerning Motion Blinds devices that use the current_tilt_position attribute or use tilt open/close will need to be adjusted.

Proposed change

The motion_blinds integration currently has its tilt direction reversed. This pull request accounts for the difference between the Home Assistant entity model and the Motionblinds implementation.
This PR will flip the tilt position according to new = 100 - old

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the inverted tilt direction in the Motion Blinds integration to align with Home Assistant standards. The change ensures that tilt position 0 means closed/covering the window and 100 means open/letting light through, which is the opposite of the previous behavior.

Key changes:

  • Reverses tilt position calculation using 100 - value formula
  • Swaps open/close tilt commands (open now sets angle to 0, close sets to 180)
  • Updates both angle-based and position-based tilt handling
  • Adds return type annotations to constructor methods
Comments suppressed due to low confidence (2)

homeassistant/components/motion_blinds/cover.py:370

  • Similar to the previous issue, the angle calculation should use the inverted tilt position before converting to device coordinates. The logic should be: angle = (100 - kwargs[ATTR_TILT_POSITION]) * 180 / 100 instead of calculating the angle first and then inverting it.
        angle = kwargs[ATTR_TILT_POSITION]

homeassistant/components/motion_blinds/cover.py:387

  • The angle calculation in async_set_absolute_position should also use the inverted position before converting to device coordinates: angle = (100 - kwargs[ATTR_POSITION]) * 180 / 100
            return

@RyanMorash
Copy link

Is this ready for a review?

@starkillerOG
Copy link
Contributor Author

starkillerOG commented Aug 27, 2025

@RyanMorash yes this is ready for review.
You can ignore the coverage test, this integration does not have tests besides the obligated config flow tests.

Copy link

@RyanMorash RyanMorash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me


_restore_tilt = False

def __init__(self, coordinator, blind, device_class):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about is_closed()and current_cover_position(), do they need reversing as well? If not then at least the docstring still seems wrong.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only the tilt position that had the issue. current_cover_position is not affected. I'm unsure if the is_closed property is supposed to reflect both the current_cover_position and the current_cover_tilt_position.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then only the documentation should be fixed. I could not find anything on the question if tilt should be reflected in is_closed(), my personal opinion is no.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wollew the is_closed and current_cover_position were already reversed from the start.
This is because open and closed are more clearly defined for those states and I had a rollerblind for testing when I first wrote the code.

So no they do not need any changes.

Copy link
Member

@abmantis abmantis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@abmantis abmantis merged commit 224553f into home-assistant:dev Oct 7, 2025
32 of 34 checks passed
peteS-UK pushed a commit to peteS-UK/ha-core that referenced this pull request Oct 8, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tilt Direction Reversed on Bliss Blinds

4 participants