mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-09-07 18:28:43 +00:00
Use iif
This commit is contained in:
@@ -25,25 +25,13 @@ automation:
|
||||
- service: light.toggle
|
||||
data_template:
|
||||
entity_id: light.living_room_main
|
||||
brightness_pct: >-
|
||||
|
||||
{% if is_state('sensor.house_mode', 'night') %}
|
||||
40
|
||||
{% else %}
|
||||
100
|
||||
{% endif %}
|
||||
brightness_pct: "{{ is_state('sensor.house_mode', 'night') | iif(40, 100) }}"
|
||||
|
||||
double_click:
|
||||
- service: light.toggle
|
||||
data_template:
|
||||
entity_id: light.living_room_ambient
|
||||
brightness_pct: >-
|
||||
|
||||
{% if is_state('sensor.house_mode', 'night') %}
|
||||
40
|
||||
{% else %}
|
||||
100
|
||||
{% endif %}
|
||||
brightness_pct: "{{ is_state('sensor.house_mode', 'night') | iif(40, 100) }}"
|
||||
|
||||
hold:
|
||||
- service: media_player.media_play_pause
|
||||
|
||||
@@ -12,11 +12,7 @@ binary_sensor:
|
||||
value_template: >-
|
||||
{{ is_state("binary_sensor.titanium_ping", "on") }}
|
||||
icon_template: >-
|
||||
{% if is_state("binary_sensor.titanium_ping", "on") %}
|
||||
mdi:desktop-mac-dashboard
|
||||
{% else %}
|
||||
mdi:desktop-mac
|
||||
{% endif %}
|
||||
{{ is_state("binary_sensor.titanium_ping", "on") | iif(' mdi:desktop-mac-dashboard', 'mdi:desktop-mac') }}
|
||||
|
||||
- platform: mqtt
|
||||
name: "Titanium playing"
|
||||
@@ -163,12 +159,7 @@ switch:
|
||||
turn_off:
|
||||
service: script.titanium_shutdown
|
||||
icon_template: >-
|
||||
|
||||
{% if is_state('binary_sensor.titanium', 'on') %}
|
||||
mdi:monitor-dashboard
|
||||
{% else %}
|
||||
mdi:monitor-off
|
||||
{% endif %}
|
||||
{{ is_state('binary_sensor.titanium', 'on') | iif('mdi:monitor-dashboard', 'mdi:monitor-off') }}
|
||||
|
||||
script:
|
||||
titanium_start:
|
||||
|
||||
@@ -122,7 +122,7 @@ script:
|
||||
sequence:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: "{{ states('sensor.multisensor_6_temperature')|float > states('input_number.toshiba_trigger_temp')|float }}"
|
||||
- "{{ 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
|
||||
|
||||
Reference in New Issue
Block a user