Skip to content

Conversation

@CZDave
Copy link

@CZDave CZDave commented Sep 12, 2025

My change adds support for sending multiple commands to multiple devices at once. I wanted to control multiple windows covers from Home Assistant using Local API and found out that it was slower and was causing issues when I wanted to close all my covers at once (10 devices) for example.

I started working on a modification for the core Overkiz integration in Home Assistant to support this use case from scripts, but realized that I needed to add the support to the API Client first.

Sample usage:

client.execute_actions(
    [
        Action(device_url1, [Command(OverkizCommand.CLOSE)]),
        Action(device_url2, [Command(OverkizCommand.CLOSE)]),
    ]
)

@iMicknl
Copy link
Owner

iMicknl commented Sep 20, 2025

Thanks for your contribution @CZDave! Would it be an idea to first implement this in the Home Assistant core integration, and merge this one when you have found a good implementation? This would make it easier to make changes to pyoverkiz if needed, as we prefer to not have breaking changes after release.

You can point Home Assistant to your current feature branch.

@iMicknl
Copy link
Owner

iMicknl commented Sep 20, 2025

My personal preference is to revamp the action executions in this library anyways, and make it better typed and have a single function that can do one or multiple calls.

@CZDave
Copy link
Author

CZDave commented Sep 20, 2025

Hi @iMicknl, this is my current work in progress for the HA core: home-assistant/core@dev...CZDave:ha-core:overkiz-covers-batch-commands

I've got a few batch services ready there, they support both regular covers and cover group helpers, so you can create a group of multiple covers in HA and then call for example batch_set_cover_position on the whole group with one API request.

I plan to create a PR from that branch soon, but it won't work without this PR for pyoverkiz. I think these shouldn't be breaking changes.

Please let me know if you think this is a good idea or not. Thanks in advance!

@iMicknl
Copy link
Owner

iMicknl commented Sep 20, 2025

Thanks @CZDave, this would be a good quick workaround, but such additional services won't be accepted in Home Assistant core.

You will need to implement some kind of queuing mechanism in the integration (or underlying package), where all normal HA services/features can be used, but the batching is taken care of automatically.

@CZDave
Copy link
Author

CZDave commented Sep 20, 2025

I see. In that case I think you can close this PR. Thank you for taking your time on this.

I'll see if I can find some time to look into implementing an automatic queueing mechanism. If I'm able to implement that in the integration, would you consider pulling something like this PR to pyoverkiz to support it? Or would you rather have some revamped version as you mentioned first?

@iMicknl
Copy link
Owner

iMicknl commented Oct 12, 2025

An automatic queuing mechanism would definitely be accepted! Here I am not sure yet if we should have this in the Overkiz integration in Home Assistant or in the underlying library, perhaps having it in this library might even be better.

The command execution is quite barebones at the moment, which causes some limitations when running multiple automations and also the code is not great typed I would say..

Feel free to ping me on Discord as well (_imick) if you want to discuss.

@iMicknl
Copy link
Owner

iMicknl commented Dec 28, 2025

Apologies for the delay @CZDave! I will review this in more detail in the coming weeks, and I am also looking if we can rewrite parts of this library (with breaking changes) for a v2.

There are still a few items where I am not sure yet:

  • Should we include a queue in the underlying library, or will this needs to be implemented in the client (e.g. Home Assistant).
  • How should we structure the functions in this library to execute commands? Would this be to difficult (when users have to type Action and Command)

See #1862

@iMicknl iMicknl marked this pull request as draft December 29, 2025 21:03
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

Successfully merging this pull request may close these issues.

2 participants