home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
3.96k stars 2.69k forks source link

Scripts disappearing from UI after a while #21678

Open acenuke opened 1 month ago

acenuke commented 1 month ago

Checklist

Describe the issue you are experiencing

After the upgrade to 2024.8.0, the scripts were there for a few minutes, then all became unavailable (the UI does not list them anymore). The code is still available in scripts.yaml. If I restart HAOS, they come back for a few minutes then are unavailable again. I tried to create a brand new script from the UI and same behaviour. The script is also not available anymore when searching (but it is available in the script.yaml file). I am NOT using notify in the script (it just turns off a bunch of lights).

After reboot (all normal) Script visible

After a few minutes/hours (Script disappears from UI and search) Script disappeared from UI Script can be found anymore when searching for it

The issue still happens with 2024.8.1

I originally posted this issue in Core (https://github.com/home-assistant/core/issues/123468), but it seems to be more UI related, as I can start the script from the Dev Tools.

Describe the behavior you expected

Be able to see the scripts in UI and in search all the time

Steps to reproduce the issue

  1. Create a script via UI or editing script.yaml directly and reloading
  2. Wait
  3. Script is not in UI anymore ...

What version of Home Assistant Core has the issue?

core-2024-08-01

What was the last working version of Home Assistant Core?

core-2024-07-04

In which browser are you experiencing the issue with?

Chrome 127.0.6533.100 Edge 127.0.2651.98

Which operating system are you using to run this browser?

Windows 11, Android 14 and 15

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

N/A

Additional information

No response

silamon commented 1 month ago

Check off "I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources." just to be sure it's not a custom component. Also, under dev tools, use the state page to check if they are still provided there, not the action tab.

acenuke commented 1 month ago

Here is a screenshot of the Dev Tools state page (script is not found): image

I will try to run in safe mode, but I can't do that too long, as I need my Ha to be up and running. Since the issue can sometimes take hours to happen, not sure I will have enough time to reproduce

acenuke commented 1 month ago

By the way, if I run the script from Actions, then I can see the script again in States (until it disappears again): image

silamon commented 1 month ago

The safe mode is a requirement since I can't reproduce it and no one else has joined you in having this bug. Chances are big it is a core issue after all as it seems like the entity is removed somehow.

acenuke commented 1 month ago

It happened as well in safe mode. Just took almost 24h instead of a few hours

zoechi commented 3 weeks ago

I have a similar issue since updateing to 2024.08. The issue also shows in Safe Mode.

Not one script is shown.

Also this sensor is always shown as unavailable I have seen it in Devices > Helpers after the update, but now it's not visible (without any changes at all in the meantime except restart)

───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: packages/bathroom_light.yaml
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ template:
   2   │ - binary_sensor:
   3   │   - name: "Illuminance Threshold Bathroom"
   4   │     unique_id: "illuminance_threshold_bathroom"
   5   │     state: >-
   6   │       {{ states('sensor.bathroom_motion_illuminance') | float(100.0) < 45 }}
   7   │ 
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

even though in Developer tools > TEMPLATE this results to TRUE

{{ states('sensor.bathroom_motion_illuminance') | float(100.0) < 45 }}

I couldn't find anything in the logs that looked related

silamon commented 3 weeks ago

It must be related to something somehow, as it's not really the mass of replies in this report. I would appreciate it if somebody could debug into this further.

zoechi commented 3 weeks ago

It might not be a frontend issue because I get this error

The automation "blinds_manual_during_night" (automation.blinds_manual_during_night) has an unknown action: script.blinds_manual_turn_on.

So it's not just that the scripts don't show, they also can not be executed.

When I edit the automation no scripts are listed in actions to chose from.

zoechi commented 3 weeks ago

It looks like I messed up.

My setting vanished

homeassistant:
  packages: !include_dir_merge_named packages/

(from https://www.home-assistant.io/docs/configuration/packages/)

Re-adding fixed it