-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,83 @@ | |
[![License](https://img.shields.io/github/license/blavka/xComfortMQTT.svg)](https://github.com/blavka/xComfortMQTT/blob/master/LICENSE) | ||
[![PyPI](https://img.shields.io/pypi/v/xComfortMQTT.svg)](https://pypi.org/project/xComfortMQTT) | ||
|
||
## Installing | ||
|
||
You can install **xComfortMQTT** directly from PyPI: | ||
|
||
```sh | ||
sudo pip3 install -U xComfortMQTT | ||
``` | ||
|
||
## Config | ||
|
||
Insert this snippet to the file /etc/xComfortMQTT.yml: | ||
```yml | ||
--- | ||
shc: | ||
host: 192.168.0.2 | ||
username: admin | ||
password: very-strong-password | ||
|
||
mqtt: | ||
host: 192.168.0.1 | ||
``` | ||
## Usage | ||
Update /etc/xComfortMQTT.yml and run | ||
```sh | ||
xComfortMQTT -c /etc/xComfortMQTT.yml | ||
``` | ||
|
||
## Systemd | ||
|
||
Insert this snippet to the file /etc/systemd/system/xComfortMQTT.service: | ||
``` | ||
[Unit] | ||
Description=xComfortMQTT | ||
After=network.target | ||
[Service] | ||
Type=simple | ||
User=pi | ||
ExecStart=/usr/local/bin/xComfortMQTT -c /etc/xComfortMQTT.yml | ||
Restart=always | ||
RestartSec=5 | ||
StartLimitIntervalSec=0 | ||
[Install] | ||
WantedBy=multi-user.target | ||
``` | ||
|
||
Enable the service start on boot: | ||
```sh | ||
sudo systemctl enable xComfortMQTT.service | ||
``` | ||
|
||
Start the service: | ||
|
||
```sh | ||
sudo systemctl start xComfortMQTT.service | ||
``` | ||
|
||
View the service log: | ||
```sh | ||
journalctl -u xComfortMQTT.service -f | ||
``` | ||
|
||
## PM2 | ||
|
||
```sh | ||
pm2 start /usr/bin/python3 --name "xComfortMQTT" -- /usr/local/bin/xComfortMQTT -c /etc/xComfortMQTT.yml | ||
pm2 save | ||
``` | ||
|
||
## Development | ||
``` | ||
git clone [email protected]:blavka/xComfortMQTT.git | ||
cd xComfortMQTT | ||
./test.sh | ||
sudo python3 setup.py develop | ||
``` |