Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(overkiz): fire event on execution failure for retry logic#173155

Draft
NicolasRoehm wants to merge 1 commit into
home-assistant:devhome-assistant/core:devfrom
NicolasRoehm:feat/expose-execution-failureNicolasRoehm/core:feat/expose-execution-failureCopy head branch name to clipboard
Draft

feat(overkiz): fire event on execution failure for retry logic#173155
NicolasRoehm wants to merge 1 commit into
home-assistant:devhome-assistant/core:devfrom
NicolasRoehm:feat/expose-execution-failureNicolasRoehm/core:feat/expose-execution-failureCopy head branch name to clipboard

Conversation

@NicolasRoehm
Copy link
Copy Markdown

Proposed change

When a device command fails to execute (e.g. a Somfy IO motor is temporarily unreachable), the Overkiz integration silently drops the failure — the execution is removed from the coordinator dict with no log entry, no HA event, and no way for automations to react.

This is particularly problematic for covers/shutters where the only workaround today is polling current_position after a delay, which produces false positives when users manually operate the shutter with a physical remote between the command and the check.

What this PR does

In on_execution_state_changed(), when new_state == ExecutionState.FAILED:

  1. Logs a warning with exec_id, device_url, command_name, and failure_type
  2. Fires a overkiz_execution_failed event on the HA event bus with all available failure data (device_url, command_name, failure_type, failure_type_code)

Why this matters

The ExecutionStateChangedEvent from the Overkiz API already carries rich failure information (failed_commands, failure_type, failure_type_code) — it was simply being discarded. This PR surfaces that data so users can build reliable automations.

Example automation (after this PR is merged)

trigger:
  - platform: event
    event_type: overkiz_execution_failed
action:
  - delay: "00:01:00"
  - service: cover.set_cover_position
    target:
      entity_id: "{{ ... }}"
    data:
      position: "{{ ... }}"

Breaking change

None. This is purely additive — it adds a log line and an event that existing code can safely ignore.

Testing

  • Tested on a Somfy IO setup with forced communication failure
  • Verified the event payload is correctly populated
  • Verified no regression on normal (successful) execution flow

Related issue

None yet — this PR is prompted by real-world experience with Somfy IO shutters where commands occasionally fail due to temporary radio interference and currently go undetected.

Copilot AI review requested due to automatic review settings June 6, 2026 13:11
@home-assistant home-assistant Bot added cla-error integration: overkiz small-pr PRs with less than 30 lines. Top 200 Integration is ranked within the top 200 by usage labels Jun 6, 2026
Copy link
Copy Markdown
Contributor

@home-assistant home-assistant Bot left a comment

Choose a reason for hiding this comment

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

Hello @NicolasRoehm,

When attempting to inspect the commits of your pull request for CLA signature status among all authors we encountered commit(s) which were not linked to a GitHub account, thus not allowing us to determine their status(es).

The commits that are missing a linked GitHub account are the following:

Unfortunately, we are unable to accept this pull request until this situation is corrected.

Here are your options:

  1. If you had an email address set for the commit that simply wasn't linked to your GitHub account you can link that email now and it will retroactively apply to your commits. The simplest way to do this is to click the link to one of the above commits and look for a blue question mark in a blue circle in the top left. Hovering over that bubble will show you what email address you used. Clicking on that button will take you to your email address settings on GitHub. Just add the email address on that page and you're all set. GitHub has more information about this option in their help center.

  2. If you didn't use an email address at all, it was an invalid email, or it's one you can't link to your GitHub, you will need to change the authorship information of the commit and your global Git settings so this doesn't happen again going forward. GitHub provides some great instructions on how to change your authorship information in their help center.

    • If you only made a single commit you should be able to run
      git commit --amend --author="Author Name <email@address.com>"
      
      (substituting "Author Name" and "email@address.com" for your actual information) to set the authorship information.
    • If you made more than one commit and the commit with the missing authorship information is not the most recent one you have two options:
      1. You can re-create all commits missing authorship information. This is going to be the easiest solution for developers that aren't extremely confident in their Git and command line skills.
      2. You can use this script that GitHub provides to rewrite history. Please note: this should be used only if you are very confident in your abilities and understand its impacts.
    • Whichever method you choose, I will come by to re-check the pull request once you push the fixes to this branch.

We apologize for this inconvenience, especially since it usually bites new contributors to Home Assistant. We hope you understand the need for us to protect ourselves and the great community we all have built legally. The best thing to come out of this is that you only need to fix this once and it benefits the entire Home Assistant and GitHub community.

Thanks, I look forward to checking this PR again soon! ❤️

@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented Jun 6, 2026

Hey there @iMicknl, mind taking a look at this pull request as it has been labeled with an integration (overkiz) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of overkiz can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign overkiz Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @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 pull request.
  • @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 pull request.

Copy link
Copy Markdown
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

Note

Copilot was unable to run its full agentic suite in this review.

This PR enhances the Overkiz integration's execution state change handler by adding failure logging and firing a Home Assistant bus event when an execution fails, providing better observability for failed commands.

Changes:

  • Refactored the early-return logic to exit immediately when exec_id is not tracked
  • Added a warning log with execution details (device URL, command name, failure type) on execution failure
  • Added firing an overkiz_execution_failed bus event with failure details for downstream consumers

Comment on lines +234 to +235
execution.get("device_url", "unknown"),
execution.get("command_name", "unknown"),
Comment on lines +238 to +239
coordinator.hass.bus.async_fire(
"overkiz_execution_failed",
@NicolasRoehm NicolasRoehm force-pushed the feat/expose-execution-failure branch from eea4e78 to 00e90bf Compare June 6, 2026 13:22
Copy link
Copy Markdown
Contributor

@home-assistant home-assistant Bot left a comment

Choose a reason for hiding this comment

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

Hi @NicolasRoehm

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

Copilot AI review requested due to automatic review settings June 6, 2026 13:36
@NicolasRoehm NicolasRoehm force-pushed the feat/expose-execution-failure branch from 00e90bf to f6d4ec7 Compare June 6, 2026 13:36
Copy link
Copy Markdown
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread homeassistant/components/overkiz/coordinator.py Outdated
@NicolasRoehm
Copy link
Copy Markdown
Author

@home-assistant add-label new-feature

@NicolasRoehm
Copy link
Copy Markdown
Author

@home-assistant ready-for-review

@NicolasRoehm NicolasRoehm force-pushed the feat/expose-execution-failure branch from f6d4ec7 to a2d3071 Compare June 6, 2026 13:47
@NicolasRoehm NicolasRoehm marked this pull request as ready for review June 6, 2026 13:52
Copilot AI review requested due to automatic review settings June 6, 2026 13:52
@NicolasRoehm NicolasRoehm requested a review from iMicknl as a code owner June 6, 2026 13:52
Copy link
Copy Markdown
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread homeassistant/components/overkiz/const.py
When a device command fails (e.g. Somfy IO motor unreachable), the
integration silently discarded the failure. This logs a warning and
fires a 'overkiz_execution_failed' event so automations can react.
@NicolasRoehm NicolasRoehm force-pushed the feat/expose-execution-failure branch from a2d3071 to ae91525 Compare June 6, 2026 13:57
Copy link
Copy Markdown
Member

@iMicknl iMicknl left a comment

Choose a reason for hiding this comment

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

@NicolasRoehm thanks for your contribution! This is a valid change, but please do use the original pull request template. This feels like an AI generated PR.

If possible, please add tests.

@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented Jun 6, 2026

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant Bot marked this pull request as draft June 6, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-error cla-signed integration: overkiz Quality Scale: No score small-pr PRs with less than 30 lines. Top 200 Integration is ranked within the top 200 by usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.