home-assistant / home-assistant.io

:blue_book: Home Assistant User documentation
https://www.home-assistant.io
Other
4.98k stars 7.29k forks source link

Script (Conditions) have different format than the conditional card #35778

Closed YogoGit closed 3 hours ago

YogoGit commented 3 hours ago

Feedback

In the conditional card, the example for determining if a condition is valid is the following for an entity: https://www.home-assistant.io/dashboards/conditional/#examples

type: conditional
conditions:
  - condition: state
    entity: light.bed_light
    state: "on"
  - condition: state
    entity: light.bed_light
    state_not: "off"

Note, it's entity

However, for all other automations (triggers, conditions, etc...), as documented here

https://www.home-assistant.io/docs/scripts/conditions/#state-condition

conditions:
  - condition: state
    entity_id:
      - light.kitchen
      - light.living_room
    state: "on"

Note, it's using entity_id for the state condition, not entity.

URL

https://www.home-assistant.io/dashboards/conditional/

Version

2024.11.1

Additional information

It would be nice to have consistent syntax.

frenck commented 3 hours ago

Yes? That is correct...

I'm not fully understanding the comment, could you clarify what your suggestion is?

../Frenck

YogoGit commented 3 hours ago

It would be nice to have consistent syntax, (ie; when doing state on an entity, using 'entity_id' always, not using entity in one case, and entity_id in all other cases).

frenck commented 3 hours ago

It would be nice to have consistent syntax

Agree, but that isn't the case. The documentation is thus correct.

If you want to suggest a feature, you should try our Community Forum: Feature Requests.

If you have additional questions, feel free to join our Discord chat server.

Thanks! 👍