home-automation-home-assistant/config/switches/cctv.yaml

53 خطوط
1.6 KiB
YAML

- platform: template
switches:
camera_livingroom_email:
value_template: "{{ is_state_attr('camera.livingroom', 'email_enabled', true) }}"
turn_on:
service: camera.enable_email
data:
entity_id: camera.livingroom
turn_off:
service: camera.disable_email
data:
entity_id: camera.livingroom
icon_template: >-
{% if is_state_attr('camera.livingroom', 'email_enabled', true) %}
mdi:email
{% else %}
mdi:email-outline
{% endif %}
camera_livingroom_ftp:
value_template: "{{ is_state_attr('camera.livingroom', 'ftp_enabled', true) }}"
turn_on:
service: camera.enable_ftp
data:
entity_id: camera.livingroom
turn_off:
service: camera.disable_ftp
data:
entity_id: camera.livingroom
icon_template: >-
{% if is_state_attr('camera.livingroom', 'ftp_enabled', true) %}
mdi:filmstrip
{% else %}
mdi:filmstrip-off
{% endif %}
camera_livingroom_ir_lights:
value_template: "{{ is_state_attr('camera.livingroom', 'ir_lights_enabled', true) }}"
turn_on:
service: camera.enable_ir_lights
data:
entity_id: camera.livingroom
turn_off:
service: camera.disable_ir_lights
data:
entity_id: camera.livingroom
icon_template: >-
{% if is_state_attr('camera.livingroom', 'ir_lights_enabled', true) %}
mdi:flashlight
{% else %}
mdi:flashlight-off
{% endif %}