GithubHelp home page GithubHelp logo

voxpupuli / puppet-homeassistant Goto Github PK

View Code? Open in Web Editor NEW
8.0 38.0 9.0 179 KB

Puppet Module for Home Assistant - home automation platform. https://home-assistant.io/

License: Apache License 2.0

Ruby 62.45% Puppet 31.14% HTML 6.41%
linux-puppet-module puppet hacktoberfest centos-puppet-module debian-puppet-module oraclelinux-puppet-module redhat-puppet-module scientific-puppet-module ubuntu-puppet-module

puppet-homeassistant's Introduction

Puppet module for Home Assistant

Build Status Code Coverage Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores

Description

Home Assistant is an open-source home automation platform running on Python 3. This puppet module can be used to install and configurue Home Assistant. Home assistant is installed within an python3 virtualenv environment.

Home Assistant - https://home-assistant.io/

Usage

To install and start homeassistant

include homeassistant

or with a custom configuration.

class{'homeassistant':
    location_name => 'Arc de Triomphe',
    latitude      => 48.8738,
    longitude     => 2.2950,
    elevation     => 300,
    unit_system   => 'metric',
    time_zone     => 'Europe/Paris'
}

Parameters for homeassistant class

  • user - Specify a username to run the service as. Default: homeassistant
  • home - Home directory of user and virtualeven for software. Default: /srv/homeassistant
  • ...

Adding Components

Simple components with no configuration.

homeassistant::component{
  [
    'config',
    'http',
    'frontend',
    'updater',
    'discovery',
    'conversation',
    'history',
    'sun',
    'logbook',
  ]:
}

Components with configuration.

homeassistant::component{'tts':
  config => {'platform' => 'google'}
}

homeassistant::component{'device_tracker':
  config => [
    {'platform' => 'netgear',
     'host'     => 'router.example.org',
     'username' => 'admin',
     'password' => 'secret',
    }
  ],
}

Multiple Instances of one Component, e.g. Switches

homeassistant::component{'myswitchs':
  component => 'switch',
  config    => [
                 {'platform' => 'google',
                 },
                 {'platform' => 'tplink',
                  'host'     => 'myplug.example.org',
                  'username' => 'foo',
                  'password' => 'bar',
                 },
               ],
  }
}
homeassistant::component{'otherswitches':
  component => 'switch',
  config    => {
    platform => 'command_line',
    switches => {
                  'command_on'    => '/bin/echo on > /tmp/hi',
                  'command_off'   => '/bin/ehco off > /tmp/hi',
                  'command_state' => '/bin/grep -q on /tmp/hi',
                  'friendly_name' => 'Is the file on',
                }
    }
  }
}

Authors

puppet-homeassistant is maintained by VoxPupuli. It was originally written by Steve Traylen.

puppet-homeassistant's People

Contributors

alexjfisher avatar bastelfreak avatar bbriggs avatar dhoppe avatar juniorsysadmin avatar kenyon avatar llowder avatar lordievader avatar maxadamo avatar sandra-thieme avatar smortex avatar themeier avatar tragiccode avatar traylenator avatar zilchms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-homeassistant's Issues

Documentation bug - homeassistant::user isn't configurable

The README states ...

Parameters for homeassistant class

  • user - Specify a username to run the service as. Default: homeassistant
  • home - Home directory of user and virtualeven for software. Default: /srv/homeassistant
  • ...

The class seems to take no parameter user, and the user seems to be hard-coded in the service template.

The easiest would be to drop the line about user from the README. I can for sure drop a pull request on that one.

The more proper would be to add that parameter there, but it requires a bit more work.

Python fails to install on CentOs7

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10
  • Ruby:
  • Distribution: CentOs 7.5
  • Module version: puppet-homeassistant (v0.2.1)

How to reproduce (e.g Puppet code you use)

Only have hiera code:

classes:
  - homeassistant
homeassistant::location_name: xxx
... other main configs

What are you seeing

Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install python3' returned 1: Error: Nothing to do
Error: /Stage[main]/Python::Install/Package[python]/ensure: change from purged to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install python3' returned 1: Error: Nothing to do

What behaviour did you expect instead

python to be installed

Output log

[root@homeassistant ~]# puppet agent -t                                                    
Info: Using configured environment 'production'                                            
Info: Retrieving pluginfacts                                                               
Info: Retrieving plugin                                                                    
Info: Loading facts                                                                        
Info: Caching catalog for homeassistant.alf                                                
Info: Applying configuration version '1535339556'                                          
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install python3' returned 1: Error: Nothing 
to do                                                                                      
Error: /Stage[main]/Python::Install/Package[python]/ensure: change from purged to present f
ailed: Execution of '/usr/bin/yum -d 0 -e 0 -y install python3' returned 1: Error: Nothing 
to do                                                                                      
Notice: /Stage[main]/Python::Install/Package[virtualenv]: Dependency Package[python] has fa
ilures: true                                                                               
Warning: /Stage[main]/Python::Install/Package[virtualenv]: Skipping because of failed depen
dencies                                                                                    
Notice: /Stage[main]/Python::Install/Package[pip]: Dependency Package[python] has failures:
 true                                                                                      
Warning: /Stage[main]/Python::Install/Package[pip]: Skipping because of failed dependencies
                                                                                           
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install python3-devel' returned 1: Error: No
thing to do                                                                                
Error: /Stage[main]/Python::Install/Package[python-dev]/ensure: change from purged to prese
nt failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install python3-devel' returned 1: Error
: Nothing to do                                                                            
Notice: /Stage[main]/Python/Anchor[python::end]: Dependency Package[python] has failures: t
rue                                                                                        
Notice: /Stage[main]/Python/Anchor[python::end]: Dependency Package[python-dev] has failure
s: true                                                                                    
Warning: /Stage[main]/Python/Anchor[python::end]: Skipping because of failed dependencies  
Notice: /Stage[main]/Homeassistant::Install/Python::Pyvenv[/srv/homeassistant]/Exec[python_
virtualenv_/srv/homeassistant]/returns: executed successfully                              
Notice: /Stage[main]/Homeassistant::Install/Python::Pip[homeassistant]/Exec[pip_install_hom
eassistant]: Dependency Package[python] has failures: true                                 
Notice: /Stage[main]/Homeassistant::Install/Python::Pip[homeassistant]/Exec[pip_install_hom
eassistant]: Dependency Package[python-dev] has failures: true                             
Warning: /Stage[main]/Homeassistant::Install/Python::Pip[homeassistant]/Exec[pip_install_ho
meassistant]: Skipping because of failed dependencies                                      
Info: Class[Homeassistant::Install]: Unscheduling all events on Class[Homeassistant::Instal
l]                                                                                         
Notice: /Stage[main]/Homeassistant::Config/Concat[configuration.yaml]/Concat_file[configura
tion.yaml]: Dependency Package[python] has failures: true                                  
Notice: /Stage[main]/Homeassistant::Config/Concat[configuration.yaml]/Concat_file[configura
tion.yaml]: Dependency Package[python-dev] has failures: true                              
Warning: /Stage[main]/Homeassistant::Config/Concat[configuration.yaml]/Concat_file[configur
ation.yaml]: Skipping because of failed dependencies                                       
Notice: /Stage[main]/Homeassistant::Config/Concat[configuration.yaml]/File[/etc/homeassista
nt/configuration.yaml]: Dependency Package[python] has failures: true                      
Notice: /Stage[main]/Homeassistant::Config/Concat[configuration.yaml]/File[/etc/homeassista
nt/configuration.yaml]: Dependency Package[python-dev] has failures: true                  
Warning: /Stage[main]/Homeassistant::Config/Concat[configuration.yaml]/File[/etc/homeassist
ant/configuration.yaml]: Skipping because of failed dependencies                           
Notice: /Stage[main]/Homeassistant::Config/Concat::Fragment[homeassistant]/Concat_fragment[
homeassistant]: Dependency Package[python] has failures: true                              
Notice: /Stage[main]/Homeassistant::Config/Concat::Fragment[homeassistant]/Concat_fragment[
homeassistant]: Dependency Package[python-dev] has failures: true                          
Warning: /Stage[main]/Homeassistant::Config/Concat::Fragment[homeassistant]/Concat_fragment
[homeassistant]: Skipping because of failed dependencies                                   
Notice: /Stage[main]/Homeassistant::Config/Concat[known_devices.yaml]/Concat_file[known_dev
ices.yaml]: Dependency Package[python] has failures: true                                  
Notice: /Stage[main]/Homeassistant::Config/Concat[known_devices.yaml]/Concat_file[known_dev
ices.yaml]: Dependency Package[python-dev] has failures: true                              
Warning: /Stage[main]/Homeassistant::Config/Concat[known_devices.yaml]/Concat_file[known_de
vices.yaml]: Skipping because of failed dependencies                                       
Notice: /Stage[main]/Homeassistant::Config/Concat[known_devices.yaml]/File[/etc/homeassista
nt/known_devices.yaml]: Dependency Package[python] has failures: true                      
Notice: /Stage[main]/Homeassistant::Config/Concat[known_devices.yaml]/File[/etc/homeassista
nt/known_devices.yaml]: Dependency Package[python-dev] has failures: true                  
Warning: /Stage[main]/Homeassistant::Config/Concat[known_devices.yaml]/File[/etc/homeassist
ant/known_devices.yaml]: Skipping because of failed dependencies                           
Notice: /Stage[main]/Homeassistant::Service/Service[homeassistant]: Dependency Package[pyth
on] has failures: true                                                                     
Notice: /Stage[main]/Homeassistant::Service/Service[homeassistant]: Dependency Package[pyth
on-dev] has failures: true                                                                 
Warning: /Stage[main]/Homeassistant::Service/Service[homeassistant]: Skipping because of fa
iled dependencies                                                                          
Notice: Applied catalog in 8.41 seconds                                                    

Any additional information you'd like to impart

Possibly could use a parameter to specify the python version to install, or allowing another python class to manage the python installation (puppet-python ? ), or possibly a parameter to not manage the python installation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.