Skip to content

Conversation

@Skaronator
Copy link
Contributor

@Skaronator Skaronator commented Oct 29, 2025

Proposed change

Similar to my previous PRs that aim to bring feature parity between the backend and frontend in the automation editor, this PR introduces one of the final major missing pieces: negated triggers. It adds support for the not_from and not_to automation states, aligning the frontend with the backend capabilities.

I tried a few different UI/UX ideas, like a toggle for inversion or a dropdown for the match operator, but I think the current version feels like the best balance of clarity and usability.

vivaldi_80a9A14xFh.mp4

Disclaimer: I’m not a frontend developer (anymore), so this is the best implementation I could come up with. I also used codex, so yeah this is done using AI. It looks and works fine, but if there’s a cleaner or more elegant approach, feel free to improve it! ❤️

Type of change

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

Example configuration

See docs: https://www.home-assistant.io/docs/automation/trigger/#state-trigger

trigger: state
entity_id:
  - sensor.backup_backup_manager_state
not_to:
  - blocked
not_from:
  - receive_backup
  - restore_backup

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

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

@Skaronator Skaronator changed the title Automation editor: support for negated trigger Automation editor: support for negated state trigger Oct 29, 2025
@Skaronator Skaronator marked this pull request as draft October 29, 2025 18:56
@Skaronator Skaronator marked this pull request as ready for review October 29, 2025 20:57
@timmo001
Copy link
Member

I really like the idea behind this, but it over complicates the UX IMO (as well as introducing 2 more keys). While less practical, I personally would trigger on any state and use the conditions to control whether to continue in this case

Something like:
image

@bramkragten bramkragten added editor: automation Needs UX Pull requests requiring a review from the Home Assistant design team labels Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed editor: automation hacktoberfest Needs UX Pull requests requiring a review from the Home Assistant design team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants