Use condition shorthand notations

This commit is contained in:
2022-05-07 10:41:32 +03:00
parent bd28132229
commit 4272699dc7
10 changed files with 16 additions and 48 deletions
+1 -3
View File
@@ -19,9 +19,7 @@ script:
tapo_bedroom_toggle:
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ state_attr('camera.bedroom_hd', 'privacy_mode') == 'off' }}"
- conditions: "{{ state_attr('camera.bedroom_hd', 'privacy_mode') == 'off' }}"
sequence:
- service: script.tapo_bedroom_off
@@ -122,8 +122,7 @@ script:
sequence:
- condition: and
conditions:
- condition: template
value_template: "{{ states('sensor.multisensor_6_temperature')|float > states('input_number.toshiba_trigger_temp')|float }}"
- condition: "{{ states('sensor.multisensor_6_temperature')|float > states('input_number.toshiba_trigger_temp')|float }}"
- condition: numeric_state
entity_id: sensor.dark_sky_apparent_temperature
above: 23
@@ -60,10 +60,7 @@ automation:
trigger:
- platform: mqtt
topic: z2m_deconz/trust_remote
condition:
- condition: template
value_template: >
{{ trigger.payload_json.action == "on" }}
condition: "{{ trigger.payload_json.action == 'on' }}"
action:
- service: light.turn_on
data_template:
@@ -88,10 +85,7 @@ automation:
trigger:
- platform: mqtt
topic: z2m_deconz/trust_remote
condition:
- condition: template
value_template: >-
{{ trigger.payload_json.action == "off" }}
condition: "{{ trigger.payload_json.action == 'off' }}"
action:
- service: light.turn_off
data_template:
+2 -6
View File
@@ -155,9 +155,7 @@ automation:
platform: state
entity_id: media_player.nvidia_shield
to: "off"
condition:
condition: template
value_template: "{{ is_state_attr('media_player.living_room_tv', 'source', 'Shield') }}"
condition: "{{ is_state_attr('media_player.living_room_tv', 'source', 'Shield') }}"
action:
- service: media_player.turn_off
entity_id: media_player.living_room_tv
@@ -172,9 +170,7 @@ automation:
platform: state
entity_id: media_player.nvidia_shield
to: 'playing'
condition:
- condition: template
value_template: "{{ state_attr('media_player.nvidia_shield', 'source') == 'Google Cast' }}"
condition: "{{ state_attr('media_player.nvidia_shield', 'source') == 'Google Cast' }}"
action:
- service: script.sonos_join_tv
- service: logbook.log