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

Exclude description sections of automations.yaml (entities noted in comment sections) #71

Open
bcutter opened this issue Dec 26, 2022 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@bcutter
Copy link

bcutter commented Dec 26, 2022

Problem: Currently Watchman also finds and lists entities which are used in the comment sections of automations. This triggers false positives - and makes (based on the intensity of individual documentation/commenting) using this basically absolutely great integration a bit useless. 😞

Feature Request: Ignore all entites from the description: sections of automations.yaml

Example:

+--------------------------------------------------------------+-----------------+--------------------------------------------------------------+
| Entity ID                                                    | State           | Location                                                     |
+--------------------------------------------------------------+-----------------+--------------------------------------------------------------+
| group.anwesenheit_zuhause                                    | missing         | automations.yaml:1575,3896,4151,8725                         |

Actual automations.yaml snippet:

- id: 'XXXXXXXXXXXXXX'
  alias: Automation
  description: '...
    ...
    - Von "group.anwesenheit_zuhause" (state: home|not_home) auf "zone.home" (numeric_state:
    0|!0) umgestellt
    ...'

This should remove false positives massively. Looking at some (former) issues and reports, plenty of those findings for others too.

Manually setting those entities on the ignore list is only workaround - if at all.

@bcutter
Copy link
Author

bcutter commented Dec 26, 2022

Plus (more improvement to reduce false positives):

@Hiekkaharju
Copy link

This part is pretty much same as #56

@bcutter
Copy link
Author

bcutter commented Dec 26, 2022

You're right. So ignore that additional post for now and let's focus on the original one.

At the same time both share the same target - getting rid of unnecessary false positives.

@bcutter
Copy link
Author

bcutter commented Dec 28, 2022

Meanwhile I discovered that the integration alreay ignores certain entities, usually when there's a # close or directly before the entity, e. g. this is a text and this is a #sensor.entity.

Unfortunately, that's not enough for the basic issue, as comment sections spread over a certain amount of text. But maybe this "comment section detection" can be extended to also address and solve this issue.

@DataBitz
Copy link

DataBitz commented Sep 9, 2023

This also affects automation blueprints which are not deployed.

input:
power_sensor_1_entity:
name: Power Sensor 1
description: This is the main power sensor that will be used to measure load (e.g. sensor.main_meter_power)
selector:
entity:
filter:
- domain: sensor
device_class: power

image

@dummylabs dummylabs self-assigned this Nov 20, 2024
@dummylabs dummylabs added the enhancement New feature or request label Nov 20, 2024
@dummylabs
Copy link
Owner

dummylabs commented Nov 22, 2024

In version 0.6.4 single-line description: and example: fields will be excluded from parsing. As far as I can see, multiline descriptions are not prohibited in YAML configuration, but they are not encouraged by the Home Assistant UI. For example, in the automations editor, they are collapsed into a single line when displayed or updated via the UI.

Supporting multiline descriptions in parsing requires significant changes, we might address this later.

@bcutter
Copy link
Author

bcutter commented Nov 22, 2024

I really like the recent work you are putting in this integration.

Looking forward to see the improvement running 0.6.4. Any estimations when it will be released?

@dummylabs
Copy link
Owner

Thanks for the kind words! It's almost ready, just polishing minor details and running some real-world tests before publishing. There were a lot of changes and refactoring under the hood, so I expect there may be some bugs not covered by the unit tests. Hopefully, this will make future development easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants