Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sunset trigger and sun.sun state not in sync #115743

Open
sallygal1 opened this issue Apr 17, 2024 · 2 comments
Open

Sunset trigger and sun.sun state not in sync #115743

sallygal1 opened this issue Apr 17, 2024 · 2 comments

Comments

@sallygal1
Copy link

The problem

I'm using the sun.sun sunset trigger in my automation (among others). Additionally I have an automation condition to confirm that the state of sun.sun is below_horizon. This has been working fine so far. I suspect there is a new bug, introduced in #113544 @bdraco

Now, once the sun.sun sunset trigger fires, the sun's state sometimes is below_horizon but sometimes also above_horizon (altough the trigger just fired).

To reproduce create an automation with a sunset trigger and a condition with sun state below_horizon. You will notice, sometimes the automation condition is false.

And interestingly, some other automation in my system is working fine:

What version of Home Assistant Core has the issue?

core-2024.4.2

What was the last working version of Home Assistant Core?

core-2024.3.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

sun

Link to integration documentation on our website

https://www.home-assistant.io/integrations/sun/

Diagnostics information

No response

Example YAML snippet

alias: Sun trigger error
description: Sun trigger error
trigger:
  - platform: sun
    event: sunset
condition:
  - condition: state
    entity_id: sun.sun
    state: below_horizon
mode: single

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @Swamp-Ig, mind taking a look at this issue as it has been labeled with an integration (sun) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of sun 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 sun 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) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


sun documentation
sun source
(message by IssueLinks)

@Swamp-Ig Swamp-Ig removed their assignment Apr 17, 2024
@atx32
Copy link

atx32 commented May 16, 2024

I am seeing the same issue, with about a 2-minute difference between the sunset/sunrise trigger and the state updating.

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

No branches or pull requests

3 participants