home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.34k stars 30.64k forks source link

Recorder: Purge entities - Entity globs Syntax Issue #129550

Open JCalvi opened 4 days ago

JCalvi commented 4 days ago

The problem

In creating an Automation or Script, and when you use the visual editor to add an action to purge multiple entity globs, and then add them intuitively one by one into the visual editor, and then after saving the automation or script, the resulting yaml ends up like...

action: recorder.purge_entities
data:
  keep_days: 1
  entity_globs: binary_sensor.sp5500_zone_*  sensor.actron_que_air_conditioner_home_*

This runs and reports no errors but does not purge anything. The code requires the yaml to look like this:

action: recorder.purge_entities
data:
  keep_days: 1
  entity_globs:
    - binary_sensor.sp5500_zone_*
    - sensor.actron_que_air_conditioner_home_*

Which requires the user to put dashes into the visual editor which is not intuitive. The visual editor should combine the entity globs in a syntax that will work, or the backend needs to accept both syntax possibilities, or at the very least a warning to add the "-" manually per entity glob.

I can add screen captures as well if required.

What version of Home Assistant Core has the issue?

2024.10.4

What was the last working version of Home Assistant Core?

Unknown

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

pedolsky commented 3 days ago

sensor.sp5500zone* sensor.actron_que_airconditioner

is not a list, separate the enumeration with commas to create a list.

JCalvi commented 3 days ago

I know that. Tell the visual editor. It’s the mechanism that did not create a correctly formatted list when you enter items in the boxes labelled 1. 2. etc. A typical user would expect when they input entities into the provided entity boxes that the backend will create the correctly formatted yaml.

pedolsky commented 2 days ago

It's rather a frontend „issue“ regarding the kind of automation/script selectors displayed as fields in the visual editor.

JCalvi commented 2 days ago

Yes, it probably is. Perhaps I have raised this in the wrong section. Can someone move this to “front end” if appropriate?