home-assistant / frontend

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

Automations: switching from the GUI editor to YAML and back does create invalid yaml for conditions with state lists #7600

Closed hal2100 closed 3 years ago

hal2100 commented 3 years ago

The problem

Editing an automation with a state list in the conditions first in the file editor in pure yaml and opening the same automation in the UI editor changes the yaml of the conditions and makes it invalid. Same happens if an automation is entered in the new automation YAML editor and one switches to the UI editor and back to the YAML editor.

Environment

Problem-relevant automation.yaml

Example condition with valid yaml

condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: sensor.easee_home_XXXXX_status
        state:
          - CAR CONNECTED
          - READY TO CHARGE
          - CHARGING
          - PAUSED

Result of the same block after opening the automation in the UI editor, auto-generated and invalid (it seems):

condition:
  - condition: and
    conditions:
      - condition: state
        entity_id: sensor.easee_home_XXXXX_status
        state: 'CAR CONNECTED,READY TO CHARGE,CHARGING,PAUSED'
probot-home-assistant[bot] commented 3 years ago

automation documentation automation source (message by IssueLinks)

frenck commented 3 years ago

I've moved this issue to the frontend repository because I think the problem relies within the frontend (I might be wrong though, in that case we should move it back).

spacegaier commented 3 years ago

Duplicate of https://github.com/home-assistant/frontend/issues/6664.

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.