Skip to content

Commit

Permalink
Replace condition: with conditions:
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Oct 16, 2024
1 parent 4bbd8ad commit 1f59290
Show file tree
Hide file tree
Showing 24 changed files with 90 additions and 90 deletions.
4 changes: 2 additions & 2 deletions automations/adaptive_lighting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
variables:
light: "{{ trigger.event.data.entity_id }}"
switch: "{{ trigger.event.data.switch }}"
condition: "{{ 'hall' not in light and 'stairs' not in light }}"
conditions: "{{ 'hall' not in light and 'stairs' not in light }}"
action:
- delay: "01:00:00"
- condition: template
Expand All @@ -81,7 +81,7 @@
event_type: adaptive_lighting.manual_control
variables:
light: "{{ trigger.event.data.entity_id }}"
condition: "{{ 'hall' not in light and 'stairs' not in light }}"
conditions: "{{ 'hall' not in light and 'stairs' not in light }}"
action:
- service: system_log.write
data:
Expand Down
4 changes: 2 additions & 2 deletions automations/alarm_clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
platform: template
value_template: >
{{ states("sensor.time")[0:5] == states("sensor.ten_minutes_before_alarm") }}
condition:
condition: state
conditions:
conditions: state
entity_id: input_boolean.alarm_clock
state: "on"
action:
Expand Down
4 changes: 2 additions & 2 deletions automations/apple_watch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
event_type: ios.action_fired
event_data:
actionName: Play TV
condition:
condition: state
conditions:
conditions: state
entity_id: media_player.tv
state: "on"
action:
Expand Down
2 changes: 1 addition & 1 deletion automations/arriving.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
entity_id: binary_sensor.openclose_front_door
from: "off"
to: "on"
condition:
conditions:
- condition: state
entity_id: person.marcella
state: not_home
Expand Down
4 changes: 2 additions & 2 deletions automations/bike.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
triggers:
platform: time_pattern
minutes: '/1'
condition:
condition: template
conditions:
conditions: template
value_template: "{{ states('sensor.time') == states('input_datetime.bike_charger_off')[0:5] }}"
action:
service: switch.turn_off
Expand Down
14 changes: 7 additions & 7 deletions automations/climate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
platform: template
value_template: >
{{ states("sensor.time")[0:5] == states("sensor.half_hour_before_alarm") }}
condition:
condition: state
conditions:
conditions: state
entity_id:
- input_boolean.alarm_clock
- input_boolean.automatic_temperature
Expand All @@ -29,7 +29,7 @@
entity_id: proximity.home
below: 6
above: 1
condition:
conditions:
- condition: state
entity_id: input_boolean.automatic_temperature
state: "on"
Expand All @@ -52,7 +52,7 @@
triggers:
platform: time
at: "22:00"
condition:
conditions:
- condition: state
entity_id: input_boolean.automatic_temperature
state: "on"
Expand Down Expand Up @@ -98,7 +98,7 @@
entity_id: binary_sensor.openclose_bedroom
to: "on"
for: "00:05:00"
condition: "{{ state_attr('climate.thermostat', 'temperature') >= 18 }}"
conditions: "{{ state_attr('climate.thermostat', 'temperature') >= 18 }}"
action:
- repeat:
while:
Expand Down Expand Up @@ -143,8 +143,8 @@
- platform: state
entity_id: binary_sensor.activity_in_guest_room
to: "off"
condition:
condition: state
conditions:
conditions: state
entity_id: binary_sensor.activity_in_guest_room
state: "off"
action:
Expand Down
6 changes: 3 additions & 3 deletions automations/control_switches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
entity_id: all
- conditions: # off -> half
condition: state
conditions: state
entity_id: input_select.sleep_mode
state: "off"
sequence:
Expand All @@ -374,7 +374,7 @@
option: half

- conditions: # half -> total
condition: state
conditions: state
entity_id: input_select.sleep_mode
state: half
sequence:
Expand All @@ -385,7 +385,7 @@
option: total

- conditions: # on total, just turn lights off
condition: state
conditions: state
entity_id: input_select.sleep_mode
state: total
sequence:
Expand Down
10 changes: 5 additions & 5 deletions automations/cube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
id: mi_magic_cube
variables:
event: "{{ trigger.event.data.event }}"
condition: "{{ (event | string)[1:-1] == '00' }}"
conditions: "{{ (event | string)[1:-1] == '00' }}"
action:
choose:
# Change cube mode by shifting on one side, or rotating from one side to another side
Expand Down Expand Up @@ -79,11 +79,11 @@
id: mi_magic_cube
variables:
event: "{{ trigger.event.data.event }}"
condition: "{{ (event | string)[1:-1] != '00' or event < 0 }}"
conditions: "{{ (event | string)[1:-1] != '00' or event < 0 }}"
action:
choose:
- conditions: # Change hue of living room lights
condition: state
conditions: state
entity_id: input_select.cube_mode
state: "Hue"
sequence:
Expand All @@ -100,7 +100,7 @@
- "{{ hue_sat[1] }}"

- conditions: # Change brightness of living room lights
condition: state
conditions: state
entity_id: input_select.cube_mode
state: "Brightness"
sequence:
Expand All @@ -114,7 +114,7 @@
{{ new_brightness|int(0) }}
- conditions: # Change speaker volume
condition: state
conditions: state
entity_id: input_select.cube_mode
state: "Volume"
sequence:
Expand Down
4 changes: 2 additions & 2 deletions automations/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
at: "20:00"
- platform: sun
event: sunset
condition: "{{ is_state('input_boolean.dark_mode', 'off') }}"
conditions: "{{ is_state('input_boolean.dark_mode', 'off') }}"
action:
entity_id: input_boolean.dark_mode
service: input_boolean.turn_on
Expand All @@ -25,7 +25,7 @@
at: "06:00"
- platform: sun
event: sunrise
condition: "{{ is_state('input_boolean.dark_mode', 'on') }}"
conditions: "{{ is_state('input_boolean.dark_mode', 'on') }}"
action:
entity_id: input_boolean.dark_mode
service: input_boolean.turn_off
Expand Down
4 changes: 2 additions & 2 deletions automations/leaving.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
for: "00:01:00"
- platform: time_pattern
hours: "/1"
condition:
conditions:
- condition: state
entity_id:
- binary_sensor.no_one_home
Expand All @@ -46,7 +46,7 @@
- platform: state
entity_id: person.marcella
from: "home"
condition:
conditions:
- condition: state
entity_id:
- binary_sensor.no_one_home
Expand Down
46 changes: 23 additions & 23 deletions automations/light.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
platform: state
entity_id: binary_sensor.activity_in_living_room
to: "on"
condition:
condition: state
conditions:
conditions: state
entity_id: input_boolean.guest_mode
state: "off"
action:
Expand All @@ -44,8 +44,8 @@
- platform: state
entity_id: input_select.sleep_mode
from: total
condition:
condition: state
conditions:
conditions: state
entity_id: input_boolean.guest_mode
state: "off"
action:
Expand All @@ -62,8 +62,8 @@
- platform: state
entity_id: binary_sensor.someone_in_the_house_in_last_hour
to: "on"
condition:
condition: state
conditions:
conditions: state
entity_id: binary_sensor.someone_in_the_house_in_last_hour
state: "on"
action:
Expand Down Expand Up @@ -93,7 +93,7 @@
triggers:
platform: state
entity_id: binary_sensor.activity_in_dinner_area
condition:
conditions:
- condition: state
entity_id: input_boolean.automatic_dinner_area_light
state: "on"
Expand All @@ -109,7 +109,7 @@
entity_id: light.dinner_area

- alias: "Light: turn off automatic dinner area lights when turning off lights after 18:00"
condition:
conditions:
- condition: state
entity_id: input_boolean.automatic_dinner_area_light
state: "on"
Expand All @@ -136,8 +136,8 @@
platform: state
entity_id: binary_sensor.activity_in_kitchen
to: "on"
condition:
condition: state
conditions:
conditions: state
entity_id: input_select.sleep_mode
state:
- "off"
Expand Down Expand Up @@ -174,7 +174,7 @@
platform: state
entity_id: binary_sensor.activity_in_bathroom
to: "on"
condition: "{{ states('input_select.sleep_mode') != 'total' }}"
conditions: "{{ states('input_select.sleep_mode') != 'total' }}"
action:
service: light.turn_on
data:
Expand Down Expand Up @@ -218,7 +218,7 @@
| selectattr("state", "eq", "off")
| map(attribute="entity_id")
| list }}
condition: "{{ (off_lights | length) > 0 }}"
conditions: "{{ (off_lights | length) > 0 }}"
action:
alias: Turn on lights that are off
repeat:
Expand Down Expand Up @@ -259,7 +259,7 @@
| selectattr("state", "eq", "off")
| map(attribute="entity_id")
| list }}
condition:
conditions:
- "{{ (off_lights | length) > 0 }}"
- condition: state
entity_id: input_select.sleep_mode
Expand All @@ -285,7 +285,7 @@
entity_id: binary_sensor.activity_in_master_bedroom
to: "off"
for: "00:08:00"
condition:
conditions:
- condition: state
entity_id: input_boolean.bedroom_lights_automatically_turned_on
state: "on"
Expand Down Expand Up @@ -319,8 +319,8 @@
event_type: deconz_event
event_data:
id: smart_switch_bedroom_marcella
condition:
condition: state
conditions:
conditions: state
entity_id: input_boolean.bedroom_lights_automatically_turned_on
state: "on"
action:
Expand All @@ -342,7 +342,7 @@
from: "on"
to: "off"
for: "02:00:00"
condition: "{{ is_state('light.bedroom_lights', 'on') }}"
conditions: "{{ is_state('light.bedroom_lights', 'on') }}"
action:
service: light.turn_off
data:
Expand Down Expand Up @@ -471,7 +471,7 @@
triggers:
platform: state
entity_id: binary_sensor.activity_in_guest_room
condition:
conditions:
- condition: state
entity_id: input_boolean.guest_mode
state: "off"
Expand Down Expand Up @@ -511,7 +511,7 @@
triggers:
platform: time_pattern
minutes: 60
condition:
conditions:
- condition: state
entity_id: binary_sensor.activity_in_living_room
state: "off"
Expand All @@ -527,7 +527,7 @@
triggers:
platform: time_pattern
minutes: "/10"
condition:
conditions:
- condition: state
entity_id: binary_sensor.activity_in_guest_room
state: "off"
Expand All @@ -543,7 +543,7 @@
triggers:
platform: time_pattern
minutes: "/10"
condition:
conditions:
- condition: state
entity_id: binary_sensor.activity_in_baby_room
state: "off"
Expand All @@ -565,7 +565,7 @@
triggers:
platform: time_pattern
minutes: "/30"
condition:
conditions:
- condition: state
entity_id: binary_sensor.activity_in_master_bedroom
state: "off"
Expand All @@ -586,7 +586,7 @@
triggers:
platform: time_pattern
minutes: "/10"
condition:
conditions:
- condition: state
entity_id: binary_sensor.activity_in_utility_room
state: "off"
Expand Down
2 changes: 1 addition & 1 deletion automations/mailbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- platform: state
entity_id: binary_sensor.mailbox_vibration
to: "on"
condition:
conditions:
- condition: state
entity_id: input_boolean.mailbox_full
state: "off"
Expand Down
Loading

0 comments on commit 1f59290

Please sign in to comment.