Kaynağa Gözat

Getting ready

pull/1/head
Ales Komarek 8 yıl önce
ebeveyn
işleme
3d81462f9c
11 değiştirilmiş dosya ile 104 ekleme ve 36 silme
  1. +8
    -6
      README.rst
  2. +11
    -0
      home_assistant/files/configuration.yaml
  3. +0
    -1
      home_assistant/files/home_assistant.conf
  4. +2
    -0
      home_assistant/files/known_devices.yaml
  5. +1
    -0
      home_assistant/files/requirements.txt
  6. +0
    -0
      home_assistant/files/supervisor.conf
  7. +3
    -20
      home_assistant/map.jinja
  8. +0
    -8
      home_assistant/meta/sensu.yml
  9. +1
    -1
      home_assistant/meta/sphinx.yml
  10. +54
    -0
      home_assistant/server.sls
  11. +24
    -0
      metadata/service/server/single.yml

+ 8
- 6
README.rst Dosyayı Görüntüle

@@ -1,23 +1,25 @@

==================================
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
==============

Single home_assistant service
Single homeassistant service

.. code-block:: yaml

home_assistant:
server:
enabled: true
version: icehouse
bind:
address: 0.0.0.0
port: 8123

Read more
=========

* links
* https://home-assistant.io/getting-started/

+ 11
- 0
home_assistant/files/configuration.yaml Dosyayı Görüntüle

@@ -0,0 +1,11 @@
{%- 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) }}

+ 0
- 1
home_assistant/files/home_assistant.conf Dosyayı Görüntüle

@@ -1 +0,0 @@
# Service config file

+ 2
- 0
home_assistant/files/known_devices.yaml Dosyayı Görüntüle

@@ -0,0 +1,2 @@
{%- from "home_assistant/map.jinja" import server with context %}
{{ server.known_device|yaml(False) }}

+ 1
- 0
home_assistant/files/requirements.txt Dosyayı Görüntüle

@@ -0,0 +1 @@
homeassistant

+ 0
- 0
home_assistant/files/supervisor.conf Dosyayı Görüntüle


+ 3
- 20
home_assistant/map.jinja Dosyayı Görüntüle

@@ -1,29 +1,12 @@

{%- set source_engine = salt['pillar.get']('home_assistant:server:source:engine') %}

{%- 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:
pkgs:
- helpdesk
- python3-dev
- python3-pip
dir:
base: /usr/lib/home_assistant
{%- endif %}
base: /srv/home_assistant
{%- endload %}

{%- set server = salt['grains.filter_by'](base_defaults, merge=salt['pillar.get']('home_assistant:server')) %}

+ 0
- 8
home_assistant/meta/sensu.yml Dosyayı Görüntüle

@@ -1,8 +0,0 @@
# 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

+ 1
- 1
home_assistant/meta/sphinx.yml Dosyayı Görüntüle

@@ -2,7 +2,7 @@
# Fill in documentation details
doc:
name: home_assistant
description: Some service info
description: Home Assistant is an open-source home automation platform.
role:
server:
name: server

+ 54
- 0
home_assistant/server.sls Dosyayı Görüntüle

@@ -1,4 +1,58 @@
{%- from "home_assistant/map.jinja" import server with context %}
{%- 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 %}

+ 24
- 0
metadata/service/server/single.yml Dosyayı Görüntüle

@@ -8,3 +8,27 @@ parameters:
enabled: true
bind:
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:

Yükleniyor…
İptal
Kaydet