home-assistant / frontend

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

Automation Issue with !secret tag #19871

Open meluvalli opened 4 months ago

meluvalli commented 4 months ago

Checklist

Describe the issue you are experiencing

If you use the tag "!secret" to reference secrets.yaml in automations.yaml, you receive an error in FE saying "This automation cannot be edited from the UI, because it is not stored in the automations.yaml file, or doesn't have an ID."

Describe the behavior you expected

This error shouldn't be there and the automation does have ID's associated with them. If you remove all references from !secret, this problem goes away.

Steps to reproduce the issue

  1. Create automation in YAML.
  2. Reference !secret yaml in automation.
  3. Save automation and reload.
  4. Go to FE Settings/Automations.
  5. Select any automation and it'll show the error. ...

What version of Home Assistant Core has the issue?

2024.2.3

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

All (N/A)

Which operating system are you using to run this browser?

N/A

State of relevant entities

No response

Problem-relevant frontend configuration

- alias: Security Arm Stay Switch
  id: 958c51c9d9104e5294da50a083645bd7
  trigger:
    - platform: state
      entity_id: input_boolean.security_arm_stay
      to: "on"
  action:
    - service: alarm_control_panel.alarm_arm_home
      data:
        entity_id: alarm_control_panel.home_alarm_system
        code: !secret alarm_code
    - service: lock.lock
      entity_id: lock.b051mxjg_lock_mechanism

Javascript errors shown in your browser console/inspector

No response

Additional information

FYI: This was also reported in the community forum.
https://community.home-assistant.io/t/this-automation-cannot-be-edited-from-the-ui/557254/3

ildar170975 commented 4 months ago

After migrating automations forget about using yaml features like secrets, include, anchors, packages. Consider this as similar to a "storage mode" of Lovelace.

Midnitte commented 2 months ago

Glad to see someone created an issue for this - it would be excellent if secrets were allowed within the editor since Home Assistant is very focused on the UI/UX of things. At the very least, there should be a more descriptive error than Response error: 500