mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-15 17:12:59 +00:00
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
switch:
|
|
- platform: template
|
|
switches:
|
|
tapo_bedroom:
|
|
friendly_name: "Bedroom Camera"
|
|
value_template: "{{ is_state_attr('camera.bedroom_hd', 'privacy_mode', 'off') }}"
|
|
turn_on:
|
|
service: script.tapo_bedroom_on
|
|
turn_off:
|
|
service: script.tapo_bedroom_off
|
|
icon_template: >
|
|
{%if state_attr('camera.bedroom_hd', 'privacy_mode') %}
|
|
mdi:video
|
|
{% else %}
|
|
mdi:video-off
|
|
{% endif %}
|
|
|
|
script:
|
|
tapo_bedroom_toggle:
|
|
sequence:
|
|
- choose:
|
|
- conditions: "{{ is_state_attr('camera.bedroom_hd', 'privacy_mode', 'off') }}"
|
|
sequence:
|
|
- service: script.tapo_bedroom_off
|
|
|
|
default:
|
|
- service: script.tapo_bedroom_on
|
|
|
|
tapo_bedroom_on:
|
|
sequence:
|
|
- service: swtich.turn_off
|
|
entity_id: switch.bedroom_privacy
|
|
- service: input_select.select_option
|
|
entity_id: select.bedroom_move_to_preset
|
|
data:
|
|
option: "live"
|
|
|
|
tapo_bedroom_off:
|
|
sequence:
|
|
- service: input_select.select_option
|
|
entity_id: select.bedroom_move_to_preset
|
|
data:
|
|
option: "off"
|
|
- service: swtich.turn_on
|
|
entity_id: switch.bedroom_privacy
|
|
|