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

Short-lived toggles broken after 2024.5.0 front-end update #20807

Open
4 tasks done
tyron opened this issue May 16, 2024 · 2 comments
Open
4 tasks done

Short-lived toggles broken after 2024.5.0 front-end update #20807

tyron opened this issue May 16, 2024 · 2 comments

Comments

@tyron
Copy link

tyron commented May 16, 2024

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

I have an automation that immediately turns off a toggle when it is turned on. Up until 2024.5.0 version, I could trigger the toggle in the UI and it would very quickly turned off. After this version, the toggle seems to not be updated anymore.
If I add a delay to my automation, then it works fine again.

Initially I thought this was related to core, but during my tests, it still worked well after HA was updated to 2024.5.0, and it only starts failing after I got the "there's a new frontend version" and I reloaded the scripts.

Describe the behavior you expected

As before, I expected the toggle to be immediately switched off after turned on.

Steps to reproduce the issue

  1. Create a new Toggle Helper (e.g. input_boolean.toggle_1)
  2. Create a new automation with the following:
trigger:
- platform: state
  entity_id:
  - input_boolean.toggle_1
  to: 'on'
condition: []
action:
- service: input_boolean.turn_off
  metadata: {}
  data: {}
  target:
    entity_id:
    - input_boolean.toggle_1
mode: single
  1. Open the entity window for the Toggle and turn it on. Up until 2024.5.0, the toggle would immediately turn off. Starting on this version, the toggle is not turned off anymore.
  2. If you add a delay as the first step of the automation above, then everything works again.
    ...

What version of Home Assistant Core has the issue?

core-2024.5.1

What was the last working version of Home Assistant Core?

core-2024.4.4

In which browser are you experiencing the issue with?

Google Chrome 124.0.6367.119

Which operating system are you using to run this browser?

macOS Sonoma 14.4.1

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

This shows the behaviour I'm seeing: https://imgur.com/a/TNinCtD
The first 50 seconds show the previous behaviour, then the last 10 seconds is after the frontend is refreshed.

@ildar170975
Copy link
Contributor

ildar170975 commented May 16, 2024

The input_boolean helper is actually toggled to off - but UI is not updated.
Have to press F5.

Test card:

type: vertical-stack
cards:
  - type: entities
    entities:
      - entity: input_boolean.flag
        secondary_info: last-changed
      - entity: automation.test_toggle_off
        secondary_info: last-triggered
  - type: logbook
    entities:
      - entity: input_boolean.flag

Initial state:
изображение

After manual toggling the helper to ON:
-- the helper is still ON;
-- in logbook: a record "toggled by automation to OFF" is BEFORE a record "manually toggled to ON".
изображение

After F5:
-- the helper is OFF;
-- there is no record "toggled by automation to OFF" in logbook.
изображение

Turn the helper ON again:
изображение

After F5:
изображение

Turn the helper ON again:
изображение

After F5:
изображение

See no logic here:
-- a wrong sequence in logbook - "changed by automation" before "changed by user";
-- why the 1st record "changed by automation" disappeared;
-- why records "changed by automation" replaced by "turned off triggered by state..."

@silamon
Copy link
Contributor

silamon commented May 20, 2024

Bisected to core, I've opened home-assistant/core#117781 to track this issue further. Thank you both for the clear examples.

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

No branches or pull requests

3 participants