mirror of
https://github.com/skalavala/mysmarthome.git
synced 2025-08-28 16:57:02 +00:00
Back Alive!
This commit is contained in:
90
jinja_helpers/cameras_auto_gen.md
Executable file
90
jinja_helpers/cameras_auto_gen.md
Executable file
@@ -0,0 +1,90 @@
|
||||
```
|
||||
###############################################################################
|
||||
# @author : Mahasri Kalavala
|
||||
# @date : {{ now().month ~ '/' ~ now().day ~ '/' ~ now().year }}
|
||||
# @package : Cameras
|
||||
# @description : Cameras, Cameras, and Cameras!
|
||||
###############################################################################
|
||||
homeassistant:
|
||||
customize:
|
||||
|
||||
################################################
|
||||
## Node Anchors
|
||||
################################################
|
||||
|
||||
package.node_anchors:
|
||||
customize: &customize
|
||||
package: 'cameras'
|
||||
|
||||
exposed: &exposed
|
||||
<<: *customize
|
||||
emulated_hue_hidden: true
|
||||
homebridge_hidden: false
|
||||
|
||||
not_exposed: ¬_exposed
|
||||
<<: *customize
|
||||
emulated_hue_hidden: false
|
||||
homebridge_hidden: true
|
||||
|
||||
hidden: &hidden
|
||||
<<: *customize
|
||||
hidden: true
|
||||
|
||||
# friendly names
|
||||
{% for item in states.binary_sensor if 'camera' in item.entity_id %}
|
||||
{%- if loop.first %}{% elif loop.last %}{% else %}{% endif %}
|
||||
{{ item.entity_id }}:
|
||||
friendly_name: {{ item.entity_id.split('.')[1].replace('_', ' ')|title}}
|
||||
{% endfor %}
|
||||
|
||||
group:
|
||||
Frontyard Cameras:
|
||||
entities:
|
||||
- camera.frontdoor_camera
|
||||
- camera.driveway_camera
|
||||
|
||||
Backyard Cameras:
|
||||
entities:
|
||||
- camera.patio_camera
|
||||
- camera.playarea_camera
|
||||
|
||||
Camera Motion:
|
||||
{% for item in states.binary_sensor if 'camera_motion' in item.entity_id %}
|
||||
{%- if loop.first %} entities:{% elif loop.last %}{% else %}{% endif %}
|
||||
- {{ item.entity_id }}{% endfor %}
|
||||
|
||||
Camera Field Detection:
|
||||
{% for item in states.binary_sensor if '_field_detection' in item.entity_id %}
|
||||
{%- if loop.first %} entities:{% elif loop.last %}{% else %}{% endif %}
|
||||
- {{ item.entity_id }}{% endfor %}
|
||||
|
||||
Camera Line Crossing:
|
||||
{% for item in states.binary_sensor if '_line_crossing' in item.entity_id %}
|
||||
{%- if loop.first %} entities:{% elif loop.last %}{% else %}{% endif %}
|
||||
- {{ item.entity_id }}{% endfor %}
|
||||
|
||||
Camera Tamper Detection:
|
||||
{% for item in states.binary_sensor if '_tamper_detection' in item.entity_id %}
|
||||
{%- if loop.first %} entities:{% elif loop.last %}{% else %}{% endif %}
|
||||
- {{ item.entity_id }}{% endfor %}
|
||||
|
||||
# camera platforms
|
||||
camera:
|
||||
{% for item in states.camera if 'doppler' not in item.entity_id and 'usps' not in item.entity_id %}
|
||||
{%- if loop.first %} entities:{% elif loop.last %}{% else %}{% endif %}
|
||||
- platform: generic
|
||||
name: {{ item.entity_id.split('.')[1].split('_')[0] | title}} Camera
|
||||
still_image_url: !secret {{ item.entity_id.split('.')[1].split('_')[0]}}_camera_url
|
||||
{% endfor %}
|
||||
|
||||
# binary sensors
|
||||
binary_sensor:
|
||||
{% for item in states.camera if 'doppler' not in item.entity_id and 'usps' not in item.entity_id %}
|
||||
{%- if loop.first %}{% elif loop.last %}{% else %}{% endif %}
|
||||
- platform: hikvision
|
||||
name: {{ item.entity_id.split('.')[1].split('_')[0] | title}} Camera
|
||||
host: !secret {{ item.entity_id.split('.')[1].split('_')[0]}}_camera_ip
|
||||
username: !secret camera_username
|
||||
password: !secret camera_password
|
||||
{% endfor %}
|
||||
```
|
Reference in New Issue
Block a user