Allow any entity to match state condition (#22321)

This commit is contained in:
Franck Nijhof 2022-04-12 12:10:16 +02:00 committed by GitHub
parent bfe24c44e7
commit 91f28433ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,7 +136,7 @@ condition:
{% endraw %} {% endraw %}
It is also possible to test the condition against multiple entities at once. It is also possible to test the condition against multiple entities at once.
The condition will pass if all entities match the thresholds. The condition will pass if **all** entities match the thresholds.
```yaml ```yaml
condition: condition:
@ -190,7 +190,7 @@ condition:
``` ```
It is also possible to test the condition against multiple entities at once. It is also possible to test the condition against multiple entities at once.
The condition will pass if all entities match the state. The condition will pass if **all** entities match the state.
```yaml ```yaml
condition: condition:
@ -201,6 +201,19 @@ condition:
state: "on" state: "on"
``` ```
Instead of matching all, it is also possible if one of the entities matches.
In the following example the condition will pass if **any** entities match the state.
```yaml
condition:
condition: state
entity_id:
- binary_sensor.motion_sensor_left
- binary_sensor.motion_sensor_right
match: any
state: "on"
```
Testing if an entity is matching a set of possible conditions; Testing if an entity is matching a set of possible conditions;
The condition will pass if the entity matches one of the states given. The condition will pass if the entity matches one of the states given.