Automate bedroom camera

This commit is contained in:
2021-05-26 11:01:23 +03:00
parent 88b7af2655
commit d182a84464
6 changed files with 67 additions and 4 deletions
+51
View File
@@ -0,0 +1,51 @@
switch:
- platform: template
switches:
tapo_bedroom:
friendly_name: "Bedroom Camera"
value_template: "{{ 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:
- condition: template
value_template: "{{ 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: tapo_control.set_privacy_mode
entity_id: camera.bedroom_hd
data:
privacy_mode: "off"
- service: tapo_control.ptz
entity_id: camera.bedroom_hd
data:
preset: "live"
tapo_bedroom_off:
sequence:
- service: tapo_control.ptz
entity_id: camera.bedroom_hd
data:
preset: "off"
- service: tapo_control.set_privacy_mode
entity_id: camera.bedroom_hd
data:
privacy_mode: "on"