From c0ada6683ab9a95abfc279dc4b5ff88eb8f72399 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 15 Jun 2020 22:54:32 +0200 Subject: [PATCH] Add support for multiple entity_ids in conditions (#13761) --- source/_docs/scripts/conditions.markdown | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/source/_docs/scripts/conditions.markdown b/source/_docs/scripts/conditions.markdown index b818d147260..c9954194b09 100644 --- a/source/_docs/scripts/conditions.markdown +++ b/source/_docs/scripts/conditions.markdown @@ -112,6 +112,18 @@ condition: value_template: {% raw %}'{{ float(state.state) + 2 }}'{% endraw %} ``` +It is also possible to test the condition against multiple entities at once. +The condition will pass if all entities match the thresholds. + +```yaml +condition: + condition: numeric_state + entity_id: + - sensor.kitchen_temperature + - sensor.living_room_temperature + below: 18 +``` + ### State condition Tests if an entity is a specified state. @@ -128,6 +140,18 @@ condition: seconds: 5 ``` +It is also possible to test the condition against multiple entities at once. +The condition will pass if all entities match the state. + +```yaml +condition: + condition: state + entity_id: + - light.kitchen + - light.living_room + state: 'on' +``` + ### Sun condition #### Sun state condition @@ -272,6 +296,18 @@ condition: zone: zone.home ``` +It is also possible to test the condition against multiple entities at once. +The condition will pass if all entities are in the specified zone. + +```yaml +condition: + condition: zone + entity_id: + - device_tracker.frenck + - device_tracker.daphne + zone: zone.home +``` + ### Examples ```yaml