Skip to content

Commit

Permalink
Merge branch 'release/0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Mar 1, 2020
2 parents b74e43c + 6e59eb4 commit 28668f1
Show file tree
Hide file tree
Showing 9 changed files with 635 additions and 392 deletions.
2 changes: 2 additions & 0 deletions .flake8.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[flake8]
exclude = .git,.tox,__pycache__
max-line-length = 100
select = C,E,F,W,B,B950
ignore = E501,W503,E203
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
language_version: python3
58 changes: 54 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Xiaomi Mi and Aqara Air Conditioning Companion

This is a custom component for home assistant to integrate the Xiaomi Mi and Aqara Air Conditioning Companion (KTBL01LM, KTBL02LM).
This is a custom component for home assistant to integrate the Xiaomi Mi and Aqara Air Conditioning Companion:

Please follow the instructions on [Retrieving the Access Token](https://home-assistant.io/components/xiaomi/#retrieving-the-access-token) to get the API token to use in the configuration.yaml file.
| Model ID | Model number | Product name | Shape |
|-------------------|--------------|-----------------------------------------|----------|
| `acpartner.v1` | KTBL01LM | Aqara Air Conditioning Companion | square |
| `acaprtner.v2` | KTBL02LM | Xiaomi Mi Air Conditioner Companion | round |
| `acpartner.v3` | KTBL11LM | Aqara Air Conditioning Companion | square |

Please follow the instructions on [Retrieving the Access Token](https://www.home-assistant.io/components/vacuum.xiaomi_miio/#retrieving-the-access-token) to get the API token to use in the configuration.yaml file.

Credits: Thanks to [Rytilahti](https://github.com/rytilahti/python-miio) for all the work.

Expand All @@ -12,6 +18,7 @@ Credits: Thanks to [Rytilahti](https://github.com/rytilahti/python-miio) for all
* Fan Speed (Low, Medium, High, Auto)
* Swing Mode (On, Off)
* Target Temperature
* Capture and replay infrared commands
* Attributes
- ac_model
- ac_power (on, off)
Expand All @@ -20,16 +27,59 @@ Credits: Thanks to [Rytilahti](https://github.com/rytilahti/python-miio) for all
- fan_speed
- swing_mode


## Install

You can install this custom component by adding this repository ([https://github.com/syssi/xiaomi_airconditioningcompanion](https://github.com/syssi/xiaomi_airconditioningcompanion/)) to [HACS](https://hacs.xyz/) in the settings menu of HACS first. You will find the custom component in the integration menu afterwards, look for 'Xiaomi Mi and Aqara Air Conditioning Companion Integration'. Alternatively, you can install it manually by copying the custom_component folder to your Home Assistant configuration folder.


## Setup

```yaml
# configuration.yaml

climate
- platform: xiaomi_miio
climate:
- platform: xiaomi_miio_airconditioningcompanion
name: Aqara Air Conditioning Companion
host: 192.168.130.71
token: b7c4a758c251955d2c24b1d9e41ce47d
target_sensor: sensor.temperature_158d0001f53706
scan_interval: 60
```
![climate entity](climate.png "climate entity")
## Debugging
If the custom component doesn't work out of the box for your device please update your configuration to enable a higher log level:
```yaml
# configuration.yaml

logger:
default: warn
logs:
custom_components.xiaomi_miio_airconditioningcompanion.climate: debug
miio: debug
```
## Platform services
#### Service `climate.xiaomi_miio_learn_command`

Capture an infrared command.

| Service data attribute | Optional | Description |
|---------------------------|----------|----------------------------------------------------------------------|
| `entity_id` | yes | Only act on a specific air purifier. Else targets all. |
| `slot` | yes | Storage slot. Defaults to slot ID 30. |
| `timeout` | yes | Capturing timeout. Defaults to 10 seconds. |

#### Service `climate.xiaomi_miio_send_command`

Send captured infrared command or device configuration.

| Service data attribute | Optional | Description |
|---------------------------|----------|----------------------------------------------------------------------|
| `entity_id` | yes | Only act on a specific air purifier. Else targets all. |
| `command` | no | Infrared command. Must start with `FE` or `01`. |
Binary file added climate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 28668f1

Please sign in to comment.