Skip to content

Commit

Permalink
Merge pull request #8 from liaan/master
Browse files Browse the repository at this point in the history
Updating from upstream
  • Loading branch information
wjbeckett authored Jun 4, 2020
2 parents c569531 + a861ffb commit 61ca056
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 2,603 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7,3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
69 changes: 64 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Broadlink Air Conditioners to mqtt .... very much still in dev
# Broadlink Air Conditioners to mqtt .... very much still in dev(getting better)
Dunham bush aircons and might work Rinnai. Broadlink devtype == 0x4E2a (20010)

uses Pahoo MQTT so run :
Expand All @@ -11,17 +11,32 @@ pip install paho-mqtt
3. run ./monitor.py

If you lazy and just want to copy and paste your devices, use the -S option and discovered devicesconfig will be printed to screen for copy/paste
Example:
```
root@berry1:~/ac_db# ./monitor.py -S
*********** start copy below ************
devices:
- ip: 10.0.0.227
mac: b4430da741af
name: Office
port: 80
*********** stop copy above ************
```


command line arguments:

```
optional arguments: This should overide the config file (not tested )
optional arguments:
-h, --help show this help message and exit
-d, --debug set logging level to debug
-s, --discover Discover devices
-S, --discoverdump Discover devices and dump config
-Hd, --dumphaconfig Dump the devices as a HA manual config entry
-b, --background Run in background
-ms MQTTSERVER, --mqttserver MQTTSERVER
Mqtt Server, Default:
Expand All @@ -31,6 +46,9 @@ optional arguments: This should overide the config file (not tested )
Mqtt User
-mP MQTTPASSWORD, --mqttpassword MQTTPASSWORD
Mqtt Password
-Ma MQTT_AUTO_DISCOVERY_TOPIC, --mqtt_auto_discovery_topic MQTT_AUTO_DISCOVERY_TOPIC
If specified, will Send the MQTT autodiscovery config
for all devices to topic
Expand All @@ -48,11 +66,13 @@ to set values just publish to /aircon/mac_address/option/value/set new_value :
/aircon/b4430dce73f1/temp/set 20
```

*** Now MQTT autodiscovery workes for HomeAsssitant (https://www.home-assistant.io/docs/mqtt/discovery/)
# Home Assistant (www.home-assistant.io) Options

### Now MQTT autodiscovery workes for HomeAsssitant (https://www.home-assistant.io/docs/mqtt/discovery/)

Enable MQTT autodisocvery:
#### Enabling MQTT autodisocvery:

Edit config.yml and add below if not there. If already there, then make sure prefix matches configuration.yml file settings (in HA)
1. Edit config.yml and add below if not there. If already there, then make sure prefix matches configuration.yml file settings (in HA)

```
mqtt:
Expand All @@ -61,3 +81,42 @@ mqtt:
```


**To add a device manually useing the configuration.yml in HA you can create a easy config to copy/paste by using -Hd (--dumphaconfig) . Just make sure your config.yml is updated with correct settings before running.**

This is also nice to verify the autoconfig is correct that gets sent to HA using mqtt autoconfig

Example:

```
root@berry1:~/ac_db# ./monitor.py -Hd
*********** start copy below ****************
climate:
- action_topic: /aircon/b4430dce73f1/homeassistant/set
current_temperature_topic: /aircon/b4430dce73f1/ambient_temp/value
fan_mode_command_topic: /aircon/b4430dce73f1/fanspeed_homeassistant/set
fan_mode_state_topic: /aircon/b4430dce73f1/fanspeed_homeassistant/value
fan_modes:
- Auto
- Low
- Medium
- High
max_temp: 32.0
min_temp: 16.0
mode_command_topic: /aircon/b4430dce73f1/mode_homeassistant/set
mode_state_topic: /aircon/b4430dce73f1/mode_homeassistant/value
modes:
- 'off'
- cool
- heat
- fan_only
- dry
name: Living Room
platform: mqtt
precision: 0.5
temperature_command_topic: /aircon/b4430dce73f1/temp/set
temperature_state_topic: /aircon/b4430dce73f1/temp/value
```
7 changes: 0 additions & 7 deletions ext/_old_paho-mqtt-client/README.md

This file was deleted.

1 change: 0 additions & 1 deletion ext/_old_paho-mqtt-client/__init__.py

This file was deleted.

Loading

0 comments on commit 61ca056

Please sign in to comment.