Skip to content

Shelly Cover - Position and Tilt sent as separate RPC calls, causing race condition #165902

Description

@Franklins59

The problem

Shelly Cover: Position and Tilt sent as separate RPC calls, causing race condition

The problem

When a Shelly 2PM (Gen2+) has slat control enabled, Home Assistant sends pos and slat_pos as two separate Cover.GoToPosition RPC calls. The second call interrupts/overrides the first, resulting in only the tilt (slat) being executed while the cover position change is ignored.

The Shelly firmware supports both parameters in a single RPC call (Cover.GoToPosition?id=0&pos=100&slat_pos=100), which works correctly. The HA integration should combine them.

Environment

  • Home Assistant Core (latest as of March 2026)
  • Shelly 2PM Gen2 and Gen3 devices
  • Firmware: 1.7.x
  • Integration: built-in Shelly integration
  • Slat control enabled via device settings (slat.enable: true)

Reproduction steps

  1. Enable slat control on a Shelly 2PM: Cover.SetConfig with "slat":{"enable":true}
  2. Close the cover fully (position 0, tilt 0)
  3. Create a scene in HA that sets the cover to current_position: 100 and current_tilt_position: 100
  4. Activate the scene
  5. Expected: Cover moves to position 100 AND tilt moves to 100
  6. Actual: Only the tilt moves to 100, cover stays at position 0
  7. Activating the scene a second time then correctly moves the cover (because tilt is already at target)

Root cause verification via curl

Direct RPC calls to the Shelly device confirm the issue is about separate vs. combined calls:

Two simultaneous calls — FAILS (reproduces the HA behavior)

curl -s "http://<shelly-ip>/rpc/Cover.GoToPosition?id=0&pos=100" &
curl -s "http://<shelly-ip>/rpc/Cover.GoToPosition?id=0&slat_pos=100"

Result: Only slat moves, cover position is ignored.

Single combined call — WORKS

curl -s "http://<shelly-ip>/rpc/Cover.GoToPosition?id=0&pos=100&slat_pos=100"

Result: Both cover position and slat move correctly.

Sequential calls with delay — WORKS

curl -s "http://<shelly-ip>/rpc/Cover.GoToPosition?id=0&pos=100"
sleep 3
curl -s "http://<shelly-ip>/rpc/Cover.GoToPosition?id=0&slat_pos=100"

Result: Both execute correctly.

Shelly device configuration reference

The slat configuration is nested under slat in Cover.GetConfig:

{
  "id": 0,
  "name": "jalousie_buero",
  "motor": {"idle_power_thr": 2.00, "idle_confirm_period": 0.25},
  "maxtime_open": 90.00,
  "maxtime_close": 90.00,
  "slat": {
    "enable": true,
    "open_time": 1.50,
    "close_time": 1.50,
    "step": 20,
    "retain_pos": false,
    "precise_ctl": true
  }
}

Suggested fix

When both position and tilt_position need to be set, combine them into a single Cover.GoToPosition RPC call with both pos and slat_pos parameters, instead of issuing two separate calls.

Additional context

  • supported_features changes from 15 to 255 when slat control is enabled
  • The issue affects scenes, but individual service calls (cover.set_cover_position, cover.set_cover_tilt_position) work correctly when called manually one at a time
  • Approximately 15-20 cover devices are affected in a typical installation
  • Workaround: disable slat control on all devices and use small position values (e.g., current_position: 2) to simulate tilt

What version of Home Assistant Core has the issue?

2026.3.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Shelly

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

Additional information

No response

Activity

  1. home-assistant commented on Mar 18, 2026

    @home-assistant
    Contributor

    Hey there @bieniu, @thecode, @chemelli74, @bdraco, mind taking a look at this issue as it has been labeled with an integration (shelly) you are listed as a code owner for? Thanks!

    Code owner commands

    Code owners of shelly can trigger bot actions by commenting:

    • @home-assistant close Closes the issue.
    • @home-assistant rename Awesome new title Renames the issue.
    • @home-assistant reopen Reopen the issue.
    • @home-assistant unassign shelly Removes the current integration label and assignees on the issue, add the integration domain after the command.
    • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the issue.
    • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the issue.

    (message by CodeOwnersMention)


    @Franklins59 Thanks for reporting this issue!

    Before we dive in, please make sure this isn't a duplicate by searching through existing issues. Also check recently closed issues, as your problem might already be fixed but not yet released.

    https://github.com/home-assistant/core/issues?q=%20label%3A%22integration%3A%20shelly%22%20
    If your issue is related to Shelly generation 1 device, make sure you have configured CoIoT peer correctly.

    If your issue is related to battery powered Shelly generation 2/3/4 devices, make sure you have configured Outbound WebSocket correctly.

    Please enable Shelly debug logging, let it run for 10-15 minutes, and make sure to capture whatever problem you're having in the debug log.
    Note: it is better to drag the log file into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub.

    Finally, be sure to include diagnostics for the Shelly device you're having problems with.
    (message by IssueContext)


    shelly documentation
    shelly source
    (message by IssueLinks)

  2. Franklins59 commented on Mar 19, 2026

    @Franklins59
    Author

    This is a duplicate of #148743, which was closed as stale without being fixed. I have now provided concrete curl test results proving the root cause: the integration sends pos and slat_pos as two separate RPC calls instead of combining them into a single Cover.GoToPosition call. The Shelly firmware supports both parameters in one call and works correctly when used that way.

  3. changed the title [-]Ha shelly bug report[/-] [+]Shelly Cover - Position and Tilt sent as separate RPC calls, causing race condition[/+] on Apr 5, 2026
  4. thecode commented on Apr 5, 2026

    @thecode
    Member

    The reason #148743 was not progressed is that this problem is outside of the Shelly integration, Shelly integration only adapts between Home Assistant services (open/close/set cover position/set tilt) to the device, we receive this from Home Assistant as two separate calls and I have not found a solution that can fix that.

  5. issue-triage-workflows commented on Jul 4, 2026

    @issue-triage-workflows

    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.

  6. issue-triage-workflows commented on Oct 4, 2026

    @issue-triage-workflows

    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.

  7. thecode commented on Oct 6, 2026

    @thecode
    Member

    Still on my task list, removing the stale one last time, hopefully to fix this before it become stale again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions