mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 09:17:06 +00:00
Merge branch 'current' into next
This commit is contained in:
commit
be219c8d59
@ -141,13 +141,12 @@ social:
|
||||
# Home Assistant release details
|
||||
current_major_version: 0
|
||||
current_minor_version: 45
|
||||
current_patch_version: 0
|
||||
date_released: 2017-05-20
|
||||
current_patch_version: 1
|
||||
date_released: 2017-05-22
|
||||
|
||||
# Either # or the anchor link to latest release notes in the blog post.
|
||||
# Must be prefixed with a # and have double quotes around it.
|
||||
# Major release:
|
||||
patch_version_notes: "#"
|
||||
patch_version_notes: "#release-0451---may-22"
|
||||
# Minor release (Example #release-0431---april-25):
|
||||
#patch_version_notes: "#release-0451---may-X"
|
||||
|
||||
|
54
source/_addons/dhcp_server.markdown
Normal file
54
source/_addons/dhcp_server.markdown
Normal file
@ -0,0 +1,54 @@
|
||||
---
|
||||
layout: page
|
||||
title: "DHCP server"
|
||||
description: "A simple dhcp server"
|
||||
date: 2017-04-30 13:28
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
Create a simple DHCP server for your network and allow set fix ip for some devices.
|
||||
|
||||
```json
|
||||
{
|
||||
"domain": "mynetwork.local",
|
||||
"dns": ["8.8.8.8", "8.8.4.4"],
|
||||
"networks": [
|
||||
{
|
||||
"subnet": "192.168.1.0",
|
||||
"netmask": "255.255.255.0",
|
||||
"range_start": "192.168.1.100",
|
||||
"range_end": "192.168.1.200",
|
||||
"broadcast": "192.168.1.255",
|
||||
"gateway": "192.168.1.1",
|
||||
"interface": "eth0"
|
||||
}
|
||||
],
|
||||
"hosts": [
|
||||
{
|
||||
"name": "webcam_xy",
|
||||
"mac": "aa:bb:ee:cc",
|
||||
"ip": "192.168.1.40"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **domain** (*Required*): Your network domain name.
|
||||
- **dns** (*Required*): A list of DNS server for your network.
|
||||
- **networks** (*Optional*): A list of network to provide DHCP.
|
||||
- **subnet** (*Required*): Your network schema.
|
||||
- **netmask** (*Required*): Your network netmask.
|
||||
- **range_start** (*Required*): Start address for dhcp leases.
|
||||
- **range_end** (*Required*): End address for dhcp leases.
|
||||
- **broadcast** (*Required*): Network broadcast address.
|
||||
- **gateway** (*Required*): A List of gateways.
|
||||
- **interface** (*Required*): Inteface on that will be listen.
|
||||
- **hosts** (*Optional*): A list of fixed IPs for devices.
|
||||
- **name** (*Required*): Name/hostname of your device.
|
||||
- **mac** (*Required*): Mac address of your device.
|
||||
- **ip** (*Required*): Fix ip address for device.
|
34
source/_addons/dnsmasq.markdonw
Normal file
34
source/_addons/dnsmasq.markdonw
Normal file
@ -0,0 +1,34 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Dnsmasq"
|
||||
description: "A simple dns server with benefits."
|
||||
date: 2017-04-30 13:28
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
Setup and manage a [Dnsmasq](http://thekelleys.org.uk/dnsmasq/doc.html) dns server. This allow your to manipulate some dns requests. I.e. that inside your network, your homeassistant domain will resolve with a internal address.
|
||||
|
||||
<p class='note warning'>
|
||||
At the moment, it will not work with resinos!
|
||||
</p>
|
||||
|
||||
```json
|
||||
{
|
||||
"defaults": ["8.8.8.8", "8.8.4.4"],
|
||||
"forwards": [
|
||||
{"domain": "mystuff.local", "server": "192.168.1.40"}
|
||||
],
|
||||
"hosts": [
|
||||
{"host": "home.mydomain.io", "ip": "192.168.1.10"}
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **defaults** (*Required*): A list of dns server to forward default requests.
|
||||
- **forwards** (*Optional*): A list of domains that will forward to a specific server.
|
||||
- **hosts** (*Optional*): A list of hosts to resolve it static.
|
@ -29,7 +29,7 @@ axis:
|
||||
- camera
|
||||
- motion
|
||||
- pir
|
||||
- audio
|
||||
- sound
|
||||
- daynight
|
||||
trigger_time: 0
|
||||
location: köket
|
||||
|
@ -19,7 +19,7 @@ The `mqtt` binary sensor platform uses the MQTT message payload as the sensor va
|
||||
To use your MQTT binary sensor in your installation, add the following to your `configuration.yaml` file:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yml entry
|
||||
# Example configuration.yaml entry
|
||||
binary_sensor:
|
||||
- platform: mqtt
|
||||
state_topic: "home-assistant/window/contact"
|
||||
@ -44,7 +44,7 @@ $ mosquitto_pub -h 127.0.0.1 -t home-assistant/window/contact -m "OFF"
|
||||
An extended configuration for the same sensor could look like this if you want/need to be more specific.
|
||||
|
||||
```yaml
|
||||
# Example configuration.yml entry
|
||||
# Example configuration.yaml entry
|
||||
binary_sensor:
|
||||
- platform: mqtt
|
||||
state_topic: "home-assistant/window/contact"
|
||||
|
@ -38,10 +38,12 @@ binary_sensor:
|
||||
|
||||
### {% linkable_title Setup of the myStrom Buttons %}
|
||||
|
||||
After the Wifi Buttons are connected to your Wireless network, you have three minutes to set the actions for the push patterns. The fastest way is to use `curl`. Check the [documentation](https://mystrom.ch/wp-content/uploads/REST_API_WBP.txt) of the WiFi Button for further details about implementation (`http://` is replaced by `get://` or `post://`). `action` is the name of the corresponding push pattern.
|
||||
You need to configure every button to make it work with Home Assistant. First connect the Wifi Buttons to your wireless network. Keep in mind that they only support WPS (Wi-FI Protected Setup). Once a button is connected you have three minutes to set the actions for the push patterns. The fastest way is to use `curl`. Check the [documentation](https://mystrom.ch/wp-content/uploads/REST_API_WBP.txt) of the WiFi Button for further details about the implementation (`http://` is replaced by `get://` or `post://`). `action` is the name of the corresponding push pattern (see above).
|
||||
|
||||
The endpoint that is recieving the data is `[IP address Home Assistant]:8123/api/mystrom`.
|
||||
|
||||
```bash
|
||||
$ curl -d "[action]=get://[IP address Home Assistant]:8123/api/mystrom?single%3D[ID of the button]" http://[IP address of the button]/api/v1/device/[MAC address of the button]
|
||||
$ curl -d "[action]=get://[IP address Home Assistant]:8123/api/mystrom?[action]%3D[ID of the button]" http://[IP address of the button]/api/v1/device/[MAC address of the button]
|
||||
{
|
||||
"[MAC address of the button]": {
|
||||
"type": "button",
|
||||
@ -51,7 +53,7 @@ $ curl -d "[action]=get://[IP address Home Assistant]:8123/api/mystrom?single%3D
|
||||
"charge": true,
|
||||
"voltage": 4.292,
|
||||
"fw_version": "2.26",
|
||||
"single": "get://[IP address Home Assistant]:8123/api/mystrom?single=[if of the button]",
|
||||
"single": "get://[IP address Home Assistant]:8123/api/mystrom?single=[id of the button]",
|
||||
"double": "",
|
||||
"long": "",
|
||||
"touch": ""
|
||||
|
@ -11,6 +11,7 @@ logo: home-assistant.png
|
||||
ha_category: Image Processing
|
||||
featured: false
|
||||
ha_release: 0.45
|
||||
og_image: /images/screenshots/ssocr.png
|
||||
---
|
||||
|
||||
The `seven_segments` image processing platform allows you to read physical seven segments displays through Home Assistant. [`ssocr`](https://www.unix-ag.uni-kl.de/~auerswal/ssocr/) is used to extract the value shown on the display which is observed by a [camera](/components/camera/). `ssocr` need to be available on your system. Check the installation instruction for Fedora below or use `$ sudo apt-get install ssocr` on a Debian-based system:
|
||||
@ -35,7 +36,7 @@ image_processing:
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **ssocr_bin** (*Optional*): The command line tool `ssocr`. Set it if you use a different name for the executable. Defaults to `ssorc`.
|
||||
- **ssocr_bin** (*Optional*): The command line tool `ssocr`. Set it if you use a different name for the executable. Defaults to `ssocr`.
|
||||
- **x_position** (*Optional*): X coordinate of the upper left corner of the area to crop. Defaults to `0`.
|
||||
- **y_position** (*Optional*): Y coordinate of the upper left corner of the area to crop. Defaults to `0`.
|
||||
- **height** (*Optional*): Height of the area to crop. Defaults to `0`.
|
||||
|
@ -33,7 +33,7 @@ kira:
|
||||
host: 0.0.0.0
|
||||
port: 65432
|
||||
remotes:
|
||||
name: kira_remote
|
||||
- name: kira_remote
|
||||
host: 192.168.100.1
|
||||
port: 65432
|
||||
```
|
||||
|
@ -21,12 +21,15 @@ Supported devices:
|
||||
- Denon DRA-N5
|
||||
- Denon RCD-N8 (untested)
|
||||
- Denon RCD-N9 (partial support)
|
||||
- Denon AVR receivers with Integrated Network support (partial support)
|
||||
- Denon AVR receivers with integrated Network support (partial support)
|
||||
- Denon AVR-X4100W (via denonavr platform)
|
||||
- Denon AVR receivers (via denonavr platform (untested))
|
||||
- Marantz M-RC610 (via denonavr platform)
|
||||
- Marantz receivers (experimental via denonavr platform)
|
||||
|
||||
<pre class='note'>
|
||||
If you have something else using the IP controller for your Denon AVR 3808CI, such as your URC controller, it will not work! There is either a bug or security issue with some models where only one device could be controlling the IP functionality.
|
||||
</pre>
|
||||
|
||||
To add a Denon Network Receiver to your installation, add the following to your `configuration.yaml` file:
|
||||
|
||||
|
@ -27,6 +27,7 @@ Configuration variables:
|
||||
|
||||
- **host** (*Required*): The host FQDN (or IP) to retrieve certificate from.
|
||||
- **port** (*Optional*): The port number where the server is running. Defaults to `443`.
|
||||
- **name** (*Optional*): The friendly name for the certificate.
|
||||
|
||||
<p class='note warning'>
|
||||
Make sure that the URL exactly matches your endpoint or resource.
|
||||
|
@ -14,7 +14,7 @@ ha_release: 0.45
|
||||
---
|
||||
|
||||
|
||||
The `file` sensor platform reading the entries from a plain-text file and shows the found value. Only the last line of the file is used. This is similar to do `$ tail -n 1 sensor.txt` on the command-line.
|
||||
The `file` sensor platform reads the entries from a plain-text file and shows the found value. Only the last line of the file is used. This is similar to do `$ tail -n 1 sensor.txt` on the command-line.
|
||||
|
||||
To enable the `file` sensor, add the following lines to your `configuration.yaml`:
|
||||
|
||||
|
@ -8,6 +8,7 @@ comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
logo: telegram.png
|
||||
ha_category: Hub
|
||||
ha_release: 0.42
|
||||
---
|
||||
|
||||
@ -258,8 +259,8 @@ Text repeater:
|
||||
- service: telegram_bot.send_message
|
||||
data_template:
|
||||
title: '*Dumb automation*'
|
||||
target: '{{ trigger.event.data.user_id }}'
|
||||
message: 'You said: ``` {{ trigger.event.data.text }} ```'
|
||||
target: {% raw %}'{{ trigger.event.data.user_id }}'{% endraw %}
|
||||
message: 'You said: {% raw %}{{ trigger.event.data.text }}{% endraw %}'
|
||||
disable_notification: true
|
||||
inline_keyboard:
|
||||
- '/edit,/NO'
|
||||
@ -283,16 +284,16 @@ Message editor:
|
||||
show_alert: true
|
||||
- service: telegram_bot.edit_message
|
||||
data_template:
|
||||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||||
chat_id: '{{ trigger.event.data.user_id }}'
|
||||
message_id: {% raw %}'{{ trigger.event.data.message.message_id }}'{% endraw %}
|
||||
chat_id: {% raw %}'{{ trigger.event.data.user_id }}'{% endraw %}
|
||||
title: '*Message edit*'
|
||||
inline_keyboard:
|
||||
- '/edit,/NO'
|
||||
- '/remove button'
|
||||
message: >
|
||||
Callback received from {{ trigger.event.data.from_first }}.
|
||||
Message id: {{ trigger.event.data.message.message_id }}.
|
||||
Data: ``` {{ trigger.event.data.data }} ```
|
||||
{% raw %}Callback received from {% raw %}{{ trigger.event.data.from_first }}{% endraw %}.
|
||||
Message id: {% raw %}{{ trigger.event.data.message.message_id }}{% endraw %}.
|
||||
Data: {% raw %}{{ trigger.event.data.data }}{% endraw %}
|
||||
```
|
||||
|
||||
Keyboard editor:
|
||||
@ -307,12 +308,12 @@ Keyboard editor:
|
||||
action:
|
||||
- service: telegram_bot.answer_callback_query
|
||||
data_template:
|
||||
callback_query_id: '{{ trigger.event.data.id }}'
|
||||
callback_query_id: {% raw %}'{{ trigger.event.data.id }}'{% endraw %}
|
||||
message: 'Callback received for editing the inline keyboard!'
|
||||
- service: telegram_bot.edit_replymarkup
|
||||
data_template:
|
||||
message_id: 'last'
|
||||
chat_id: '{{ trigger.event.data.user_id }}'
|
||||
chat_id: {% raw %}'{{ trigger.event.data.user_id }}'{% endraw %}
|
||||
inline_keyboard:
|
||||
- '/edit,/NO'
|
||||
```
|
||||
@ -329,7 +330,7 @@ Only acknowledges the 'NO' answer:
|
||||
action:
|
||||
- service: telegram_bot.answer_callback_query
|
||||
data_template:
|
||||
callback_query_id: '{{ trigger.event.data.id }}'
|
||||
callback_query_id: {% raw %}'{{ trigger.event.data.id }}'{% endraw %}
|
||||
message: 'OK, you said no!'
|
||||
```
|
||||
|
||||
@ -406,4 +407,4 @@ class TelegramBotEventListener(appapi.AppDaemon):
|
||||
self.call_service('telegram_bot/answer_callback_query',
|
||||
message='OK, you said no!',
|
||||
callback_query_id=callback_id)
|
||||
```
|
||||
```
|
||||
|
@ -21,7 +21,7 @@ automation:
|
||||
platform: sun
|
||||
event: sunset
|
||||
action:
|
||||
service: homeassistant.turn_on
|
||||
service: light.turn_on
|
||||
entity_id:
|
||||
- light.kitchen
|
||||
- light.living_room
|
||||
|
@ -21,7 +21,7 @@ Choose a meaningful name for your automation rules.
|
||||
<img src='{{site_root}}/images/docs/automation-editor/new-automation.png' />
|
||||
</p>
|
||||
|
||||
If the value of the is greater than 10 then the automation rule should apply.
|
||||
If the value of the sensor is greater than 10 then the automation rule should apply.
|
||||
|
||||
<p class='img'>
|
||||
<img src='{{site_root}}/images/docs/automation-editor/new-trigger.png' />
|
||||
|
@ -18,8 +18,17 @@ $ sudo apt-get update
|
||||
$ sudo apt-get install python3-dev python3-pip
|
||||
```
|
||||
|
||||
Install Home Assistant.
|
||||
|
||||
Now that you installed python, there are two ways to install Home Assistant:
|
||||
1. It is recommended to install Home Assistant in a virtual environment to avoid using `root`, using the [VirtualEnv instructions](/docs/installation/virtualenv/)
|
||||
2. Alternatively, you can install Home Assistant for the user you created when first booting Armbian:
|
||||
```bash
|
||||
$ sudo pip3 install homeassistant
|
||||
$ hass --open-ui
|
||||
```
|
||||
Running these commands will:
|
||||
|
||||
- Install Home Assistant
|
||||
- Launch Home Assistant and serve the web interface on [http://localhost:8123](http://localhost:8123)
|
||||
- the configuration files will be created in /home/{user}/.homeassistant
|
||||
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
<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/external_storage/ External storage %}</li>
|
||||
<li>{% active_link /hassio/run_local/ Execute local things %}</li>
|
||||
<li>{% active_link /hassio/architecture/ Architecture %}</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
@ -14,6 +14,6 @@ In just 12 hours PyCon US 2017 starts. This is an exciting conference because th
|
||||
|
||||
Just like last year, we'll be hosting a [Home Assistant Open Space](https://us.pycon.org/2017/events/open-spaces/). Please stop by to ask any questions you have to the available developers. ~~We haven't reserved a slot yet but will do so tomorrow. We'll update this post and announce it on social media as we know time and location.~~ **First open-space will be Friday at 4pm in room B112.**
|
||||
|
||||
We will also be taken part in the [development sprints](https://us.pycon.org/2017/community/sprints/) from Monday-Wednesday. You only need to bring a laptop. We'll help you get set up with a dev environment and you can be coding on top of Home Assistant in no time. Exact location inside the conference center to be announced.
|
||||
We will also be taken part in the [development sprints](https://us.pycon.org/2017/community/sprints/) from Monday-Wednesday. You only need to bring a laptop. We'll help you get set up with a dev environment and you can be coding on top of Home Assistant in no time. ~~Exact location inside the conference center to be announced.~~ **We are sitting in room A108.**
|
||||
|
||||
On a final note, the Home Assistant community is very very active so don't take it personal if we don't remember your name, issue or contribution.
|
||||
|
@ -70,18 +70,25 @@ If you are using our [experimental Hass.io image][hass.io], we made a breaking c
|
||||
- Seven segments OCR image processing ([@fabaff] - [#7632]) ([image_processing.seven_segments docs]) (new-platform)
|
||||
- Axis component ([@Kane610] - [#7381]) ([axis docs]) (new-platform)
|
||||
|
||||
## {% linkable_title Release 0.45.1 - May 22 %}
|
||||
|
||||
- Fix telegram chats ([@azogue] - [#7689]) ([notify.telegram docs]) ([telegram_bot.__init__ docs])
|
||||
- Fix playback control of web streams ([@cgtobi] - [#7683]) ([media_player.volumio docs])
|
||||
- device_tracker.ubus: Handle empty results ([@tobygray] - [#7673]) ([device_tracker.ubus docs])
|
||||
- Allow fetching hass.io panel without auth ([@balloob] - [#7714]) ([hassio docs])
|
||||
|
||||
## {% linkable_title If you need help... %}
|
||||
...don't hesitate to use our very active [forums][forum] or join us for a little [chat][gitter]. The release notes have comments enabled but it's preferred if you use the former communication channels. Thanks.
|
||||
|
||||
## {% linkable_title Reporting Issues %}
|
||||
Experiencing issues introduced by this release? Please report them in our [issue tracker][issue]. Make sure to fill in all fields of the issue template.
|
||||
|
||||
<!--more-->
|
||||
## {% linkable_title Breaking changes %}
|
||||
|
||||
- PyPI Openzwave ([@JshWright] - [#7415]) ([zwave docs]) (breaking change)
|
||||
- Remove listening to `homeassistant_start` with event automation ([@balloob] - [#7474]) ([automation.event docs]) (breaking change)
|
||||
|
||||
<!--more-->
|
||||
## {% linkable_title All changes %}
|
||||
|
||||
- Add hass to rfxtrx object ([@danielhiversen] - [#6844])
|
||||
@ -331,8 +338,8 @@ Experiencing issues introduced by this release? Please report them in our [issue
|
||||
[alexa docs]: https://home-assistant.io/components/alexa/
|
||||
[axis docs]: https://home-assistant.io/components/axis/
|
||||
[config.automation docs]: https://home-assistant.io/docs/automation/editor/
|
||||
[automation.event docs]: https://home-assistant.io/components/automation.event/
|
||||
[automation.state docs]: https://home-assistant.io/components/automation.state/
|
||||
[automation.event docs]: https://home-assistant.io/docs/configuration/events/
|
||||
[automation.state docs]: https://home-assistant.io/docs/configuration/state_object/
|
||||
[binary_sensor.mystrom docs]: https://home-assistant.io/components/binary_sensor.mystrom/
|
||||
[binary_sensor.raspihats docs]: https://home-assistant.io/components/binary_sensor.raspihats/
|
||||
[binary_sensor.rpi_pfio docs]: https://home-assistant.io/components/binary_sensor.rpi_pfio/
|
||||
@ -342,7 +349,6 @@ Experiencing issues introduced by this release? Please report them in our [issue
|
||||
[camera.zoneminder docs]: https://home-assistant.io/components/camera.zoneminder/
|
||||
[climate.sensibo docs]: https://home-assistant.io/components/climate.sensibo/
|
||||
[config.__init__ docs]: https://home-assistant.io/components/config.__init__/
|
||||
[config.automation docs]: https://home-assistant.io/components/config.automation/
|
||||
[configurator docs]: https://home-assistant.io/components/configurator/
|
||||
[cover.lutron_caseta docs]: https://home-assistant.io/components/cover.lutron_caseta/
|
||||
[datadog docs]: https://home-assistant.io/components/datadog/
|
||||
@ -419,3 +425,13 @@ Experiencing issues introduced by this release? Please report them in our [issue
|
||||
[forum]: https://community.home-assistant.io/
|
||||
[gitter]: https://gitter.im/home-assistant/home-assistant
|
||||
[issue]: https://github.com/home-assistant/home-assistant/issues
|
||||
[#7673]: https://github.com/home-assistant/home-assistant/pull/7673
|
||||
[#7683]: https://github.com/home-assistant/home-assistant/pull/7683
|
||||
[#7689]: https://github.com/home-assistant/home-assistant/pull/7689
|
||||
[#7714]: https://github.com/home-assistant/home-assistant/pull/7714
|
||||
[@cgtobi]: https://github.com/cgtobi
|
||||
[@tobygray]: https://github.com/tobygray
|
||||
[device_tracker.ubus docs]: https://home-assistant.io/components/device_tracker.ubus/
|
||||
[hassio docs]: https://home-assistant.io/components/hassio/
|
||||
[media_player.volumio docs]: https://home-assistant.io/components/media_player.volumio/
|
||||
[telegram_bot.__init__ docs]: https://home-assistant.io/components/telegram_bot.__init__/
|
||||
|
@ -11,27 +11,15 @@ footer: true
|
||||
|
||||
You'll need to set up a development environment if you want to develop a new feature or component for Home Assistant. Read on to learn how to set up.
|
||||
|
||||
### {% linkable_title Setup Local Repository %}
|
||||
### {% linkable_title Preparing your environment %}
|
||||
|
||||
Visit the [Home Assistant repository](https://github.com/home-assistant/home-assistant) and click **Fork**.
|
||||
Once forked, setup your local copy of the source using the commands:
|
||||
```bash
|
||||
$ git clone https://github.com/YOUR_GIT_USERNAME/home-assistant.git
|
||||
$ cd home-assistant
|
||||
$ git remote add upstream https://github.com/home-assistant/home-assistant.git
|
||||
```
|
||||
|
||||
### {% linkable_title Prepare Your Environment %}
|
||||
|
||||
#### {% linkable_title Core dependencies %}
|
||||
#### {% linkable_title Developing on Linux %}
|
||||
|
||||
Install the core dependencies.
|
||||
```bash
|
||||
$ sudo apt-get install python3-pip python3-dev
|
||||
$ sudo apt-get install python3-pip python3-dev python3-venv
|
||||
```
|
||||
|
||||
#### {% linkable_title Platform dependencies %}
|
||||
|
||||
In order to run `script/setup` below you will need some more dependencies.
|
||||
```bash
|
||||
$ sudo apt-get install libssl-dev libxml2-dev libxslt1-dev libjpeg-dev libffi-dev libudev-dev
|
||||
@ -43,7 +31,36 @@ Different distributions have different package installation mechanisms and somet
|
||||
|
||||
Additional dependencies exist if you you plan to perform Frontend Development, please read the [Frontend](https://home-assistant.io/developers/frontend/) section to learn more.
|
||||
|
||||
#### {% linkable_title Setting up virtual environment (optional) %}
|
||||
#### {% linkable_title Developing on Windows %}
|
||||
|
||||
If you are using Windows as a development platform, make sure that you have the correct Microsoft Visual C++ build tools installed. Check the [Windows Compilers](https://wiki.python.org/moin/WindowsCompilers) section on the [Python website](https://www.python.org/) for details. Validation using `tox` will fail if this is not done correctly.
|
||||
|
||||
Also, make sure to install or upgrade the `setuptools` Python package. It contains compatibility improvements and adds automatic use of compilers:
|
||||
|
||||
```bash
|
||||
$ pip install --upgrade setuptools
|
||||
```
|
||||
|
||||
#### {% linkable_title Developing on OS X %}
|
||||
|
||||
Install [Homebrew](https://brew.sh/), then use that to install Python 3:
|
||||
|
||||
```bash
|
||||
$ brew install python3
|
||||
```
|
||||
|
||||
### {% linkable_title Setup Local Repository %}
|
||||
|
||||
Visit the [Home Assistant repository](https://github.com/home-assistant/home-assistant) and click **Fork**.
|
||||
Once forked, setup your local copy of the source using the commands:
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/YOUR_GIT_USERNAME/home-assistant.git
|
||||
$ cd home-assistant
|
||||
$ git remote add upstream https://github.com/home-assistant/home-assistant.git
|
||||
```
|
||||
|
||||
### {% linkable_title Setting up virtual environment (optional) %}
|
||||
|
||||
If you plan on providing isolation to your environment using [`venv`](https://docs.python.org/3.4/library/venv.html). Within the `home-assistant` directory, create and activate your virtual environment.
|
||||
|
||||
@ -52,19 +69,13 @@ $ python3 -m venv venv
|
||||
$ source venv/bin/activate
|
||||
```
|
||||
|
||||
Note, Debian does not ship a full Python3 package and so requires you to install `venv` manually `sudo apt-get install python3-venv`.
|
||||
|
||||
### {% linkable_title Setup and Run %}
|
||||
|
||||
* On Mac OS X and Linux:
|
||||
|
||||
```bash
|
||||
$ cd home-assistant
|
||||
$ script/setup
|
||||
```
|
||||
|
||||
* On Windows, you can use `python setup.py develop` instead of the setup script.
|
||||
|
||||
* Run `hass` to invoke your local installation.
|
||||
|
||||
### {% linkable_title Logging %}
|
||||
@ -75,13 +86,3 @@ verbose logging levels).
|
||||
|
||||
You can use the [logger](/components/logger/) component to adjust
|
||||
logging to DEBUG to see even more details about what is going on.
|
||||
|
||||
### {% linkable_title Developing on Windows %}
|
||||
|
||||
If you are using Windows as a development platform, make sure that you have the correct Microsoft Visual C++ build tools installed. Check the [Windows Compilers](https://wiki.python.org/moin/WindowsCompilers) section on the [Python website](https://www.python.org/) for details. Validation using `tox` will fail if this is not done correctly.
|
||||
|
||||
Also, make sure to install or upgrade the `setuptools` Python package. It contains compatibility improvements and adds automatic use of compilers:
|
||||
|
||||
```bash
|
||||
$ pip install --upgrade setuptools
|
||||
```
|
||||
|
@ -17,7 +17,7 @@ Summary of the most relevant points:
|
||||
- Use 4 spaces per indentation level. We don't use tabs.
|
||||
- Comments should be full sentences and end with a period.
|
||||
- [Imports](https://www.python.org/dev/peps/pep-0008/#imports) should be ordered.
|
||||
- Constants and the content of lists and directories should be in alphabetical order.
|
||||
- Constants and the content of lists and dictionaries should be in alphabetical order.
|
||||
- Avoid trailing whitespace but surround binary operators with a single space.
|
||||
- Line separator should be set to `LF`.
|
||||
|
||||
|
@ -22,7 +22,22 @@ Tox uses virtual environments under the hood to create isolated testing environm
|
||||
|
||||
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.
|
||||
|
||||
### {% linkable_title Testing single files %}
|
||||
### {% linkable_title Running single tests using Tox %}
|
||||
|
||||
You can pass arguments via Tox to py.test to be able to run single test suites or test files. Replace `py36` with the Python version that you use.
|
||||
|
||||
```bash
|
||||
# Stop after the first test fails
|
||||
$ tox -e py36 -- tests/test_core.py -x
|
||||
# Run test with specified name
|
||||
$ tox -e py36 -- tests/test_core.py -k test_split_entity_id
|
||||
# Fail a test after it runs for 2 seconds
|
||||
$ tox -e py36 -- tests/test_core.py --timeout 2
|
||||
# Show the 10 slowest tests
|
||||
$ tox -e py36 -- tests/test_core.py --duration=10
|
||||
```
|
||||
|
||||
### {% linkable_title Testing outside of Tox %}
|
||||
|
||||
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:
|
||||
|
||||
@ -45,21 +60,6 @@ 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!
|
||||
|
@ -33,7 +33,7 @@ echo '{ "target": "beer" }' | jq -r ".target"
|
||||
|
||||
## {% linkable_title Add-on Docker file %}
|
||||
|
||||
All add-ons are based on Alpine Linux 3.5. Hass.io will automatically substitute the right base image based on the machine architecture.
|
||||
All add-ons are based on Alpine Linux 3.5. Hass.io will automatically substitute the right base image based on the machine architecture. Add `tzdata` if you need run in correct timezone.
|
||||
|
||||
```
|
||||
FROM %%BASE_IMAGE%%
|
||||
@ -41,7 +41,7 @@ FROM %%BASE_IMAGE%%
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
# Install requirements for add-on
|
||||
RUN apk add --no-cache jq
|
||||
RUN apk add --no-cache tzdata jq
|
||||
|
||||
# Copy data for add-on
|
||||
COPY run.sh /
|
||||
@ -90,6 +90,7 @@ The config for an add-on is stored in `config.json`.
|
||||
| startup | yes | `initialize` will start addon on setup of hassio. `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 to expose from the container. Format is `"container-port/type": host-port`.
|
||||
| host_network | no | If that is True, the add-on run on host network.
|
||||
| devices | no | Device list to map into add-on. Format is: `<path_on_host>:<path_in_container>:<cgroup_permissions>`
|
||||
| map | no | List of maps for additional hass.io folders. Possible values: `config`, `ssl`, `addons`, `backup`, `share`. Default it map it `ro`, you can change that if you add a ":rw" at the end of name.
|
||||
| environment | no | A dict of environment variable to run add-on.
|
||||
|
@ -17,7 +17,7 @@ Hass.io images are available for all available Raspberry Pi and intel nuc platfo
|
||||
- [Raspberry Pi 3][pi3]
|
||||
- [Intel Nuc][nuc]
|
||||
- Flash the downloaded image to an SD card using [Etcher].
|
||||
- Optional - Setup the WiFi: On the SD-card, edit the `system-connections/resin-sample` file and change `ssid` and `psk`.
|
||||
- Optional - Setup the WiFi or static ip: On the SD-card, edit the `system-connections/resin-sample` file and follow the [ResinOS howto][resinos-network].
|
||||
- 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:8123][local].
|
||||
|
||||
@ -30,6 +30,7 @@ If you copy over your existing Home Assistant configuration, make sure to enable
|
||||
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].
|
||||
|
||||
[Etcher]: https://etcher.io/
|
||||
[resinos-network]: https://docs.resin.io/deployment/network/2.0.0/
|
||||
[pi1]: https://github.com/home-assistant/hassio-build/releases/download/0.8/resinos-hassio-0.8-raspberrypi.img.bz2
|
||||
[pi2]: https://github.com/home-assistant/hassio-build/releases/download/0.8/resinos-hassio-0.8-raspberrypi2.img.bz2
|
||||
[pi3]: https://github.com/home-assistant/hassio-build/releases/download/0.8/resinos-hassio-0.8-raspberrypi3.img.bz2
|
||||
|
97
source/hassio/run_local.markdown
Normal file
97
source/hassio/run_local.markdown
Normal file
@ -0,0 +1,97 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Run local script"
|
||||
description: "Instructions on how-to run local script for Home Assistant."
|
||||
date: 2017-04-30 13:28
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
On a normal Home Assistant installation you have access to the base machine and can install or add scripts that you can call with a `command_line` sensor/switch. Since Hass.IO uses Docker, you can not use this old way to perform local stuff. On its face, it looks quite restrictive, but it makes the whole system stable.
|
||||
|
||||
However, if you need to run a script to read data for a sensor or send commands to other devices on Hass.IO, you can do that with a add-on or on inside the Home Assistant container with a custom component. Here is one way to accomplish that using an add-on. For custom component, look at the [devoloper site][custom-component] and also read the [add-ons tutorial][addons-tutorial]. Now you can get started with your custom component in the right way.
|
||||
|
||||
First you need install a MQTT broker. You can use our [MQTT broker add-on][mqtt-addon]. Make sure you use logins and disable anonymous access if you want to secure the system. We provide no Hass.IO way to exchange data, that will be not realy good for security and is also to slow to exchange data between containers or stop and go stuff. That is the reason why we use a mqtt broker for it.
|
||||
|
||||
### {% linkable_title Sensors %}
|
||||
|
||||
Short story of that caption: We loop in our script to fetch data and push it to MQTT and wait until next process is ready. Here is a basic example and structure for that process.
|
||||
|
||||
Our Dockerfile need to install:
|
||||
|
||||
```
|
||||
RUN apk --no-cache add tzdata jq mosquitto-clients
|
||||
```
|
||||
|
||||
Now we can process it with `run.sh`:
|
||||
```bash
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
CONFIG_PATH=/data/options.json
|
||||
|
||||
# possible options for processing
|
||||
MQTT_SERVER=$(jq --raw-output '.server' $CONFIG_PATH)
|
||||
MQTT_PORT=$(jq --raw-output '.port' $CONFIG_PATH)
|
||||
TOPIC=$(jq --raw-output '.topic' $CONFIG_PATH)
|
||||
USER=$(jq --raw-output '.user' $CONFIG_PATH)
|
||||
PASSWORD=$(jq --raw-output '.password' $CONFIG_PATH)
|
||||
WAIT_TIME=$(jq --raw-output '.seconds' $CONFIG_PATH)
|
||||
|
||||
# read data
|
||||
while true
|
||||
do
|
||||
if OUTPUT="$(/read_my_sensor.sh)"
|
||||
then
|
||||
mosquitto_pub -h "$MQTT_SERVER" -p "$MQTT_PORT" -u "$USER" -P "$PASSWORD" -t "$TOPIC" -m "$OUTPUT" || true
|
||||
else
|
||||
echo "$(data) [ERROR] can't read sensor: $OUTPUT"
|
||||
fi
|
||||
|
||||
sleep "$WAIT_TIME"
|
||||
done
|
||||
|
||||
```
|
||||
|
||||
### {% linkable_title Commands %}
|
||||
Short story of that caption: We wait for incoming data from MQTT broker. We can also use an `input_boolean` that triggers an automation to publish a custom command to MQTT topic that can process multiple things in one add-on.
|
||||
|
||||
Our Dockerfile need to install:
|
||||
|
||||
```
|
||||
RUN apk --no-cache add tzdata jq mosquitto-clients
|
||||
```
|
||||
|
||||
Now we can process it with `run.sh`:
|
||||
```bash
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
CONFIG_PATH=/data/options.json
|
||||
|
||||
# possible options for processing
|
||||
MQTT_SERVER=$(jq --raw-output '.server' $CONFIG_PATH)
|
||||
MQTT_PORT=$(jq --raw-output '.port' $CONFIG_PATH)
|
||||
TOPIC=$(jq --raw-output '.topic' $CONFIG_PATH)
|
||||
USER=$(jq --raw-output '.user' $CONFIG_PATH)
|
||||
PASSWORD=$(jq --raw-output '.password' $CONFIG_PATH)
|
||||
|
||||
# read data
|
||||
while read -r message
|
||||
do
|
||||
if [ "$message" == "on" ]; then
|
||||
/do_command_on.sh || true
|
||||
else
|
||||
/do_command_off.sh || true
|
||||
fi
|
||||
|
||||
done < <(mosquitto_sub -h "$MQTT_SERVER" -p "$MQTT_PORT" -u "$USER" -P "$PASSWORD" -t "$TOPIC" -q 1)
|
||||
|
||||
```
|
||||
|
||||
|
||||
[MQTT-addon]: /addons/mosquitto/
|
||||
[custom-component]: /developers/component_loading/
|
||||
[addons-tutorial]: /hassio/addon_tutorial/
|
Loading…
x
Reference in New Issue
Block a user