Merge branch 'current' into next
@ -22,3 +22,13 @@ Configuration variables:
|
||||
|
||||
- **email** (*Required*): Your email address for registration on Let's Encrypt.
|
||||
- **domains** (*Required*): A list of domains to create/renew the certificate.
|
||||
|
||||
## {% linkable_title Home Assistant configuration %}
|
||||
|
||||
Use the following configuration in Home Assistant to use the generated certificate:
|
||||
|
||||
```yaml
|
||||
http:
|
||||
ssl_certificate: /ssl/fullchain.pem
|
||||
ssl_key: /ssl/privkey.pem
|
||||
```
|
||||
|
@ -9,7 +9,7 @@ sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
Setting up a [SSH](https://openssh.org/) server allows access to hass.io folders with SSH client. It also allows tunneling for access from an external network. Please note that you only need to do this on a ResinOS platform as most Linux flavors have their own SSH server.
|
||||
Setting up an [SSH](https://openssh.org/) server allows access to your Hass.io folders with any SSH client. To use this add-on, you must have a private/public key to log in. To generate them, follow the [instructions for Windows][win] and [these for other platforms][other].
|
||||
|
||||
```json
|
||||
{
|
||||
@ -22,3 +22,10 @@ Setting up a [SSH](https://openssh.org/) server allows access to hass.io folders
|
||||
Configuration variables:
|
||||
|
||||
- **authorized_keys** (*Required*): Your public-keys for authorized keyfile. Every element will be a line inside that file.
|
||||
|
||||
[win]: https://www.digitalocean.com/community/tutorials/how-to-create-ssh-keys-with-putty-to-connect-to-a-vps
|
||||
[other]: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
|
||||
|
||||
<p class='note'>
|
||||
This add-on is not compatible when you installed Hass.io via the generic Linux installer.
|
||||
</p>
|
||||
|
@ -31,8 +31,7 @@ Configuration variables:
|
||||
- **port** (*Optional*): The port of your controller's web interface. Defaults to `8443`.
|
||||
- **username** (*Required*: The username of an user with administrative privileges, usually `admin`.
|
||||
- **password** (*Required*): The password for your given admin account.
|
||||
- **verify_ssl** (*Optional*): Verify the controllers SSL certificate. Defaults to True however can also be False or "path/to/custom_cert.pem".
|
||||
- **site_id** (*Optional*): Allows you to specify a `site_id` for device tracking. Defaults to `default`. Found in the URL of the controller (i.e. https://CONTROLLER:PORT/manage/site/SITE_ID/dashboard)
|
||||
- **verify_ssl** (*Optional*): Controls if the SSL certificate running on your Unifi webserver must be trusted by a known Certificate Authority on the server running Home Assistant. Defaults to 'True'.
|
||||
- **site_id** (*Optional*): Allows you to specify a `site_id` for device tracking. Defaults to `default`. Found in the URL of the controller (i.e. https://CONTROLLER:PORT/manage/site/SITE_ID/dashboard).
|
||||
- **verify_ssl** (*Optional*): Controls if the SSL certificate running on your Unifi webserver must be trusted by a known Certificate Authority on the server running Home Assistant. Defaults to 'True' but can also be a value that points to your custom cert "path/to/custom_cert.pem".
|
||||
|
||||
See the [device tracker component page](/components/device_tracker/) for instructions how to configure the people to be tracked.
|
||||
|
@ -32,6 +32,7 @@ Home Assistant can discover and automatically configure zeroconf/mDNS and uPnP d
|
||||
* Denon Network Receivers
|
||||
* Bose Soundtouch speakers
|
||||
* Axis Communications security devices
|
||||
* IKEA Trådfri (Tradfri)
|
||||
|
||||
It will be able to add Google Chromecasts and Belkin WeMo switches automatically, for Philips Hue it will require some configuration from the user.
|
||||
|
||||
@ -50,23 +51,24 @@ Configuration variables:
|
||||
- **ignore** (*Optional*): A list of platforms that never will be automatically configured by `discovery`.
|
||||
|
||||
Valid values for ignore are:
|
||||
* philips_hue: (Philips Hue)
|
||||
* google_cast: (Google Chromecast)
|
||||
* panasonic_viera: (Panasonic Viera)
|
||||
* plex_mediaserver: (Plex media server)
|
||||
* roku: (Roku media player)
|
||||
* sonos: (Sonos Speakers)
|
||||
* yamaha: (Yamaha media player)
|
||||
* logitech_mediaserver: (Logitech media server - Squeezebox player)
|
||||
* directv: (DirecTV)
|
||||
* denonavr: (Denon Network Receivers)
|
||||
* samsung_tv: (Samsung TV)
|
||||
* yeelight: (Yeelight Sunflower Bulb)
|
||||
* flux_led: (Flux Led/MagicLight)
|
||||
* apple_tv: (Apple TV)
|
||||
* openhome: (Linn / Openhome)
|
||||
* axis: (Axis Communications security devices)
|
||||
|
||||
* `apple_tv`: Apple TV
|
||||
* `axis`: (Axis Communications security devices)
|
||||
* `denonavr`: Denon Network Receivers
|
||||
* `directv`: DirecTV
|
||||
* `flux_led`: Flux Led/MagicLight
|
||||
* `google_cast`: Google Chromecast
|
||||
* `ikea_tradfri`: IKEA Trådfri
|
||||
* `logitech_mediaserver`: Logitech media server - Squeezebox player
|
||||
* `openhome`: Linn / Openhome
|
||||
* `panasonic_viera`: Panasonic Viera
|
||||
* `philips_hue`: Philips Hue
|
||||
* `plex_mediaserver`: Plex media server
|
||||
* `roku`: Roku media player
|
||||
* `samsung_tv`: (Samsung TV
|
||||
* `sonos`: Sonos Speakers
|
||||
* `yamaha`: Yamaha media player
|
||||
* `yeelight`: Yeelight Sunflower Bulb
|
||||
|
||||
<p class='note'>
|
||||
Home Assistant must be on the same network as the devices for uPnP discovery to work.
|
||||
|
@ -21,10 +21,10 @@ plant:
|
||||
name_of_your_plant:
|
||||
sensors:
|
||||
moisture: sensor.my_sensor_moisture
|
||||
battery: sensor.my_sensor_moisture_battery
|
||||
temperature: sensor.my_sensor_moisture_temperature
|
||||
conductivity: sensor.my_sensor_moisture_conductivity
|
||||
brightness: sensor.my_sensor_moisture_brightness
|
||||
battery: sensor.my_sensor_battery
|
||||
temperature: sensor.my_sensor_temperature
|
||||
conductivity: sensor.my_sensor_conductivity
|
||||
brightness: sensor.my_sensor_brightness
|
||||
min_moisture: 20
|
||||
```
|
||||
|
||||
|
@ -110,4 +110,18 @@ switch:
|
||||
service: switch.turn_on
|
||||
entity_id: switch.skylight_close
|
||||
```
|
||||
### {% linkable_title Change the icon %}
|
||||
|
||||
This example shows how to change the icon based on the day/night cycle.
|
||||
|
||||
```yaml
|
||||
sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
day_night:
|
||||
friendly_name: 'Day/Night'
|
||||
value_template: {% raw %}'{% if is_state("sun.sun", "above_horizon") %}Day{% else %}Night{% endif %}'{% endraw %}
|
||||
icon_template: {% raw %}'{% if is_state("sun.sun", "above_horizon") %}mdi:weather-sunny{% else %}mdi:weather-night{% endif %}'{% endraw %}
|
||||
|
||||
```
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
{% active_link /hassio/ Hass.io %}
|
||||
<ul>
|
||||
<li>{% active_link /hassio/installation/ Installation %}</li>
|
||||
<li>{% active_link /hassio/debugging/ Debugging %}</li>
|
||||
<li>{% active_link /addons/ Available add-ons %}</li>
|
||||
<li>{% active_link /hassio/installing_third_party_addons/ Installing third-party add-ons %}</li>
|
||||
<li>{% active_link /hassio/architecture/ Architecture %}</li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -16,12 +16,14 @@
|
||||
<li>
|
||||
{% active_link /hassio/addon_development/ Add-on Development %}
|
||||
<ul>
|
||||
<li>{% active_link /hassio/addon_tutorial/ Tutorial: Making your first add-on %}</li>
|
||||
<li>{% active_link /hassio/addon_config/ Configuration %}</li>
|
||||
<li>{% active_link /hassio/addon_testing/ Local Testing %}</li>
|
||||
<li>{% active_link /hassio/addon_publishing/ Publishing %}</li>
|
||||
<li>{% active_link /hassio/addon_repository/ Repositories %}</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>{% active_link /hassio/debugging/ Debugging Hass.io %}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -9,31 +9,28 @@ sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
As states in the [Style guidelines section](/developers/development_guidelines/) all code is checked as part of the linting process and unit test were run.
|
||||
|
||||
### {% linkable_title Local testing %}
|
||||
|
||||
**Important:** Run `tox` before you create your pull request to avoid annoying fixes. Local testing requires installing `tox`.
|
||||
|
||||
```bash
|
||||
$ pip3 install tox
|
||||
```
|
||||
|
||||
Start your code test with `tox`.
|
||||
As states in the [Style guidelines section](/developers/development_guidelines/) all code is checked to verify all unit tests pass and that the code passes the linting tools. Local testing is done using Tox, which has been installed as part of running `script/setup`. To start the tests, simply run it:
|
||||
|
||||
```bash
|
||||
$ tox
|
||||
```
|
||||
**Important:** Run `tox` before you create your pull request to avoid annoying fixes.
|
||||
|
||||
This will run unit tests against Python 3.4 and 3.5 (if both are available locally), as well as tests that validate `pep8` and `pylint` style.
|
||||
Running Tox will run unit tests against the locally available Pythons, as well as validate the code and document style using `pycodestyle`, `pydocstyle` and `pylint`. You can run tests on only one tox target -- just use `-e` to select an environment. For example, `tox -e lint` runs the linters only, and `tox -e py34` runs unit tests only on Python 3.4.
|
||||
|
||||
#### {% linkable_title Testing Tips %}
|
||||
Tox uses virtual environments under the hood to create isolated testing environments. The tox virtual environments will get out-of-date when requirements change, causing test errors. Run `tox -r` to tell Tox to recreate the virtual environments.
|
||||
|
||||
You can run tests on only one tox target -- just use `-e` to select an environment. For example, `tox -e lint` runs the linters only, and `tox -e py34` runs unit tests only on Python 3.4.
|
||||
If you are working on tests for a component or platform and you need the dependencies available inside the Tox environment, update the list inside `script/gen_requirements_all.py`. Then run the script and then run `tox -r` to recreate the virtual environments.
|
||||
|
||||
tox uses virtual environments under the hood to create isolated testing environments. The tox virtual environments will get out-of-date when requirements change, causing test errors. Run `tox -r` to create new tox virtual environments.
|
||||
### {% linkable_title Testing single files %}
|
||||
|
||||
During development on a specific file, speed up your workflow by running tests and linting only for the file that you're working on. To run individual files:
|
||||
Running tox will invoke the full test suite. Even if you specify which tox target to run, you still run all tests inside that target. That's not very convenient to quickly iterate on your code! To be able to run the specific test suites without Tox, you'll need to install the test dependencies into your Python environment:
|
||||
|
||||
```bash
|
||||
$ bash pip3 install -r requirements_test_all.txt
|
||||
```
|
||||
|
||||
Now that you have all test dependencies installed, you can run tests on individual files:
|
||||
|
||||
```bash
|
||||
$ flake8 homeassistant/core.py
|
||||
@ -48,8 +45,23 @@ You can also run linting tests against all changed files, as reported by `git di
|
||||
$ script/lint --changed
|
||||
```
|
||||
|
||||
#### {% linkable_title Py.test tips %}
|
||||
|
||||
Py.test has some great command line parameters to help you with the write-test-fix cycle.
|
||||
|
||||
```bash
|
||||
# Stop after the first test fails
|
||||
$ py.test tests/test_core.py -x
|
||||
# Run test with specified name
|
||||
$ py.test tests/test_core.py -k test_split_entity_id
|
||||
# Fail a test after it runs for 2 seconds
|
||||
$ py.test tests/test_core.py --timeout 2
|
||||
# Show the 10 slowest tests
|
||||
$ py.test tests/test_core.py --duration=10
|
||||
```
|
||||
|
||||
### {% linkable_title Preventing Linter Errors %}
|
||||
|
||||
|
||||
Save yourself the hassle of extra commits just to fix style errors by enabling the Flake8 git commit hook. Flake8 will check your code when you try to commit to the repository and block the commit if there are any style errors, which gives you a chance to fix them!
|
||||
|
||||
```bash
|
||||
@ -61,5 +73,4 @@ The `flake8-docstrings` extension will check docstrings according to [PEP257](ht
|
||||
|
||||
### {% linkable_title Notes on PyLint and PEP8 validation %}
|
||||
|
||||
If you can't avoid a PyLint warning, add a comment to disable the PyLint check for that line with `# pylint: disable=YOUR-ERROR-NAME`. An example of an unavoidable PyLint warning is not using the passed-in datetime if you're listening for a time change.
|
||||
|
||||
If you can't avoid a PyLint warning, add a comment to disable the PyLint check for that line with `# pylint: disable=YOUR-ERROR-NAME`. Example of an unavoidable one is if PyLint incorrectly reports that a certain object doesn't have a certain member.
|
||||
|
@ -85,11 +85,11 @@ The config for an add-on is stored in `config.json`.
|
||||
| url | no | Homepage of the addon. Here you can explain the add-ons and options.
|
||||
| startup | yes | `before` homeassistant will start. `after` homeassistant will start or `once` for application they don't run as deamon.
|
||||
| boot | yes | `auto` by system and manual or only `manual`
|
||||
| ports | no | Network ports they will be expose in docker style
|
||||
| ports | no | Network ports to expose from the container. Format is `"container-port/type": host-port`.
|
||||
| map | no | List of maps for additional hass.io folders. Possible values: `config`, `ssl`, `addons`, `backup`
|
||||
| options | yes | Default options value of the add-on
|
||||
| schema | yes | Schema for options value of the add-on
|
||||
| image | no | For custom add-ons.
|
||||
| image | no | For use dockerhub.
|
||||
|
||||
### {% linkable_title Options / Schema %}
|
||||
|
||||
|
@ -9,17 +9,35 @@ sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
All add-ons are simple docker containers. You can use our [build scripts][builder] to automate the whole build process or you can build your own docker image and push it manually to a docker hub. Inside your add-on `config.json` you specify the Docker image that will be installed for your add-on:
|
||||
There are two different ways of publishing add-ons. One is to publish pre-build containers to Docker Hub and the other option is to have users build the containers locally on their Hass.io instance.
|
||||
|
||||
**Pre-build containers**<br>
|
||||
With pre-build containers, the developer is responsible for building the images for each architecture on their machine and push the results out to Docker Hub. This has a lot of advantages for the user. As a user it will only have to download the final container and be up and running once the download finishes. This makes the installation process fast and almost no chance of failure. This is the preferred method.
|
||||
|
||||
We have automated the process of building and publishing add-ons. See below for the instructions.
|
||||
|
||||
**Locally build containers**<br>
|
||||
Starting Hass.io 0.26, it is possible to distribute add-ons that will be built on the users machine. The advantage is that as a developer it is easy to test an idea and see if people are interested in your add-ons. This method includes installing and potentially compiling code. This means that installing such an add-on is slow and adds more wear and tear to users SD card/hard drive than the above mentioned pre-build solution. It also has a higher chance of failure if one of the dependencies of the container has changed or is no longer available.
|
||||
|
||||
Use this option when you are playing with add-ons and seeing if someone is interested in your work. Once you're an established repository, please migrate to pushing builds to Docker Hub as it greatly improves the user experience. In the future we will mark locally built add-ons in the add-on store to warn users.
|
||||
|
||||
## {% linkable_title Build scripts to publish add-ons to Docker Hub %}
|
||||
|
||||
All add-ons are simple docker containers. Inside your add-on `config.json` you specify the Docker image that will be installed for your add-on:
|
||||
|
||||
```json
|
||||
{
|
||||
"image": "myhub/image-{arch}-addon-name"
|
||||
…
|
||||
|
||||
"image": "myhub/image-{arch}-addon-name",
|
||||
|
||||
…
|
||||
}
|
||||
```
|
||||
|
||||
You can use `{arch}` inside the image name to support multiple architectures with 1 configuration file. It will be replaced with the architecture of the user when we load the image.
|
||||
|
||||
Development best practices is to merge your changes into a branch like `build`. After you push the add-on to [Docker Hub](https://hub.docker.com/), you can merge this branch to master.
|
||||
Hass.io assumes that the `master` branch of your add-on repository matches the latest tag on Docker Hub. When you're building a new version, it's suggested that you use another branch, ie `build`. After you push the add-on to [Docker Hub](https://hub.docker.com/), you can merge this branch to master.
|
||||
|
||||
## {% linkable_title Custom Add-ons %}
|
||||
|
||||
|
205
source/hassio/addon_tutorial.markdown
Normal file
@ -0,0 +1,205 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Tutorial: Making your first add-on"
|
||||
description: "Easy tutorial to get started making your first add-on."
|
||||
date: 2017-05-12 13:28
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
So you've got Home Assistant going and you've been enjoying the built-in add-ons but you're missing this one application. Time to make your own add-on! In Hass.io 0.24 we introduced the option to have local add-ons be build on your device. This is great for developing new add-ons locally.
|
||||
|
||||
To get started with developing add-ons, we first need access to where Hass.io looks for local add-ons. For this you can use the Samba add-on or the SSH add-on.
|
||||
|
||||
For Samba, once you have enabled and started it, your Hass.io instance will show up in your local network tab and share a folder called "addons". This is the folder to store your custom add-ons.
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/hassio/tutorial/samba.png' />
|
||||
With Samba add-on enabled, you can browse to your Hass.io server over the local network. It will contain an addons folder to store your local add-ons.
|
||||
</p>
|
||||
|
||||
For SSH, you will have to install it. Before you can start it, you will have to have a private/public key pair and store your public key in the add-on config ([see docs for more info][ssh]). Once started, you can SSH to Hass.io and store your custom add-ons in "/addons".
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/hassio/tutorial/ssh.png' />
|
||||
Once you SSH into your Hass.io box, you have access to your add-ons in "/addons".
|
||||
</p>
|
||||
|
||||
Once you have located your add-on directory, it's time to get started!
|
||||
|
||||
[ssh]: /addons/ssh/
|
||||
|
||||
## {% linkable_title Step 1: The basics %}
|
||||
|
||||
- Create a new directory called `hello_world`
|
||||
- Inside that directory create three files.
|
||||
|
||||
`Dockerfile`:
|
||||
```
|
||||
FROM %%BASE_IMAGE%%
|
||||
|
||||
ENV VERSION %%VERSION%%
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
# Copy data for add-on
|
||||
COPY run.sh /
|
||||
RUN chmod a+x /run.sh
|
||||
|
||||
CMD [ "/run.sh" ]
|
||||
```
|
||||
|
||||
`config.json`:
|
||||
```json
|
||||
{
|
||||
"name": "Hello world",
|
||||
"version": "1",
|
||||
"slug": "hello_world",
|
||||
"description": "My first real add-on!",
|
||||
"startup": "before",
|
||||
"boot": "auto",
|
||||
"options": {},
|
||||
"schema": {}
|
||||
}
|
||||
```
|
||||
|
||||
`run.sh`:
|
||||
```bash
|
||||
echo Hello world!
|
||||
```
|
||||
|
||||
## {% linkable_title Step 2: Installing and testing your add-on %}
|
||||
|
||||
Now comes the fun part, time to open the Hass.io UI and install and run your add-on.
|
||||
|
||||
- Open the Home Assistant frontend
|
||||
- Go to the Hass.io panel
|
||||
- On the top right click the shopping basket to go to the add-on store.
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/hassio/screenshots/main_panel_store_icon.png' />
|
||||
From the Hass.io main panel open the add-on store.
|
||||
</p>
|
||||
|
||||
- On the top right click the refresh button
|
||||
- You should now see a new card called "Local" that lists your add-on!
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/hassio/screenshots/local_repository.png' />
|
||||
The Hass.io add-on store will list all available local add-ons.
|
||||
</p>
|
||||
|
||||
- Click on your add-on to go to the add-on details page.
|
||||
- Install your add-on
|
||||
- Start your add-on
|
||||
- Refresh the logs of your add-on, you should now see "Hello world!" in your logs.
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/hassio/tutorial/addon_hello_world_logs.png' />
|
||||
The add-on will print Hello world to the logs and then quit.
|
||||
</p>
|
||||
|
||||
### {% linkable_title I don't see my add-on?! %}
|
||||
|
||||
Oops! You clicked refresh in the store and your add-on didn't show up. Or maybe you just updated an option, clicked refresh and saw your add-on disappear.
|
||||
|
||||
When this happens, it means that your `config.json` is invalid. It's either invalid JSON or one of the specified options is incorrect. To see what went wrong, go to the Hass.io panel and in the supervisor card click on "View logs". This should bring you to a page with the logs of the supervisor. Scroll to the bottom and you should be able to find the validation error.
|
||||
|
||||
Once you fixed the error, go to the add-on store and click refresh again.
|
||||
|
||||
## {% linkable_title Step 3: Hosting a server %}
|
||||
|
||||
Until now we've been able to do some basic stuff, but it's not very useful yet. So let's take it one step further and host a server that we expose on a port. For this we're going to use the built-in HTTP server that comes with Python 3.
|
||||
|
||||
To do this, we will need to update our files as follows:
|
||||
|
||||
- `Dockerfile`: Install Python 3
|
||||
- `config.json`: Make the port from the container available on the host
|
||||
- `run.sh`: Run the Python 3 command to start the HTTP server
|
||||
|
||||
Add to your `Dockerfile` before `RUN`:
|
||||
|
||||
```
|
||||
# Install requirements for add-on
|
||||
RUN apk add --no-cache python3
|
||||
|
||||
# Python 3 HTTP Server serves the current working dir
|
||||
# So let's set it to our add-on persistent data directory.
|
||||
WORKDIR /data
|
||||
```
|
||||
|
||||
Add "ports" to `config.json`. This will make TCP on port 8000 inside the container available on the host on port 8000.
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Hello world",
|
||||
"version": "0.2",
|
||||
"slug": "hello_world",
|
||||
"description": "My first real add-on!",
|
||||
"startup": "before",
|
||||
"boot": "auto",
|
||||
"options": {},
|
||||
"schema": {},
|
||||
"ports": {
|
||||
"8000/tcp": 8000
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Update `run.sh` to start the Python 3 server:
|
||||
|
||||
```
|
||||
python3 -m http.server
|
||||
```
|
||||
|
||||
## {% linkable_title Step 4: Installing the update %}
|
||||
|
||||
Since we updated the version number in our `config.json`, Home Assistant will show an update button when looking at the add-on details. You might have to refresh your browser or click the refresh button in the add-on store for it to show up. If you did not update the version number, you can also uninstall and install the add-on again. After installing the add-on again, make sure you start it.
|
||||
|
||||
Now navigate to [http://hassio.local:8000](http://hassio.local:8000) to see our server in action!
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/hassio/tutorial/python3-http-server.png' />
|
||||
The Python 3 server will allow you to browse the /data folder.
|
||||
</p>
|
||||
|
||||
## {% linkable_title Bonus: Working with add-on options %}
|
||||
|
||||
In the screenshot you've probably seen that our server only served up 1 file: `options.json`. This file contains the user configuration for this add-on. Because we specified an empty "config" and "schema" in our `config.json`, the file is currently empty.
|
||||
|
||||
Let's see if we can get some data into that file!
|
||||
|
||||
To do this, we need to specify the default options and a schema for the user to change the options.
|
||||
|
||||
Change the options and schema entries in your `config.json` with the following:
|
||||
|
||||
```json
|
||||
{
|
||||
…
|
||||
|
||||
"options": {
|
||||
"beer": true,
|
||||
"wine": true,
|
||||
"liquor": false,
|
||||
"name": "world",
|
||||
"year": 2017
|
||||
},
|
||||
"schema": {
|
||||
"beer": "bool",
|
||||
"wine": "bool",
|
||||
"liquor": "bool",
|
||||
"name": "str",
|
||||
"year": "int"
|
||||
},
|
||||
|
||||
…
|
||||
}
|
||||
```
|
||||
|
||||
Refresh the add-on store and re-install your add-on. You will now see the options available in the add-on config screen. When you now go back to our Python 3 server and download `options.json`, you'll see the options you set.
|
||||
|
||||
- [Learn more about the available schema options.](/hassio/addon_config/#options--schema)
|
||||
- [See how options.json can be used inside `run.sh`](https://github.com/home-assistant/hassio-addons/blob/master/mosquitto/run.sh#L4-L6)
|
||||
|
||||
### [Next step: Add-on config reference »](/hassio/addon_config/)
|
@ -9,7 +9,7 @@ sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
The following debug tips and tricks are for people who are running the Hass.io image. If you use the generic Linux installer script, you should be able to access your host and logs as per your host.
|
||||
The following debug tips and tricks are for people who are running the Hass.io image and are working on the base image. If you use the generic Linux installer script, you should be able to access your host and logs as per your host.
|
||||
|
||||
## {% linkable_title SSH access to the host %}
|
||||
|
||||
|
@ -21,6 +21,10 @@ Hass.io images are available for all available Raspberry Pi and intel nuc platfo
|
||||
- Insert SD card to Raspberry Pi and turn it on. On first boot, it downloads the latest version of Home Assistant which can take some time.
|
||||
- You will be able to reach your installation at [http://hassio.local][local].
|
||||
|
||||
<p class='note'>
|
||||
If you copy over your existing Home Assistant configuration, make sure to enable the Hass.io panel by adding either `discovery:` or `hassio:` to your configuration.
|
||||
</p>
|
||||
|
||||
### {% linkable_title Alternative: install on generic Linux server %}
|
||||
|
||||
For advanced users, it is also possible to try Hass.io on your Linux server or inside a VM. To do so, [follow these instructions][linux].
|
||||
|
30
source/hassio/installing_third_party_addons.markdown
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Installing third-party add-ons"
|
||||
description: "Instructions how to get started using third-party add-ons."
|
||||
date: 2017-05-14 13:28
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
Hass.io allows anyone to create add-on repositories to easily share their add-ons for Hass.io. To try this locally, you can use our example add-on repository at `https://github.com/home-assistant/hassio-addons-example`.
|
||||
|
||||
<p class='note warning'>
|
||||
Home Assistant cannot guarantee the quality or security of third party add-ons. Use at your own risk.
|
||||
</p>
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/hassio/screenshots/main_panel_store_icon.png' />
|
||||
From the Hass.io main panel open the add-on store.
|
||||
</p>
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/hassio/screenshots/repositories_editor.png' />
|
||||
Add the urls of repositories (one per line) and then press "Save". A new card for the repository will appear.
|
||||
</p>
|
||||
|
||||
### {% linkable_title Help: Repository is not showing up %}
|
||||
|
||||
If you have added a repository but it's not showing up, it means that the repository contains invalid configuration. Go to the Hass.io panel -> Supervisor card -> View logs and scroll to the bottom. It should tell you what went wrong. Report this information to the repository author.
|
BIN
source/images/hassio/screenshots/addon_repository_editor.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
source/images/hassio/screenshots/local_repository.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
source/images/hassio/screenshots/main_panel_store_icon.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
source/images/hassio/screenshots/repositories_editor.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
source/images/hassio/tutorial/addon_hello_world_logs.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
source/images/hassio/tutorial/python3-http-server.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
source/images/hassio/tutorial/samba.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
source/images/hassio/tutorial/ssh.png
Normal file
After Width: | Height: | Size: 7.6 KiB |