================================== | ================================== | ||||
home_assistant | |||||
Home Assistant | |||||
================================== | ================================== | ||||
Service home_assistant description | |||||
Home Assistant is an open-source home automation platform running on Python 3. Track and control all devices at home and automate control. | |||||
Sample pillars | Sample pillars | ||||
============== | ============== | ||||
Single home_assistant service | |||||
Single homeassistant service | |||||
.. code-block:: yaml | .. code-block:: yaml | ||||
home_assistant: | home_assistant: | ||||
server: | server: | ||||
enabled: true | enabled: true | ||||
version: icehouse | |||||
bind: | |||||
address: 0.0.0.0 | |||||
port: 8123 | |||||
Read more | Read more | ||||
========= | ========= | ||||
* links | |||||
* https://home-assistant.io/getting-started/ |
{%- from "home_assistant/map.jinja" import server with context %} | |||||
{%- from "linux/map.jinja" import system with context %} | |||||
homeassistant: | |||||
name: {{ server.name }} | |||||
latitude: {{ server.latitude }} | |||||
longitude: {{ server.longitude }} | |||||
temperature_unit: {{ server.temperature_unit }} | |||||
time_zone: {{ system.timezone }} | |||||
http: | |||||
api_password: {{ server.api_password }} | |||||
{{ server.plugin|yaml(False) }} |
# Service config file |
{%- from "home_assistant/map.jinja" import server with context %} | |||||
{{ server.known_device|yaml(False) }} |
homeassistant |
{%- set source_engine = salt['pillar.get']('home_assistant:server:source:engine') %} | {%- set source_engine = salt['pillar.get']('home_assistant:server:source:engine') %} | ||||
{%- load_yaml as base_defaults %} | {%- load_yaml as base_defaults %} | ||||
{%- if source_engine == 'git' %} | |||||
Debian: | |||||
pkgs: | |||||
- python-psycopg2 | |||||
dir: | |||||
base: /srv/home_assistant/venv | |||||
home: /var/lib/home_assistant | |||||
workspace: /srv/home_assistant/workspace | |||||
RedHat: | |||||
pkgs: | |||||
- python-psycopg2 | |||||
dir: | |||||
base: /srv/home_assistant/venv | |||||
home: /var/lib/home_assistant | |||||
workspace: /srv/home_assistant/workspace | |||||
{%- else %} | |||||
Debian: | Debian: | ||||
pkgs: | pkgs: | ||||
- helpdesk | |||||
- python3-dev | |||||
- python3-pip | |||||
dir: | dir: | ||||
base: /usr/lib/home_assistant | |||||
{%- endif %} | |||||
base: /srv/home_assistant | |||||
{%- endload %} | {%- endload %} | ||||
{%- set server = salt['grains.filter_by'](base_defaults, merge=salt['pillar.get']('home_assistant:server')) %} | {%- set server = salt['grains.filter_by'](base_defaults, merge=salt['pillar.get']('home_assistant:server')) %} |
# Sample check | |||||
check: | |||||
local_home_assistant_proc: | |||||
command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -C home_assistant -u home_assistant -c 1:1" | |||||
interval: 60 | |||||
occurrences: 1 | |||||
subscribers: | |||||
- local-home_assistant-server |
# Fill in documentation details | # Fill in documentation details | ||||
doc: | doc: | ||||
name: home_assistant | name: home_assistant | ||||
description: Some service info | |||||
description: Home Assistant is an open-source home automation platform. | |||||
role: | role: | ||||
server: | server: | ||||
name: server | name: server |
{%- from "home_assistant/map.jinja" import server with context %} | {%- from "home_assistant/map.jinja" import server with context %} | ||||
{%- if server.enabled %} | {%- if server.enabled %} | ||||
home_assistant_packages: | |||||
pkg.installed: | |||||
- names: {{ server.pkgs }} | |||||
{{ server.dir.base }}: | |||||
virtualenv.manage: | |||||
- requirements: salt://home_assistant/files/requirements.txt | |||||
- require: | |||||
- pkg: home_assistant_packages | |||||
- user: home_assistant | |||||
home_assistant_user: | |||||
user.present: | |||||
- name: home_assistant | |||||
- system: true | |||||
- home: {{ server.dir.base }} | |||||
- require: | |||||
- virtualenv: {{ server.dir.base }} | |||||
home_assistant_dir: | |||||
file.directory: | |||||
- names: | |||||
- /etc/home_assistant | |||||
- /var/log/home_assistant | |||||
- mode: 700 | |||||
- makedirs: true | |||||
- user: home_assistant | |||||
- require: | |||||
- virtualenv: {{ server.dir.base }} | |||||
home_assistant_config: | |||||
file.managed: | |||||
- name: /etc/home_assistant/configuration.yaml | |||||
- source: salt://home_assistant/files/configuration.yaml | |||||
- template: jinja | |||||
- user: home_assistant | |||||
- mode: 600 | |||||
- require: | |||||
- file: home_assistant_dir | |||||
{%- if server.known_device is defined %} | |||||
home_assistant_know_devices: | |||||
file.managed: | |||||
- name: /etc/home_assistant/known_devices.yaml | |||||
- source: salt://home_assistant/files/known_devices.yaml | |||||
- template: jinja | |||||
- user: home_assistant | |||||
- mode: 600 | |||||
- require: | |||||
- file: home_assistant_dir | |||||
{%- endif %} | {%- endif %} | ||||
{%- endif %} |
enabled: true | enabled: true | ||||
bind: | bind: | ||||
address: 0.0.0.0 | address: 0.0.0.0 | ||||
port: 8123 | |||||
# Name of the location where Home Assistant is running | |||||
name: Home | |||||
# Location required to calculate the time the sun rises and sets | |||||
latitude: 50.0 | |||||
longitude: 14.4 | |||||
# C for Celcius, F for Fahrenheit | |||||
temperature_unit: C | |||||
time_zone: Europe/Prague | |||||
plugin: | |||||
# View all events in a logbook | |||||
logbook: | |||||
# Discover some devices automatically | |||||
discovery: | |||||
# Enables support for tracking state changes over time. | |||||
history: | |||||
# Checks for available updates | |||||
updater: | |||||
# Enables the frontend | |||||
frontend: | |||||
# Allows you to issue voice commands from the frontend | |||||
conversation: | |||||
# Track the sun | |||||
sun: |