diff --git a/.ruby-version b/.ruby-version index 2bf1c1ccf36..005119baaa0 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.1 +2.4.1 diff --git a/.travis.yml b/.travis.yml index 7cc1f19579f..fb4c4add6f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: ruby sudo: false cache: bundler -script: bundle exec rake generate +script: travis_wait bundle exec rake generate after_success: - '[ "${TRAVIS_BRANCH}" = "current" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ] && bundle exec rake deploy || false' diff --git a/Gemfile b/Gemfile index 58b50178659..c30860255d8 100644 --- a/Gemfile +++ b/Gemfile @@ -3,18 +3,9 @@ source "https://rubygems.org" group :development do gem 'rake', '~> 10.0' gem 'jekyll', '~> 3.0' - gem 'pygments.rb', '~> 1.1.2' - gem 'rdiscount', '~> 2.0' - gem 'RedCloth', '~> 4.2' - gem 'haml', '~> 4.0' gem 'compass', '~> 0.12' gem 'sass-globbing', '~> 1.0' - gem 'rubypants', '~> 0.2' - gem 'rb-fsevent', '~> 0.9' gem 'stringex', '~> 1.4' - gem 'execjs' - gem 'therubyracer', :platforms => :ruby - gem 'coderay' gem 'pry' end @@ -24,7 +15,6 @@ group :jekyll_plugins do gem 'jekyll-sitemap' gem 'jekyll-time-to-read' gem 'octopress', '~> 3.0' - gem 'octopress-filters' gem 'octopress-include-tag' end diff --git a/Gemfile.lock b/Gemfile.lock index 11bd6af12e2..d706705eb30 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,51 +1,47 @@ GEM remote: https://rubygems.org/ specs: - RedCloth (4.3.2) - addressable (2.4.0) - chunky_png (1.3.6) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + chunky_png (1.3.8) coderay (1.1.1) colorator (1.1.0) compass (0.12.7) chunky_png (~> 1.2) fssm (>= 0.2.7) sass (~> 3.2.19) - execjs (2.7.0) - ffi (1.9.14) + ffi (1.9.18) forwardable-extended (2.6.0) fssm (0.2.10) - haml (4.0.7) - tilt - jekyll (3.2.1) + jekyll (3.5.2) + addressable (~> 2.4) colorator (~> 1.0) jekyll-sass-converter (~> 1.0) jekyll-watch (~> 1.1) kramdown (~> 1.3) - liquid (~> 3.0) + liquid (~> 4.0) mercenary (~> 0.3.3) pathutil (~> 0.9) rouge (~> 1.7) safe_yaml (~> 1.0) jekyll-paginate (1.1.0) - jekyll-redirect-from (0.11.0) - jekyll (>= 2.0) + jekyll-redirect-from (0.12.1) + jekyll (~> 3.3) jekyll-sass-converter (1.3.0) sass (~> 3.2) - jekyll-sitemap (0.11.0) - addressable (~> 2.4.0) + jekyll-sitemap (1.1.1) + jekyll (~> 3.3) jekyll-time-to-read (0.1.2) jekyll jekyll-watch (1.5.0) listen (~> 3.0, < 3.1) - kramdown (1.12.0) - libv8 (3.16.14.15) - liquid (3.0.6) + kramdown (1.14.0) + liquid (4.0.0) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) mercenary (0.3.6) method_source (0.8.2) - multi_json (1.12.1) octopress (3.0.11) jekyll (>= 2.0) mercenary (~> 0.3.2) @@ -58,12 +54,7 @@ GEM colorator octopress-escape-code (2.1.1) jekyll (~> 3.0) - octopress-filters (1.4.0) - jekyll - octopress-hooks (~> 2.0) - rubypants-unicode - titlecase - octopress-hooks (2.6.1) + octopress-hooks (2.6.2) jekyll (>= 2.0) octopress-include-tag (1.1.3) jekyll (>= 2.0) @@ -76,64 +67,46 @@ GEM coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - pygments.rb (1.1.2) - multi_json (>= 1.0.0) - rack (1.6.4) + public_suffix (3.0.0) + rack (1.6.8) rack-protection (1.5.3) rack rake (10.5.0) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) - rdiscount (2.2.0.1) - redcarpet (3.3.4) - ref (2.0.0) + rb-fsevent (0.10.2) + rb-inotify (0.9.10) + ffi (>= 0.5.0, < 2) + redcarpet (3.4.0) rouge (1.11.1) - rubypants (0.5.0) - rubypants-unicode (0.2.5) safe_yaml (1.0.4) sass (3.2.19) sass-globbing (1.1.5) sass (>= 3.1) - sinatra (1.4.7) + sinatra (1.4.8) rack (~> 1.5) rack-protection (~> 1.4) tilt (>= 1.3, < 3) slop (3.6.0) stringex (1.5.1) - therubyracer (0.12.2) - libv8 (~> 3.16.14.0) - ref - tilt (2.0.5) + tilt (2.0.8) titlecase (0.1.1) PLATFORMS ruby DEPENDENCIES - RedCloth (~> 4.2) - coderay compass (~> 0.12) - execjs - haml (~> 4.0) jekyll (~> 3.0) jekyll-paginate jekyll-redirect-from jekyll-sitemap jekyll-time-to-read octopress (~> 3.0) - octopress-filters octopress-include-tag pry - pygments.rb (~> 1.1.2) rake (~> 10.0) - rb-fsevent (~> 0.9) - rdiscount (~> 2.0) - rubypants (~> 0.2) sass-globbing (~> 1.0) sinatra (~> 1.4.2) stringex (~> 1.4) - therubyracer BUNDLED WITH - 1.14.6 + 1.15.4 diff --git a/_config.yml b/_config.yml index 77f78049d6b..9f482b4a630 100644 --- a/_config.yml +++ b/_config.yml @@ -35,8 +35,6 @@ category_dir: blog/categories markdown: kramdown timezone: UTC -# highlighter: coderay - kramdown: input: GFM auto_ids: false @@ -48,10 +46,9 @@ kramdown: highlighter: rouge -gems: +plugins: - jekyll-redirect-from - jekyll-time-to-read - - octopress-filters - octopress-include-tag paginate: 10 # Posts per page on the blog index @@ -142,12 +139,12 @@ social: # Home Assistant release details current_major_version: 0 -current_minor_version: 51 -current_patch_version: 2 -date_released: 2017-08-14 +current_minor_version: 52 +current_patch_version: 0 +date_released: 2017-08-26 # 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: "#release-0512--august-14" +patch_version_notes: "#" # Minor release (Example #release-0431---april-25): diff --git a/source/_addons/mariadb.markdown b/source/_addons/mariadb.markdown index 548d4d0c145..6101d25df6a 100644 --- a/source/_addons/mariadb.markdown +++ b/source/_addons/mariadb.markdown @@ -9,7 +9,7 @@ sharing: true footer: true --- -Set up a [mariadb](https://mariadb.org/) SQL server. It support multible database, users and permission. If you want only connect from inside use `172.17.0.1` as host address. +Set up a [mariadb](https://mariadb.org/) SQL server. It support multible database, users and permission. If you want only connect from inside use `core-mariadb` as host address. ```json { @@ -17,14 +17,14 @@ Set up a [mariadb](https://mariadb.org/) SQL server. It support multible databas "logins": [ { "username": "hass", - "host": "172.17.0.1", + "host": "homeassistant", "password": "securePassword" } ], "rights": [ { "username": "hass", - "host": "172.17.0.1", + "host": "homeassistant", "database": "homeassistant", "grant": "ALL PRIVILEGES ON" } @@ -51,5 +51,5 @@ Use the following configuration in Home Assistant to use the database above: ```yaml recorder: - db_url: mysql://hass:securePassword@127.0.0.1/homeassistant + db_url: mysql://hass:securePassword@core-mariadb/homeassistant ``` diff --git a/source/_addons/nginx_proxy.markdown b/source/_addons/nginx_proxy.markdown index fab4ac9842d..7f14e50bee6 100644 --- a/source/_addons/nginx_proxy.markdown +++ b/source/_addons/nginx_proxy.markdown @@ -23,6 +23,5 @@ Configuration variables: - **domain** (*Required*): Domain they will proxy run with it.
-It is possible to deactive port 80 if you need this for things like `emulate_hue`. It exists a the moment no UI function for that, so you need call Hass.io API with SSH addon: -`curl -d '{"network": {"443/tcp": 443}}' http://172.17.0.2/addons/core_nginx_proxy/options` +It is possible to deactive port 80 if you need this for things like `emulate_hue`. Remove the host port from Network option of this add-on.
diff --git a/source/_components/abode.markdown b/source/_components/abode.markdown index 5b1368d4c6d..59b247f7bf7 100644 --- a/source/_components/abode.markdown +++ b/source/_components/abode.markdown @@ -2,7 +2,7 @@ layout: page title: "Abode Home Security" description: "Instructions on integrating Abode home security with Home Assistant." -date: 2017-08-26 13:28 +date: 2017-08-26 0:28 sidebar: true comments: false sharing: true diff --git a/source/_components/alarm_control_panel.abode.markdown b/source/_components/alarm_control_panel.abode.markdown index 4b140acdb06..593735b7d20 100644 --- a/source/_components/alarm_control_panel.abode.markdown +++ b/source/_components/alarm_control_panel.abode.markdown @@ -2,7 +2,7 @@ layout: page title: "Abode Alarm Control Panel" description: "Instructions how to setup the Abode Alarm control panel within Home Assistant." -date: 2017-08-26 13:28 +date: 2017-08-26 0:28 sidebar: true comments: false sharing: true diff --git a/source/_components/binary_sensor.abode.markdown b/source/_components/binary_sensor.abode.markdown index d0ee36ad392..35dfeda1713 100644 --- a/source/_components/binary_sensor.abode.markdown +++ b/source/_components/binary_sensor.abode.markdown @@ -2,7 +2,7 @@ layout: page title: "Abode Binary Sensor" description: "Instructions how to integrate Abode binary sensors into Home Assistant." -date: 2017-08-26 13:28 +date: 2017-08-26 0:28 sidebar: true comments: false sharing: true diff --git a/source/_components/discovery.markdown b/source/_components/discovery.markdown index 43152eb5f98..41c7e2392d1 100644 --- a/source/_components/discovery.markdown +++ b/source/_components/discovery.markdown @@ -12,7 +12,7 @@ ha_category: Other --- -Home Assistant can discover and automatically configure zeroconf/mDNS and uPnP devices on your network. Currently the `discovery` component can detect: +Home Assistant can discover and automatically configure [zeroconf](https://en.wikipedia.org/wiki/Zero-configuration_networking)/[mDNS](https://en.wikipedia.org/wiki/Multicast_DNS) and [uPnP](https://en.wikipedia.org/wiki/Universal_Plug_and_Play) devices on your network. Currently the `discovery` component can detect: * Google Chromecast * Belkin WeMo switches @@ -54,7 +54,7 @@ Configuration variables: Valid values for ignore are: * `apple_tv`: Apple TV - * `axis`: (Axis Communications security devices) + * `axis`: Axis Communications security devices * `bose_soundtouch`: Bose Soundtouch speakers * `denonavr`: Denon Network Receivers * `directv`: DirecTV @@ -62,31 +62,31 @@ Valid values for ignore are: * `google_cast`: Google Chromecast * `ikea_tradfri`: IKEA Trådfri * `logitech_mediaserver`: Logitech media server - Squeezebox player - * `openhome`: Linn / Openhome + * `openhome`: Linn/Openhome * `panasonic_viera`: Panasonic Viera * `philips_hue`: Philips Hue * `plex_mediaserver`: Plex media server * `roku`: Roku media player - * `samsung_tv`: (Samsung TV + * `samsung_tv`: Samsung TV * `sonos`: Sonos Speakers * `yamaha`: Yamaha media player * `yeelight`: Yeelight Sunflower BulbHome Assistant must be on the same network as the devices for uPnP discovery to work. -If running Home Assistant in a Docker container use switch `--net=host` to put it on the host's network. +If running Home Assistant in a [Docker container](/docs/installation/docker/) use switch `--net=host` to put it on the host's network.
-If you are developing a new platform, please read [how to make your platform discoverable]({{site_root}}/developers/add_new_platform/#discovery). --There is currently a known issue with running this platform on a 64-bit version of Python and Windows. +There is currently a known issue with running this component on a 64-bit version of Python and Windows.
-If you are on Windows and you're using Python 3.5, download the Netifaces dependency here. +If you are on Windows and you're using Python 3.5, download the [Netifaces](http://www.lfd.uci.edu/~gohlke/pythonlibs/#netifaces) dependency.
If you see `Not initializing discovery because could not install dependency netdisco==0.6.1` in the logs, you will need to install the `python3-dev` or `python3-devel` package on your system manually (eg. `sudo apt-get install python3-dev` or `sudo dnf -y install python3-devel`). On the next restart of home-assistant, discovery should work. If you still get an error, check if you have a compiler (`gcc`) available on your system.
+ +If you are developing a new platform, please read [how to make your platform discoverable](/developers/component_discovery/) for further details. diff --git a/source/_components/mysensors.markdown b/source/_components/mysensors.markdown index e7e3ac4c8c4..8a7f70aab76 100644 --- a/source/_components/mysensors.markdown +++ b/source/_components/mysensors.markdown @@ -39,7 +39,7 @@ mysensors: optimistic: false persistence: true retain: true - version: 2.0 + version: '2.0' ``` Configuration variables: @@ -172,7 +172,23 @@ void receive(const MyMessage &message) { ### {% linkable_title Heartbeats %} -Sending a heartbeat from the MySensors device to Home Assistant activates the SmartSleep functionality in Home Assistant. This means that messages are buffered and only sent to the device upon receiving a heartbeat from the device. State changes are stored so that only the last requested state change is sent to the device. Other types of messages are queued in a FIFO queue. SmartSleep is useful for battery powered actuators that are waiting for commands. See the MySensors library API for information on how to send heartbeats and sleep device. +Sending a heartbeat from the MySensors device to Home Assistant activates the SmartSleep functionality in Home Assistant. This means that messages are buffered and only sent to the device upon receiving a heartbeat from the device. State changes are stored so that only the last requested state change is sent to the device. Other types of messages are queued in a FIFO queue. SmartSleep is useful for battery powered actuators that are waiting for commands. See the MySensors library API for information on how to send heartbeats and sleep device. + +### {% linkable_title Message validation %} + +Messages sent to or from Home Assistant from or to a MySensors device will be validated according to the MySensors [serial API](https://www.mysensors.org/download/serial_api_20). If a message doesn't pass validation, it will be dropped and not be passed forward either to or from home assistant. Make sure you follow the serial API for your version of MySensors when writing your Arduino sketch. + +If you experience dropped messages or that a device is not added to Home Assistant, please turn on debug logging for the `mysensors` component and the `mysensors` package. +```yaml +logger: + default: info + logs: + homeassistant.components.mysensors: debug + mysensors: debug +``` +The log should inform you of messages that failed validation or if a child value is missing that is required for a certain child type. Note that the log will log all possible combinations of platforms for a child type that failed validation. It is normal to see some platforms fail validation if the child type supports multiple platforms and your sketch doesn't send all corresponding value types. Eg. the S_BARO child type supports both V_PRESSURE and V_FORECAST value types. If you only send a V_PRESSURE value, an S_BARO entity with V_PRESSURE value will be set up for the sensor platform. But the log will inform of a sensor platform that failed validation due to missing V_FORECAST value type for the S_BARO child. Home Assistant will log failed validations of child values at warning level if one required value type for a platform has been received, but other required value types are missing. Most failed validations are logged at debug level. + +Message validation was introduced in version 0.52 of Home Assistant. Visit the [library api][MySensors library api] of MySensors for more information. diff --git a/source/_components/sensor.londond_air.markdown b/source/_components/sensor.london_air.markdown similarity index 100% rename from source/_components/sensor.londond_air.markdown rename to source/_components/sensor.london_air.markdown diff --git a/source/_components/vacuum.xiaomi.markdown b/source/_components/vacuum.xiaomi.markdown index bb3f17954d3..fb9fede1cfa 100644 --- a/source/_components/vacuum.xiaomi.markdown +++ b/source/_components/vacuum.xiaomi.markdown @@ -10,81 +10,30 @@ footer: true logo: xiaomi.png ha_category: Vacuum ha_release: 0.51 +ha_iot_class: "Local Polling" --- The `xiaomi` vacuum platform allows you to control the state of your [Xiaomi Mi Robot Vacuum](http://www.mi.com/roomrobot/). Current supported features are `turn_on`, `pause`, `stop`, `return_to_home`, `turn_off` (stops goes to dock), `locate`, `clean_spot`, `set_fanspeed` and even remote control your robot. -## {% linkable_title Getting started %} +Please follow the instructions on [Retrieving the Access Token](/xiaomi/#retrieving-the-access-token) to get the API token to use in the `configuration.yaml` file. -Follow the pairing process using your phone and Mi-Home app. From here you will be able to retrieve the token from a SQLite file inside your phone. - -Before you begin you need to install `libffi-dev` by running the command below. This is needed for `python-mirobi` to be installed correctly. - -```bash -apt-get install libffi-dev -``` - --If your Home Assistant installation is running in a [Virtualenv](/docs/installation/virtualenv/#upgrading-home-assistant), make sure you activate it by running the commands below.
- -```bash -$ sudo su -s /bin/bash homeassistant -$ source /srv/homeassistant/bin/activate -``` - -To fetch the token follow these instructions depending on your mobile phone platform. - -### Windows and Android -1. Configure the robot with the Mi-Home app. -2. Enable developer mode and USB debugging on the Android phone and plug it into the computer. -3. Get ADB tool for Windows: https://developer.android.com/studio/releases/platform-tools.html -4. Create a backup of the application com.xiaomi.smarthome: -```bash -.\adb backup -noapk com.xiaomi.smarthome -f backup.ab -``` -5. If you have this message: "More than one device or emulator", use this command to list all devices: -```bash -.\adb devices -``` -and execute this command: -```bash -.\adb -s DEVICEID backup -noapk com.xiaomi.smarthome -f backup.ab # (with DEVICEID the device id from the previous command) -``` -6. On the phone, you must confirm the backup. DO NOT enter any password and press button to make the backup. -7. Get ADB Backup Extractor: https://sourceforge.net/projects/adbextractor/ -8. Extract All files from the backup: -```bash -java.exe -jar ../android-backup-extractor/abe.jar unpack backup.ab backup.tar "" -``` -9. Unzip the ".tar" file. -10. Open the SQLite DB miio2.db with a tool like SQLite Manager extension for FireFox. -11. Get the token from "devicerecord" table. - - -### macOS and iOS -1. Setup iOS device with the Mi-Home app. -2. Create an unencrypted backup of the device using iTunes. -3. Install iBackup Viewer from here: http://www.imactools.com/iphonebackupviewer/ -4. Extract this file: **`/raw data/com.xiami.mihome/1234567_mihome.sqlite`** to your computer, where _1234567_ is any string of numbers. -5. Open the sqlite DB with a tool like SQLite Manager extension for FireFox, DB Browser, etc. You will then see the list of all the devices in your account with their token. The token you need is in the column **`ZToken`** and looks like **`123a1234567b12345c1d123456789e12`**. - -## {% linkable_title Configuration %} +To add a vacuum to your installation, add the following to your `configuration.yaml` file: ```yaml # Example configuration.yaml entry vacuum: -- platform: xiaomi - name: 'name of the robot' - host: 192.168.1.2 - token: your-token-here + - platform: xiaomi + host: 192.168.1.2 + token: YOUR_TOKEN ``` Configuration variables: -- **name** (*Optional*): The name of your robot -- **host** (*Required*): The IP of your robot -- **token** (*Required*): The token of your robot. Go to Getting started section to read more about how to get it + +- **host** (*Required*): The IP of your robot. +- **token** (*Required*): The API token of your robot. +- **name** (*Optional*): The name of your robot. ### {% linkable_title Platform services %} diff --git a/source/_components/xiaomi.markdown b/source/_components/xiaomi.markdown index 10761039c6c..c97003cd7bc 100644 --- a/source/_components/xiaomi.markdown +++ b/source/_components/xiaomi.markdown @@ -34,7 +34,6 @@ The `xiaomi` platform allows you to integrate the following [Xiaomi](http://www. - Intelligent Curtain - Battery - What's not available? - Gateway Radio @@ -45,12 +44,13 @@ What's not available? - Decoupled mode of the Aqara Wall Switches (Single & Double) - Additional alarm events of the Gas and Smoke Detector: Analog alarm, battery fault alarm (smoke detector only), sensitivity fault alarm, I2C communication failure +Follow the setup process using your phone and Mi-Home app. From here you will be able to retrieve the key from within the app following [this tutorial](https://community.home-assistant.io/t/beta-xiaomi-gateway-integration/8213/1832) -Follow the setup process using your phone and Mi Home app. From here you will be able to retrieve the key from within the app following [this tutorial](https://community.home-assistant.io/t/beta-xiaomi-gateway-integration/8213/1832) +Please check the instructions in this [section](/xiaomi/#retrieving-the-access-token) to get the API token to use with your platforms. -To enable Xioami gateway in your installation, add the following to your `configuration.yaml` file: +To enable Xiaomi gateway in your installation, add the following to your `configuration.yaml` file: -One Gateway +### {% linkable_title One Gateway %} ```yaml # You can leave mac empty if you only have one gateway. @@ -60,8 +60,7 @@ xiaomi: key: xxxxxxxxxxxxxxxx ``` - -Multiple Gateways +### {% linkable_title Multiple Gateways %} ```yaml # 12 characters mac can be obtained from the gateway. @@ -73,12 +72,10 @@ xiaomi: key: xxxxxxxxxxxxxxxx ``` - - -Search for gateways on specific interface +### {% linkable_title Search for gateways on specific interface %} ```yaml -# 12 characters mac can be obtained from the gateway. +# 12 characters MAC can be obtained from the gateway. xiaomi: interface: '192.168.0.1' gateways: @@ -86,11 +83,10 @@ xiaomi: key: xxxxxxxxxxxxxxxx ``` - Configuration variables: - **mac** (*Optional*): The MAC of your gateway. Required if you have more than one. -- **key** (*Optional*): The key of your gateway. Required if you also want to control lights and switches; sensors and binary sensors will still work. +- **key** (*Optional*): The key of your gateway. Required if you also want to control lights and switches. Sensors and binary sensors will still work. - **discovery_retry** (*Optional*): Amount of times Home Assitant should try to reconnect to the Xiaomi Gateway. Default is 3. - **interface** (*Optional*): Which network interface to use. Defaults to any. @@ -101,7 +97,7 @@ The gateway provides two services: `xiaomi.play_ringtone` and `xiaomi.stop_ringt - alarm ringtones [0-8] - doorbell ring [10-13] - alarm clock [20-29] -- custom ringtones (uploaded by mi home app) starting from 10001 +- custom ringtones (uploaded by the Mi Home app) starting from 10001 Automation example @@ -133,19 +129,83 @@ Automation example gw_mac: xxxxxxxxxxxx ``` - -### {% linkable_title Troubleshooting %} +### {% linkable_title Troubleshooting %} **Connection problem** -``` +```bash 2017-08-20 16:51:19 ERROR (SyncWorker_0) [homeassistant.components.xiaomi] No gateway discovered 2017-08-20 16:51:20 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi: Component failed to initialize. ``` That means that Home Assistant is not getting any response from your Xiaomi gateway. Might be a local network problem or your firewall. - Make sure you have enabled LAN access: https://community.home-assistant.io/t/beta-xiaomi-gateway-integration/8213/1832 -- Turn off the firewall on the HA computer -- Try to leave the mac address blank. +- Turn off the firewall on the system where Home Assistant is running +- Try to leave the MAC address `mac:` blank. - Try to set `discovery_retry: 10` - Try to disable and then enable LAN access + +### {% linkable_title Retrieving the Access Token %} + +Follow the pairing process using your phone and Mi-Home app. You will be able to retrieve the token from a SQLite file inside your phone. This token is needed for using various `xiaomi_*` platforms. + +Before you begin you need to install `libffi-dev` by running the command below. This is needed for `python-mirobi` to be installed correctly. + +```bash +$ sudo apt-get install libffi-dev +``` + +If your Home Assistant installation is running in a [Virtualenv](/docs/installation/virtualenv/#upgrading-home-assistant), make sure you activate it by running the commands below. + +```bash +$ sudo su -s /bin/bash homeassistant +$ source /srv/homeassistant/bin/activate +``` + +To fetch the token follow these instructions depending on your mobile phone platform. + +#### {% linkable_title Windows and Android %} + +1. Configure the robot with the Mi-Home app. +2. Enable developer mode and USB debugging on the Android phone and plug it into the computer. +3. Get and install the [ADB tool for Windows](https://developer.android.com/studio/releases/platform-tools.html). +4. Create a backup of the application `com.xiaomi.smarthome`: +```bash +$ adb backup -noapk com.xiaomi.smarthome -f backup.ab +``` +5. If you have this message: "More than one device or emulator", use this command to list all devices: +```bash +$ adb devices +``` +and execute this command: +```bash +$ adb -s DEVICEID backup -noapk com.xiaomi.smarthome -f backup.ab # (with DEVICEID the device id from the previous command) +``` +6. On the phone, you must confirm the backup. DO NOT enter any password and press button to make the backup. +7. Get and install [ADB Backup Extractor](https://sourceforge.net/projects/adbextractor/). +8. Extract All files from the backup: +```bash +$ java.exe -jar ../android-backup-extractor/abe.jar unpack backup.ab backup.tar "" +``` +9. Unzip the ".tar" file. +10. Open the SQLite database `miio2.db` with a tool like SQLite Manager extension for FireFox. +11. Get the token from "devicerecord" table. + +#### {% linkable_title Linux and Android (rooted!) %} + +1. Configure the light with the Mi-Home app. +2. Enable developer mode, USB debugging and root permission only for ADB on the Android phone and plug it into the computer. +3. Get ADB f.e. `apt-get install android-tools-adb` +4. `adb devices` should list your device +5. `adb root` (does work for development builds only: ones with `ro.debuggable=1`) +6. `adb shell` +7. `echo "select name,localIP,token from devicerecord;" | sqlite3 /data/data/com.xiaomi.smarthome/databases/miio2.db` returns a list of all registered devices including IP address and token. + +#### {% linkable_title macOS and iOS %} + +1. Setup iOS device with the Mi-Home app. +2. Create an unencrypted backup of the device using iTunes. +3. Install [iBackup Viewer](http://www.imactools.com/iphonebackupviewer/). +4. Extract this file: **`/raw data/com.xiami.mihome/1234567_mihome.sqlite`** to your computer, where `_1234567_` is any string of numbers. +5. Open the SQLite database with a tool like SQLite Manager extension for FireFox or DB Browser. You will then see the list of all the devices in your account with their token. The token you need is in the column **`ZToken`** and looks like **`123a1234567b12345c1d123456789e12`**. + diff --git a/source/_docs/automation/editor.markdown b/source/_docs/automation/editor.markdown index 83b1de0f29e..e8a60039668 100644 --- a/source/_docs/automation/editor.markdown +++ b/source/_docs/automation/editor.markdown @@ -1,7 +1,7 @@ --- layout: page title: "Automation Editor" -description: "Instructions on how to use the new automation editor." +description: "Instructions on how to use the automation editor." date: 2016-04-24 08:30 +0100 sidebar: true comments: false @@ -9,11 +9,9 @@ sharing: true footer: true --- -In Home Assistant 0.45 we have introduced the first version of our automation editor. The editor is still in a very early stage and rough around the edges. For now we are only supporting Chrome but better browser support is planned for the future. +In Home Assistant 0.45 we introduced the first version of our automation editor. If you just created a new configuration with Home Assistant then you're all set! Go to the UI and enjoy. -If you just created a new configuration with Home Assistant then you're all set! Go to the UI and enjoy. - -From the UI choose **Automation** which is located in the sidebar. Press the **+** sign in the lower right corner to get started. This example is based on the manual steps described in the [Getting started section](/getting-started/automation/) for a [`random` sensor](/components/sensor.random/). +From the UI choose **Configuration** which is located in the sidebar, then click on **Automation** to go to the automation editor. Press the **+** sign in the lower right corner to get started. This example is based on the manual steps described in the [Getting started section](/getting-started/automation/) for a [`random` sensor](/components/sensor.random/). Choose a meaningful name for your automation rules. diff --git a/source/_docs/scripts.markdown b/source/_docs/scripts.markdown index e8688e04286..2a6abdd8d5c 100644 --- a/source/_docs/scripts.markdown +++ b/source/_docs/scripts.markdown @@ -77,7 +77,7 @@ delay: {% raw %}'00:{{ states.input_slider.minute_delay.state | int }}:00'{% end ``` ### {% linkable_title Wait %} -Wait until some things are complete. We support at the moment `wait_template` for waiting until a condition is `true`, see also on [Template-Trigger](/getting-started/automation-trigger/#template-trigger). The Timeout has same syntax as `delay`. If you set a Timeout for 1 minute and the condition is not satified within that minute, the script will continue. +Wait until some things are complete. We support at the moment `wait_template` for waiting until a condition is `true`, see also on [Template-Trigger](/docs/automation/trigger/#template-trigger). The Timeout has same syntax as `delay`. If you set a Timeout for 1 minute and the condition is not satified within that minute, the script will continue. ```yaml # wait until media player have stop the playing diff --git a/source/_docs/scripts/editor.markdown b/source/_docs/scripts/editor.markdown new file mode 100644 index 00000000000..e5cc30c2272 --- /dev/null +++ b/source/_docs/scripts/editor.markdown @@ -0,0 +1,28 @@ +--- +layout: page +title: "Script Editor" +description: "Instructions on how to use the new script editor." +date: 2016-08-26 03:30 +0000 +sidebar: true +comments: false +sharing: true +footer: true +redirect_from: /docs/script/editor/ +--- + +In Home Assistant 0.52 we introduced the first version of our automation editor. If you just created a new configuration with Home Assistant then you're all set! Go to the UI and enjoy. + +