2020-11-04 00:55:41 +01:00
|
|
|
---
|
2021-11-15 23:54:07 +01:00
|
|
|
- hosts: home-assistant
|
2021-05-24 20:26:03 +02:00
|
|
|
tasks:
|
2024-07-31 19:59:47 +02:00
|
|
|
- name: Include secrets
|
|
|
|
include_vars:
|
|
|
|
file: configuration/secrets.yaml
|
2021-11-15 23:54:07 +01:00
|
|
|
- name: Remove automations directory
|
|
|
|
file:
|
|
|
|
path: '{{ pwd_config }}/automations'
|
|
|
|
state: absent
|
2021-12-18 13:34:17 +01:00
|
|
|
- name: Create build directory
|
|
|
|
delegate_to: localhost
|
2021-11-15 23:54:07 +01:00
|
|
|
file:
|
2021-12-18 13:34:17 +01:00
|
|
|
path: './build/automations'
|
2021-11-15 23:54:07 +01:00
|
|
|
state: directory
|
2021-12-18 13:34:17 +01:00
|
|
|
- name: Concat automation
|
|
|
|
delegate_to: localhost
|
|
|
|
ansible.builtin.assemble:
|
|
|
|
remote_src: no
|
|
|
|
src: './configuration/automations'
|
|
|
|
dest: './build/automations/automations-base.yaml'
|
2021-05-24 20:26:03 +02:00
|
|
|
- name: Build lights automations
|
2021-12-18 13:34:17 +01:00
|
|
|
delegate_to: localhost
|
2021-05-24 20:26:03 +02:00
|
|
|
template:
|
|
|
|
src: lights.yaml.j2
|
2021-12-18 13:34:17 +01:00
|
|
|
dest: './build/automations/lights.yaml'
|
2021-05-24 20:26:03 +02:00
|
|
|
vars:
|
|
|
|
lights:
|
|
|
|
- entityId: light.bathroom_lights
|
|
|
|
name: Bathroom Lights
|
|
|
|
- entityId: light.kitchen_lights
|
|
|
|
name: Kitchen Lights
|
|
|
|
- entityId: light.shower_lights
|
|
|
|
name: Shower Lights
|
2021-08-26 20:04:36 +02:00
|
|
|
- entityId: light.couch_lights
|
|
|
|
name: Couch Lights
|
2021-05-24 23:03:45 +02:00
|
|
|
- entityId: light.desk_lightbar
|
|
|
|
name: Desk Lightbar
|
2021-12-14 16:09:31 +01:00
|
|
|
- entityId: light.office
|
2021-09-22 23:41:16 +02:00
|
|
|
name: Table lamp
|
2024-05-19 12:11:47 +02:00
|
|
|
- name: Build music button automations
|
|
|
|
delegate_to: localhost
|
|
|
|
template:
|
|
|
|
src: music-button.yaml.j2
|
|
|
|
dest: './build/automations/music.yaml'
|
|
|
|
vars:
|
|
|
|
room: Bathroom
|
|
|
|
room_id: bathroom
|
|
|
|
device_id: ea9059ad2df037a012ab01a575108dc5
|
|
|
|
player_entity_id: media_player.bathroom
|
2023-12-15 13:23:24 +01:00
|
|
|
- name: Include ZHA vars
|
|
|
|
include_vars:
|
|
|
|
file: zha-devices.yml
|
|
|
|
name: zha
|
2023-12-15 14:04:10 +01:00
|
|
|
- name: Build unavailable automations ZHA
|
2023-12-15 13:23:24 +01:00
|
|
|
delegate_to: localhost
|
|
|
|
template:
|
|
|
|
src: unavailable-zha.yaml.j2
|
|
|
|
dest: './build/automations/unavailable-zha.yaml'
|
|
|
|
vars:
|
|
|
|
devices: "{{ zha.devices }}"
|
2023-12-15 14:04:10 +01:00
|
|
|
- name: Include Z-wave vars
|
|
|
|
include_vars:
|
|
|
|
file: zwave-devices.yml
|
|
|
|
name: zwave
|
|
|
|
- name: Build unavailable automations Z-Wave
|
|
|
|
delegate_to: localhost
|
|
|
|
template:
|
|
|
|
src: unavailable-zwave.yaml.j2
|
|
|
|
dest: './build/automations/unavailable-zwave.yaml'
|
|
|
|
vars:
|
|
|
|
devices: "{{ zwave.devices }}"
|
2023-12-16 01:46:23 +01:00
|
|
|
- name: Include battery vars
|
|
|
|
include_vars:
|
|
|
|
file: battery.yml
|
|
|
|
- name: Build battery info automations
|
|
|
|
delegate_to: localhost
|
|
|
|
template:
|
|
|
|
src: low-battery.yaml.j2
|
|
|
|
dest: './build/automations/low-battery.yaml'
|
|
|
|
vars:
|
|
|
|
entities: "{{ battery }}"
|
2023-10-05 00:34:41 +02:00
|
|
|
- name: Build spices shopping automations
|
|
|
|
delegate_to: localhost
|
|
|
|
template:
|
|
|
|
src: shopping-mobile-actions.yaml.j2
|
|
|
|
dest: './build/automations/shopping-mobile-actions.yaml'
|
|
|
|
vars:
|
|
|
|
shopping_list:
|
|
|
|
- action: SHOPPING_COFFEE
|
|
|
|
title: Kawa
|
|
|
|
- action: SHOPPING_COFFEE_WATER_FILTER
|
|
|
|
title: Filtr do wody ekspresu
|
|
|
|
- action: SHOPPING_COFFEE_DESCALER
|
|
|
|
title: Odkamieniacz do ekspresu
|
|
|
|
- action: SHOPPING_COFFEE_CLEANING_TABLETS
|
|
|
|
title: Tabletki czyszczące do ekspresu
|
|
|
|
- action: SHOPPING_COFFEE_MILK_CLEANER
|
|
|
|
title: Środek do czyszczenia mleka ekspresu
|
|
|
|
- action: SHOPPING_BASIL
|
|
|
|
title: Bazylia
|
|
|
|
- action: SHOPPING_OREGANO
|
|
|
|
title: Oregano
|
|
|
|
- action: SHOPPING_THYMELEAF
|
|
|
|
title: Tymianek
|
|
|
|
- action: SHOPPING_WHITE_PEPPER
|
|
|
|
title: Pieprz biały
|
|
|
|
- action: SHOPPING_BLACK_PEPPER
|
|
|
|
title: Pieprz czarny
|
|
|
|
- action: SHOPPING_SWEET_PEPPER
|
|
|
|
title: Sweet pepper
|
|
|
|
- action: SHOPPING_GARLIC
|
|
|
|
title: Czosnek
|
|
|
|
- action: SHOPPING_SALT
|
|
|
|
title: Sól
|
2021-12-18 13:34:17 +01:00
|
|
|
- name: Concat automation 2
|
|
|
|
ansible.builtin.assemble:
|
|
|
|
remote_src: no
|
|
|
|
src: './build/automations/'
|
|
|
|
dest: '{{ pwd_config }}/automations.yaml'
|
2024-06-02 02:17:49 +02:00
|
|
|
- name: Include availability vars
|
|
|
|
include_vars:
|
|
|
|
file: availability.yml
|
|
|
|
- name: Build unavailable script
|
|
|
|
delegate_to: localhost
|
|
|
|
template:
|
|
|
|
src: check-unavailable.yaml.j2
|
|
|
|
dest: './scripts/check-unavailable.yaml'
|
|
|
|
vars:
|
|
|
|
entities: "{{ availability }}"
|
2024-07-31 19:59:47 +02:00
|
|
|
- name: Build alarm script
|
|
|
|
delegate_to: localhost
|
|
|
|
template:
|
|
|
|
src: scripts/alarm.yaml.j2
|
|
|
|
dest: './scripts/alarm.yaml'
|
2021-05-25 00:10:22 +02:00
|
|
|
- name: Concat scripts
|
|
|
|
ansible.builtin.assemble:
|
2021-11-15 23:54:07 +01:00
|
|
|
remote_src: no
|
|
|
|
src: ./scripts
|
|
|
|
dest: '{{ pwd_config }}/scripts.yaml'
|
2021-11-25 00:13:32 +01:00
|
|
|
- name: Copy configuration
|
|
|
|
copy:
|
|
|
|
src: configuration/configuration.yaml
|
|
|
|
dest: '{{ pwd_config }}/configuration.yaml'
|
2022-11-14 23:39:48 +01:00
|
|
|
- name: Copy alert
|
|
|
|
copy:
|
|
|
|
src: configuration/alert.yaml
|
|
|
|
dest: '{{ pwd_config }}/alert.yaml'
|
2022-04-29 19:55:03 +02:00
|
|
|
- name: Copy customize
|
|
|
|
copy:
|
|
|
|
src: configuration/customize.yaml
|
|
|
|
dest: '{{ pwd_config }}/customize.yaml'
|
2022-04-30 15:07:23 +02:00
|
|
|
- name: Copy groups
|
|
|
|
copy:
|
|
|
|
src: configuration/groups.yaml
|
|
|
|
dest: '{{ pwd_config }}/groups.yaml'
|
2021-11-25 00:13:32 +01:00
|
|
|
- name: Copy secrets
|
|
|
|
copy:
|
|
|
|
src: configuration/secrets.yaml
|
|
|
|
dest: '{{ pwd_config }}/secrets.yaml'
|
2021-12-06 23:31:28 +01:00
|
|
|
- name: Copy scripts
|
|
|
|
copy:
|
|
|
|
src: python_scripts
|
|
|
|
dest: '{{ pwd_config }}'
|
2022-11-29 01:27:02 +01:00
|
|
|
directory_mode: yes
|
|
|
|
- name: Copy appdaemon
|
|
|
|
copy:
|
|
|
|
src: configuration/appdaemon
|
2023-12-15 13:23:24 +01:00
|
|
|
dest: '{{ pwd_config }}/appdaemon'
|