Skip to content

Support for timestamp sensors in time trigger automation UI#15292

Merged
piitaya merged 6 commits into
home-assistant:devfrom
karwosts:time-trigger-fix
Feb 20, 2023
Merged

Support for timestamp sensors in time trigger automation UI#15292
piitaya merged 6 commits into
home-assistant:devfrom
karwosts:time-trigger-fix

Conversation

@karwosts
Copy link
Copy Markdown
Member

Proposed change

In the automation editor for time trigger, the entity selector currently only populates with entities of domain input_datetime. The time trigger also supports entities of domain sensor, if those entities have a device_class of timestamp.

This change adds the sensors with device_class: timestamp to the entity selector.

A similar change is probably warranted in the time condition form as well. I will request approval for this code before duplicating it into the time condition as well.

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

Additional information

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:

Comment thread src/panels/config/automation/trigger/types/ha-automation-trigger-time.ts Outdated
Comment thread src/panels/config/automation/trigger/types/ha-automation-trigger-time.ts Outdated
@piitaya
Copy link
Copy Markdown
Member

piitaya commented Feb 1, 2023

It will be easier if we can use inside selector

{
  entity: {
    filter: [
      { domain: "input_datetime" },
      { domain: "sensor", device_class: "timestamp" },
    ]
  }
}

karwosts and others added 3 commits February 1, 2023 06:00
Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
@karwosts
Copy link
Copy Markdown
Member Author

karwosts commented Feb 1, 2023

I'll put a hold on this until #15302 is done.

@karwosts karwosts marked this pull request as draft February 1, 2023 23:11
@karwosts karwosts marked this pull request as ready for review February 20, 2023 14:21
@karwosts
Copy link
Copy Markdown
Member Author

Updated to use the new entity filter options.

@piitaya piitaya added this to the 2023.3 milestone Feb 20, 2023
@piitaya piitaya enabled auto-merge (squash) February 20, 2023 14:28
@piitaya piitaya merged commit d5fb924 into home-assistant:dev Feb 20, 2023
@karwosts karwosts deleted the time-trigger-fix branch March 6, 2023 16:31
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 5, 2024
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.

No entities with "timestamp" attribute listed when using "Time" trigger in automations

2 participants