Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Hy3n4/ha-cc-cometblue
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.1-alpha
Choose a base ref
...
head repository: Hy3n4/ha-cc-cometblue
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Nov 30, 2018

  1. README changes

    Hy3n4 committed Nov 30, 2018
    Copy the full SHA
    e63fb58 View commit details
  2. README changes

    Hy3n4 committed Nov 30, 2018
    Copy the full SHA
    9831f21 View commit details
  3. Added feature list to README

    Hy3n4 committed Nov 30, 2018
    Copy the full SHA
    aeccec8 View commit details
  4. changed table of features

    Hy3n4 committed Nov 30, 2018
    Copy the full SHA
    57111dd View commit details
  5. another changes in README

    Hy3n4 committed Nov 30, 2018
    Copy the full SHA
    39a60ce View commit details
  6. Added support for setting low and high temperature in auto mode

    Added support for low_battery state (Not tested)
    Partialy fixed issue when bad temperature is retrieved from thermostat when temperatures are read imeediately after setting new values.
    Other minor fixes and code cleanup
    Some other changes in README.md
    Hy3n4 committed Nov 30, 2018
    Copy the full SHA
    967e6db View commit details

Commits on Dec 3, 2018

  1. Another temperature related fixes

    Still not decided how to resolve issue with reading values in one connect after setting new temperatures.
    Hy3n4 committed Dec 3, 2018
    Copy the full SHA
    68fded7 View commit details
  2. Update issue templates

    Hy3n4 committed Dec 3, 2018
    Copy the full SHA
    2a4882e View commit details
  3. Removed redundant cometblue.py

    Hy3n4 committed Dec 3, 2018
    Copy the full SHA
    c4bc439 View commit details
  4. Copy the full SHA
    4ae0e11 View commit details

Commits on Dec 12, 2018

  1. Copy the full SHA
    23f357a View commit details
  2. Copy the full SHA
    b62430e View commit details
  3. Copy the full SHA
    2d82951 View commit details

Commits on Jan 9, 2019

  1. Fix #2 (comment)

    Hy3n4 committed Jan 9, 2019
    Copy the full SHA
    e6604b3 View commit details
  2. Fix #3 (comment)

    Hy3n4 committed Jan 9, 2019
    Copy the full SHA
    881216b View commit details

Commits on Mar 8, 2019

  1. Copy the full SHA
    d7fcd9f View commit details
  2. Copy the full SHA
    491fa07 View commit details
  3. updated readme

    danielkucera committed Mar 8, 2019
    Copy the full SHA
    e219d3f View commit details
  4. Merge pull request #5 from danielkucera/dev-0.89.1

    Changes for 0.89.1 compatibility
    Hy3n4 authored Mar 8, 2019
    Copy the full SHA
    83f2a56 View commit details

Commits on May 25, 2019

  1. Copy the full SHA
    66c27eb View commit details

Commits on May 27, 2019

  1. Merge pull request #6 from danielkucera/master

    since 0.92 __init__.py is required
    Hy3n4 authored May 27, 2019
    Copy the full SHA
    3ab30ce View commit details

Commits on Jun 5, 2019

  1. Copy the full SHA
    a93e94c View commit details

Commits on Jun 10, 2019

  1. Merge pull request #8 from Hy3n4/exception

    Catch exceptions from update thread
    Hy3n4 authored Jun 10, 2019
    Copy the full SHA
    284f595 View commit details

Commits on Sep 22, 2019

  1. Copy the full SHA
    22b8945 View commit details
  2. update configuration example in README

    Mirko Vogt committed Sep 22, 2019
    Copy the full SHA
    7b27488 View commit details

Commits on Sep 23, 2019

  1. Merge pull request #9 from mirko/master

    quick-hack-fix it back to work for latest HA version
    danielkucera authored Sep 23, 2019
    Copy the full SHA
    54f2907 View commit details

Commits on Oct 13, 2019

  1. Copy the full SHA
    bccb1c4 View commit details

Commits on Oct 21, 2019

  1. Merge pull request #10 from Hy3n4/add-action

    Added function to show action
    Hy3n4 authored Oct 21, 2019
    Copy the full SHA
    4fec008 View commit details
Showing with 324 additions and 93 deletions.
  1. +31 −0 .github/ISSUE_TEMPLATE/bug_report.md
  2. +17 −0 .github/ISSUE_TEMPLATE/feature_request.md
  3. +118 −34 README.md
  4. 0 __init__.py
  5. +158 −59 custom_components/climate/cometblue.py → climate.py
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Version of component**
- Version [e.g. 0.0.1-alpha]

**Homeassistant (please complete the following information):**
- Browser [e.g. chrome, safari]
- Version [e.g. 0.82.1]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
152 changes: 118 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,121 @@
# ha-cc-cometblue
# Home Assistant Custom Components

## CometBlue
HomeAssistant Custom Component for CometBlue/Xavax/Sygonix Bluetooth Thermostats.
Based on work of mirko https://github.com/mirko/home-assistant/blob/cometblue/homeassistant/components/climate/cometblue.py
Based on work of mirko located on [Github](https://github.com/mirko/home-assistant/blob/cometblue/homeassistant/components/climate/cometblue.py)

## Requirements
- HomeAssistant
- [HomeAssistant](https://www.home-assistant.io)
- RaspberryPi v3
- cometblue Python library
- https://github.com/xrucka/cometblue
- cometblue Python library from [Github](https://github.com/xrucka/cometblue)

## What works

Feature | Get | Set
------- | ------- | ------
Mode | :heavy_check_mark: | :heavy_check_mark:
Childlock | :heavy_check_mark: | :heavy_check_mark:
Target Temperature | :heavy_check_mark: | :heavy_check_mark:
Current Temperature | :heavy_check_mark: | :heavy_check_mark:
Open Window Detection | :heavy_multiplication_x: | :heavy_multiplication_x:
Holiday | :heavy_multiplication_x: | :heavy_multiplication_x:
Battery Level | :heavy_check_mark: | :heavy_minus_sign:
Low Battery | :heavy_check_mark: | :heavy_minus_sign:
Model | :heavy_check_mark: | :heavy_minus_sign:
Manufacturer Name | :heavy_check_mark: | :heavy_minus_sign:
Firmware Rev. | :heavy_check_mark: | :heavy_minus_sign:
Software Rev. | :heavy_check_mark: | :heavy_minus_sign:

## Installation

Installation of cometblue Python library:
> Warning: If you are using venv for running hass as I do, You will probably want to shoot your brain out of your head during installation steps :wink: . Just like I did when I was creating this installation procedure.
There are several steps that you will have to execute as pi/root user on the other hand some steps are better executed as homeassistant user in venv (if you are using venv, of course). Such commands will be preceeded by string `(homeassistant)$`. Otherwise execute commands as pi/root.

1. Installation of cometblue Python library
You should install git if you didn't already.
```sh
$ apt install git -y
(homeassistant)$ cd /tmp
(homeassistant)$ git clone https://github.com/xrucka/cometblue.git
(homeassistant)$ cd cometblue
```
2. Follow original installation procedure at: https://github.com/xrucka/cometblue#installation

Please follow installation origianl notes: https://github.com/xrucka/cometblue#installation
3. Install Dbus and some depencies for PyGObject if you didn't already

If you are using venv you have to enable homeassistant user to use bluettoth dbus
```sh
$ apt install python3-dbus libglib2.0-dev libgirepository1.0-dev libcairo2-dev
```
Dbus will be installed globally but in case you are running hass in venv you will need to copy dbus folder and some other files to venv site-packages location
```sh
$ locate dbus
...
/usr/lib/python3/dist-packages/_dbus_bindings.cpython-35m-arm-linux-gnueabihf.so
/usr/lib/python3/dist-packages/_dbus_glib_bindings.cpython-35m-arm-linux-gnueabihf.so
/usr/lib/python3/dist-packages/dbus
...
```
Copy at least theese two files and one folder to
`/srv/homeassistant/lib/python3.5/site-packages/` and change ownership to homeassistant user

Or you can just use `--system-site-packages` switch when you are creating `venv`. If you have `venv` already created and you want to use system site packages, you can always remove the file `no-global-site-packages.txt` from your `venv` location. More info in [venv docs](https://virtualenv.pypa.io/en/stable/userguide/#the-system-site-packages-option). Thanks to [@danielkucera](https://github.com/Hy3n4/ha-cc-cometblue/issues/3#issue-397075446) to point that out.

```sh
cp -r /usr/lib/python3/dist-packages/{dbus,_dbus_bindings.cpython-35m-arm-linux-gnueabihf.so,_dbus_glib_bindings.cpython-35m-arm-linux-gnueabihf.so} /srv/homeassistant/lib/python3.5/site-packages/
```
4. Install PyGObject
```sh
(homeassistant)$ pip3 install pygobject
```

5. If you are using venv in you HA installation you have to allow `homeassistant` user to use bluetooth dbus
so add this:
``` xml
<policy user="homeassistant">
<allow send_destination="org.bluez"/>
</policy>
```
to config file `/etc/dbus-1/system.d/bluetooth.conf`
```xml
<policy user="homeassistant">
<allow send_destination="org.bluez"/>
</policy>
```
to config file `/etc/dbus-1/system.d/bluetooth.conf`

But you should add it before default `deny` section.
``` xml
<policy context="default">
<deny send_destination="org.bluez"/>
</policy>
```
But you should add it before default `deny` section.
```xml
<policy context="default">
<deny send_destination="org.bluez"/>
</policy>
```

copy cometblue.py to your HA config path
if you followed HA recomendations it should be here:
``` bash
wget https://raw.githubusercontent.com/Hy3n4/ha-cc-cometblue/master/cometblue.py -O /home/homeassistant/.homeassistant/custom_components/climate/
```
Restart bluetooth.service

make HA config file
```sh
$ systemctl restart bluetooth.service
```

``` yaml
platform: cometblue
name: Living Room Test
devices:
living_room_cb:
mac: !secret thermo_living_room_mac
```
6. Checkout latest version of cometblue module to your HA config path.
If you followed HA recomendations it could be done by this command:
```console
(homeassistant)$ cd /home/homeassistant/.homeassistant/custom_components/
(homeassistant)$ git clone https://github.com/Hy3n4/ha-cc-cometblue cometblue
```
> At this moment you have to change ownership of downloaded files!

7. Copy dbus folder from it's original location (this issue is discussed [here](https://github.com/getsenic/gatt-python/issues/31))
8. Create HA config file
```yaml
climate:
- platform: cometblue
devices:
living_room_left:
mac: DE:AD:BE:EF:23:42
#pin: 0000 # default
living_room_right:
mac: DE:AD:BE:EF:42:23
pin: 1234
```
9. Check config within Home Assistant and restart HA
## Links
https://github.com/xrucka/cometblue
@@ -54,5 +125,18 @@ https://github.com/xrucka/cometblue
This readme file ;)
Posibly make it a supported part of HA??
## Troubleshooting
If you encounter any problem you should look into hass logfile located in config dir.
If there is no useful information turn on debugging in hass config.
```yaml
logger:
default: warning
logs:
homeassistant.components.climate: debug
custom_components.climate.cometblue: debug
cometblue.device: debug
```
## Notes
Special thanks to mirko for his work
Special thanks to mirko for his work on [Github]()
Empty file added __init__.py
Empty file.
Loading