diff --git a/.gitignore b/.gitignore index aa27aa435bd..d5c29180e09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,4 @@ config/* -!config/home-assistant.conf.default - -# There is not a better solution afaik.. -!config/custom_components -config/custom_components/* -!config/custom_components/example.py -!config/custom_components/hello_world.py -!config/custom_components/mqtt_example.py -!config/panels -config/panels/* -!config/panels/react.html tests/testing_config/deps tests/testing_config/home-assistant.log diff --git a/README.rst b/README.rst index 2b166cd9a13..ec0a770b1da 100644 --- a/README.rst +++ b/README.rst @@ -1,9 +1,7 @@ Home Assistant |Build Status| |Coverage Status| |Join the chat at https://gitter.im/home-assistant/home-assistant| |Join the dev chat at https://gitter.im/home-assistant/home-assistant/devs| ============================================================================================================================================================================================== -Home Assistant is a home automation platform running on Python 3. The -goal of Home Assistant is to be able to track and control all devices at -home and offer a platform for automating control. +Home Assistant is a home automation platform running on Python 3. It is to be able to track and control all devices at home and offer a platform for automating control. To get started: @@ -12,83 +10,19 @@ To get started: python3 -m pip install homeassistant hass --open-ui -Check out `the website `__ for `a -demo `__, installation instructions, -tutorials and documentation. +Check out `home-assistant.io `__ for `a +demo `__, `installation instructions `__, +`tutorials `__ and `documentation `__. |screenshot-states| -Examples of devices Home Assistant can interface with: +|screenshot-components| -- Monitoring connected devices to a wireless router: - `OpenWrt `__, - `Tomato `__, - `Netgear `__, - `DD-WRT `__, - `TPLink `__, - `ASUSWRT `__, - `Xiaomi `__ and any SNMP - capable Linksys WAP/WRT -- `Philips Hue `__ lights, - `WeMo `__ - switches, `Edimax `__ switches, - `Efergy `__ energy monitoring, and - `Tellstick `__ devices and - sensors -- `Google - Chromecasts `__, - `Music Player Daemon `__, `Logitech - Squeezebox `__, - `Plex `__, `Kodi (XBMC) `__, - iTunes (by way of - `itunes-api `__), and Amazon - Fire TV (by way of - `python-firetv `__) -- Support for - `ISY994 `__ - (Insteon and X10 devices), `Z-Wave `__, `Nest - Thermostats `__, - `RFXtrx `__, - `Arduino `__, `Raspberry - Pi `__, and - `Modbus `__ -- Interaction with `IFTTT `__ -- Integrate data from the `Bitcoin `__ network, - meteorological data from - `OpenWeatherMap `__ and - `Forecast.io `__, - `Transmission `__, or - `SABnzbd `__. -- `See full list of supported - devices `__ - -Build home automation on top of your devices: - -- Keep a precise history of every change to the state of your house -- Turn on the lights when people get home after sunset -- Turn on lights slowly during sunset to compensate for less light -- Turn off all lights and devices when everybody leaves the house -- Offers a `REST API `__ - and can interface with MQTT for easy integration with other projects - like `OwnTracks `__ -- Allow sending notifications using - `Instapush `__, `Notify My Android - (NMA) `__, - `PushBullet `__, - `PushOver `__, - `Slack `__, - `Telegram `__, `Join `__, and `Jabber - (XMPP) `__ - -The system is built using a modular approach so support for other devices or actions can -be implemented easily. See also the `section on -architecture `__ -and the `section on creating your own +The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the `section on architecture `__ and the `section on creating your own components `__. If you run into issues while using Home Assistant or during development -of a component, check the `Home Assistant help -section `__ of our website for further help and information. +of a component, check the `Home Assistant help section `__ of our website for further help and information. .. |Build Status| image:: https://travis-ci.org/home-assistant/home-assistant.svg?branch=master :target: https://travis-ci.org/home-assistant/home-assistant @@ -100,3 +34,5 @@ section `__ of our website for further help and :target: https://gitter.im/home-assistant/home-assistant/devs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge .. |screenshot-states| image:: https://raw.github.com/home-assistant/home-assistant/master/docs/screenshots.png :target: https://home-assistant.io/demo/ +.. |screenshot-components| image:: https://raw.github.com/home-assistant/home-assistant/dev/docs/screenshot-components.png + :target: https://home-assistant.io/components/ \ No newline at end of file diff --git a/config/configuration.yaml.example b/config/configuration.yaml.example deleted file mode 100644 index 08b0324371f..00000000000 --- a/config/configuration.yaml.example +++ /dev/null @@ -1,158 +0,0 @@ -homeassistant: - # Omitted values in this section will be auto detected using freegeoip.io - - # Location required to calculate the time the sun rises and sets. - # Coordinates are also used for location for weather related components. - # Google Maps can be used to determine more precise GPS coordinates. - latitude: 32.87336 - longitude: 117.22743 - - # Impacts weather/sunrise data - elevation: 665 - - # 'metric' for Metric System, 'imperial' for imperial system - unit_system: metric - - # Pick yours from here: - # http://en.wikipedia.org/wiki/List_of_tz_database_time_zones - time_zone: America/Los_Angeles - - # Name of the location where Home Assistant is running - name: Home - -http: - api_password: mypass - # Set to 1 to enable development mode - # development: 1 - -# Enable the frontend -frontend: - -light: -# platform: hue - -wink: - # Get your token at https://winkbearertoken.appspot.com - access_token: 'YOUR_TOKEN' - -device_tracker: - # The following tracker are available: - # https://home-assistant.io/components/#presence-detection - platform: netgear - host: 192.168.1.1 - username: admin - password: PASSWORD - -switch: - platform: wemo - -climate: - platform: nest - # Required: username and password that are used to login to the Nest thermostat. - username: myemail@mydomain.com - password: mypassword - -downloader: - download_dir: downloads - -notify: - platform: pushbullet - api_key: ABCDEFGHJKLMNOPQRSTUVXYZ - -device_sun_light_trigger: - # Optional: specify a specific light/group of lights that has to be turned on - light_group: group.living_room - # Optional: specify which light profile to use when turning lights on - light_profile: relax - # Optional: disable lights being turned off when everybody leaves the house - # disable_turn_off: 1 - -# A comma separated list of states that have to be tracked as a single group -# Grouped states should share the same type of states (ON/OFF or HOME/NOT_HOME) -# You can also have groups within groups. -# https://home-assistant.io/components/group/ -group: - default_view: - view: yes - entities: - - group.awesome_people - - group.climate - kitchen: - name: Kitchen - entities: - - switch.kitchen_pin_3 - upstairs: - name: Kids - icon: mdi:account-multiple - view: yes - entities: - - input_boolean.notify_home - - camera.demo_camera - -browser: -keyboard: - -# https://home-assistant.io/getting-started/automation/ -automation: - - alias: Turn on light when sun sets - trigger: - platform: sun - event: sunset - offset: "-01:00:00" - condition: - condition: state - entity_id: group.all_devices - state: 'home' - action: - service: light.turn_on - -# Another way to do is to collect all entries under one "sensor:" -# sensor: -# - platform: mqtt -# name: "MQTT Sensor 1" -# - platform: mqtt -# name: "MQTT Sensor 2" -# -# Details: https://home-assistant.io/getting-started/devices/ - -sensor: - platform: systemmonitor - resources: - - type: 'disk_use_percent' - arg: '/' - - type: 'disk_use_percent' - arg: '/home' - -sensor 2: - platform: cpuspeed - -script: - wakeup: - alias: Wake Up - sequence: - - event: LOGBOOK_ENTRY - event_data: - name: Paulus - message: is waking up - entity_id: device_tracker.paulus - domain: light - - alias: Bedroom lights on - service: light.turn_on - data: - entity_id: group.bedroom - brightness: 100 - - delay: - minutes: 1 - - alias: Living room lights on - service: light.turn_on - data: - entity_id: group.living_room - -scene: - - name: Romantic - entities: - light.tv_back_light: on - light.ceiling: - state: on - xy_color: [0.33, 0.66] - brightness: 200 diff --git a/config/custom_components/example.py b/config/custom_components/example.py deleted file mode 100644 index 4d3df9328d8..00000000000 --- a/config/custom_components/example.py +++ /dev/null @@ -1,149 +0,0 @@ -""" -Example of a custom component. - -Example component to target an entity_id to: - - turn it on at 7AM in the morning - - turn it on if anyone comes home and it is off - - turn it off if all lights are turned off - - turn it off if all people leave the house - - offer a service to turn it on for 10 seconds - -Configuration: - -To use the Example custom component you will need to add the following to -your configuration.yaml file. - -example: - target: TARGET_ENTITY - -Variable: - -target -*Required -TARGET_ENTITY should be one of your devices that can be turned on and off, -ie a light or a switch. Example value could be light.Ceiling or switch.AC -(if you have these devices with those names). -""" -import time -import logging - -from homeassistant.const import STATE_HOME, STATE_NOT_HOME, STATE_ON, STATE_OFF -from homeassistant.helpers import validate_config -from homeassistant.helpers.event_decorators import \ - track_state_change, track_time_change -from homeassistant.helpers.service import service -import homeassistant.components as core -from homeassistant.components import device_tracker -from homeassistant.components import light - -# The domain of your component. Should be equal to the name of your component. -DOMAIN = "example" - -# List of component names (string) your component depends upon. -# We depend on group because group will be loaded after all the components that -# initialize devices have been setup. -DEPENDENCIES = ['group', 'device_tracker', 'light'] - -# Configuration key for the entity id we are targeting. -CONF_TARGET = 'target' - -# Variable for storing configuration parameters. -TARGET_ID = None - -# Name of the service that we expose. -SERVICE_FLASH = 'flash' - -# Shortcut for the logger -_LOGGER = logging.getLogger(__name__) - - -def setup(hass, config): - """Setup example component.""" - global TARGET_ID - - # Validate that all required config options are given. - if not validate_config(config, {DOMAIN: [CONF_TARGET]}, _LOGGER): - return False - - TARGET_ID = config[DOMAIN][CONF_TARGET] - - # Validate that the target entity id exists. - if hass.states.get(TARGET_ID) is None: - _LOGGER.error("Target entity id %s does not exist", - TARGET_ID) - - # Tell the bootstrapper that we failed to initialize and clear the - # stored target id so our functions don't run. - TARGET_ID = None - return False - - # Tell the bootstrapper that we initialized successfully. - return True - - -@track_state_change(device_tracker.ENTITY_ID_ALL_DEVICES) -def track_devices(hass, entity_id, old_state, new_state): - """Called when the group.all devices change state.""" - # If the target id is not set, return - if not TARGET_ID: - return - - # If anyone comes home and the entity is not on, turn it on. - if new_state.state == STATE_HOME and not core.is_on(hass, TARGET_ID): - - core.turn_on(hass, TARGET_ID) - - # If all people leave the house and the entity is on, turn it off. - elif new_state.state == STATE_NOT_HOME and core.is_on(hass, TARGET_ID): - - core.turn_off(hass, TARGET_ID) - - -@track_time_change(hour=7, minute=0, second=0) -def wake_up(hass, now): - """Turn light on in the morning. - - Turn the light on at 7 AM if there are people home and it is not already - on. - """ - if not TARGET_ID: - return - - if device_tracker.is_on(hass) and not core.is_on(hass, TARGET_ID): - _LOGGER.info('People home at 7AM, turning it on') - core.turn_on(hass, TARGET_ID) - - -@track_state_change(light.ENTITY_ID_ALL_LIGHTS, STATE_ON, STATE_OFF) -def all_lights_off(hass, entity_id, old_state, new_state): - """If all lights turn off, turn off.""" - if not TARGET_ID: - return - - if core.is_on(hass, TARGET_ID): - _LOGGER.info('All lights have been turned off, turning it off') - core.turn_off(hass, TARGET_ID) - - -@service(DOMAIN, SERVICE_FLASH) -def flash_service(hass, call): - """Service that will toggle the target. - - Set the light to off for 10 seconds if on and vice versa. - """ - if not TARGET_ID: - return - - if core.is_on(hass, TARGET_ID): - core.turn_off(hass, TARGET_ID) - - time.sleep(10) - - core.turn_on(hass, TARGET_ID) - - else: - core.turn_on(hass, TARGET_ID) - - time.sleep(10) - - core.turn_off(hass, TARGET_ID) diff --git a/config/custom_components/hello_world.py b/config/custom_components/hello_world.py deleted file mode 100644 index b35e9f6c0ed..00000000000 --- a/config/custom_components/hello_world.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -The "hello world" custom component. - -This component implements the bare minimum that a component should implement. - -Configuration: - -To use the hello_word component you will need to add the following to your -configuration.yaml file. - -hello_world: -""" - -# The domain of your component. Should be equal to the name of your component. -DOMAIN = "hello_world" - -# List of component names (string) your component depends upon. -DEPENDENCIES = [] - - -def setup(hass, config): - """Setup our skeleton component.""" - # States are in the format DOMAIN.OBJECT_ID. - hass.states.set('hello_world.Hello_World', 'Works!') - - # Return boolean to indicate that initialization was successfully. - return True diff --git a/config/custom_components/mqtt_example.py b/config/custom_components/mqtt_example.py deleted file mode 100644 index 451a60deef4..00000000000 --- a/config/custom_components/mqtt_example.py +++ /dev/null @@ -1,55 +0,0 @@ -""" -Example of a custom MQTT component. - -Shows how to communicate with MQTT. Follows a topic on MQTT and updates the -state of an entity to the last message received on that topic. - -Also offers a service 'set_state' that will publish a message on the topic that -will be passed via MQTT to our message received listener. Call the service with -example payload {"new_state": "some new state"}. - -Configuration: - -To use the mqtt_example component you will need to add the following to your -configuration.yaml file. - -mqtt_example: - topic: "home-assistant/mqtt_example" -""" -import homeassistant.loader as loader - -# The domain of your component. Should be equal to the name of your component. -DOMAIN = "mqtt_example" - -# List of component names (string) your component depends upon. -DEPENDENCIES = ['mqtt'] - -CONF_TOPIC = 'topic' -DEFAULT_TOPIC = 'home-assistant/mqtt_example' - - -def setup(hass, config): - """Setup the MQTT example component.""" - mqtt = loader.get_component('mqtt') - topic = config[DOMAIN].get('topic', DEFAULT_TOPIC) - entity_id = 'mqtt_example.last_message' - - # Listen to a message on MQTT. - def message_received(topic, payload, qos): - """A new MQTT message has been received.""" - hass.states.set(entity_id, payload) - - mqtt.subscribe(hass, topic, message_received) - - hass.states.set(entity_id, 'No messages') - - # Service to publish a message on MQTT. - def set_state_service(call): - """Service to send a message.""" - mqtt.publish(hass, topic, call.data.get('new_state')) - - # Register our service with Home Assistant. - hass.services.register(DOMAIN, 'set_state', set_state_service) - - # Return boolean to indicate that initialization was successfully. - return True diff --git a/config/panels/react.html b/config/panels/react.html deleted file mode 100644 index dc2735cf759..00000000000 --- a/config/panels/react.html +++ /dev/null @@ -1,432 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/docs/screenshot-components.png b/docs/screenshot-components.png new file mode 100755 index 00000000000..247f3073a5e Binary files /dev/null and b/docs/screenshot-components.png differ