mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-19 00:20:26 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9e9f16756 | ||
|
|
f15cc0d53a | ||
|
|
0f791c1e71 | ||
|
|
9887042f4d | ||
|
|
c840f2bc4d | ||
|
|
9a355b7906 | ||
|
|
9399af7ec7 | ||
|
|
be72f7e62c |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,6 +12,7 @@ data
|
|||||||
/.settings/
|
/.settings/
|
||||||
/start.bat
|
/start.bat
|
||||||
/.classpath
|
/.classpath
|
||||||
|
/.project
|
||||||
|
|
||||||
sftp-config\.json
|
sftp-config\.json
|
||||||
/bin/
|
/bin/
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -57,20 +57,20 @@ Then locate the jar and start the server with:
|
|||||||
ATTENTION: Due to port 80 being the default, Linux restricts this to super user. Use the instructions below.
|
ATTENTION: Due to port 80 being the default, Linux restricts this to super user. Use the instructions below.
|
||||||
|
|
||||||
```
|
```
|
||||||
java -jar ha-bridge-5.3.1RC1.jar
|
java -jar ha-bridge-5.3.1RC2.jar
|
||||||
```
|
```
|
||||||
|
|
||||||
## Manual installation of ha-bridge and setup of systemd service
|
## Manual installation of ha-bridge and setup of systemd service
|
||||||
Next gen Linux systems (this includes the Raspberry Pi), use systemd to run and manage services.
|
Next gen Linux systems (this includes the Raspberry Pi), use systemd to run and manage services.
|
||||||
Here is a link on how to use systemd: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units
|
Here is a link on how to use systemd: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units
|
||||||
|
|
||||||
Create the directory and make sure that ha-bridge-5.3.1RC1.jar is in your /home/pi/ha-bridge directory.
|
Create the directory and make sure that ha-bridge-5.3.1RC2.jar is in your /home/pi/ha-bridge directory.
|
||||||
|
|
||||||
```
|
```
|
||||||
pi@raspberrypi:~ $ mkdir ha-bridge
|
pi@raspberrypi:~ $ mkdir ha-bridge
|
||||||
pi@raspberrypi:~ $ cd ha-bridge
|
pi@raspberrypi:~ $ cd ha-bridge
|
||||||
|
|
||||||
pi@raspberrypi:~/ha-bridge $ wget https://github.com/bwssytems/ha-bridge/releases/download/v5.3.1RC1/ha-bridge-5.3.1RC1.jar
|
pi@raspberrypi:~/ha-bridge $ wget https://github.com/bwssytems/ha-bridge/releases/download/v5.3.1RC2/ha-bridge-5.3.1RC2.jar
|
||||||
```
|
```
|
||||||
|
|
||||||
Create the ha-bridge.service unit file:
|
Create the ha-bridge.service unit file:
|
||||||
@@ -89,7 +89,7 @@ After=network.target
|
|||||||
Type=simple
|
Type=simple
|
||||||
|
|
||||||
WorkingDirectory=/home/pi/ha-bridge
|
WorkingDirectory=/home/pi/ha-bridge
|
||||||
ExecStart=/usr/bin/java -jar -Dconfig.file=/home/pi/ha-bridge/data/habridge.config /home/pi/ha-bridge/ha-bridge-5.3.1RC1.jar
|
ExecStart=/usr/bin/java -jar -Dconfig.file=/home/pi/ha-bridge/data/habridge.config /home/pi/ha-bridge/ha-bridge-5.3.1RC2.jar
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
@@ -222,7 +222,7 @@ proxy.server = (
|
|||||||
```
|
```
|
||||||
### nginx Example
|
### nginx Example
|
||||||
```
|
```
|
||||||
location /api/ {
|
location /api {
|
||||||
proxy_pass http://127.0.0.1:8080/api;
|
proxy_pass http://127.0.0.1:8080/api;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -116,7 +116,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>4.12</version>
|
<version>4.13.1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public class DeviceResponse {
|
|||||||
private String swversion;
|
private String swversion;
|
||||||
private String swconfigid;
|
private String swconfigid;
|
||||||
private String productid;
|
private String productid;
|
||||||
|
private String productname;
|
||||||
|
|
||||||
public DeviceState getState() {
|
public DeviceState getState() {
|
||||||
return state;
|
return state;
|
||||||
@@ -90,6 +91,14 @@ public class DeviceResponse {
|
|||||||
this.productid = productid;
|
this.productid = productid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getProductName() {
|
||||||
|
return productname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductName(String productname) {
|
||||||
|
this.productname = productname;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getLuminaireuniqueid() {
|
public String getLuminaireuniqueid() {
|
||||||
return luminaireuniqueid;
|
return luminaireuniqueid;
|
||||||
@@ -109,10 +118,11 @@ public class DeviceResponse {
|
|||||||
|
|
||||||
if (device.isColorDevice()) {
|
if (device.isColorDevice()) {
|
||||||
response.setType("Extended color light");
|
response.setType("Extended color light");
|
||||||
response.setModelid("LCT010");
|
response.setModelid("LCT015");
|
||||||
response.setSwversion("1.15.2_r19181");
|
response.setSwversion("1.46.13_r26312");
|
||||||
response.setSwconfigid("F921C859");
|
response.setSwconfigid("52E3234B");
|
||||||
response.setProductid("Philips-LCT010-1-A19ECLv4");
|
response.setProductid("Philips-LCT015-1-A19ECLv5");
|
||||||
|
response.setProductName("Hue color lamp");
|
||||||
} else {
|
} else {
|
||||||
response.setType("Dimmable light");
|
response.setType("Dimmable light");
|
||||||
response.setModelid("LWB007");
|
response.setModelid("LWB007");
|
||||||
@@ -129,13 +139,14 @@ public class DeviceResponse {
|
|||||||
response.setState(group.getAction());
|
response.setState(group.getAction());
|
||||||
|
|
||||||
response.setName(group.getName());
|
response.setName(group.getName());
|
||||||
response.setUniqueid("00:17:88:5E:D3:FF-" + String.format("%02X", Integer.parseInt(group.getId())));
|
response.setUniqueid("00:11:22:33:44:55:66:77-" + String.format("%02X", Integer.parseInt(group.getId())));
|
||||||
response.setManufacturername("Philips");
|
response.setManufacturername("Philips");
|
||||||
response.setType("Extended color light");
|
response.setType("Extended color light");
|
||||||
response.setModelid("LCT010");
|
response.setModelid("LCT015");
|
||||||
response.setSwversion("1.15.2_r19181");
|
response.setSwversion("1.46.13_r26312");
|
||||||
response.setSwconfigid("F921C859");
|
response.setSwconfigid("52E3234B");
|
||||||
response.setProductid("Philips-LCT010-1-A19ECLv4");
|
response.setProductid("Philips-LCT015-1-A19ECLv5");
|
||||||
|
response.setProductName("Hue color lamp");
|
||||||
|
|
||||||
response.setLuminaireuniqueid(null);
|
response.setLuminaireuniqueid(null);
|
||||||
|
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ public class DeviceRepository extends BackupHandler {
|
|||||||
nextId++;
|
nextId++;
|
||||||
}
|
}
|
||||||
if (descriptors[i].getUniqueid() == null || descriptors[i].getUniqueid().length() == 0) {
|
if (descriptors[i].getUniqueid() == null || descriptors[i].getUniqueid().length() == 0) {
|
||||||
descriptors[i].setUniqueid("00:17:88:5E:D3:" + hueUniqueId(Integer.valueOf(descriptors[i].getId())));
|
descriptors[i].setUniqueid("00:11:22:33:44:55:66:" + hueUniqueId(Integer.valueOf(descriptors[i].getId())));
|
||||||
}
|
}
|
||||||
put(descriptors[i].getId(), descriptors[i]);
|
put(descriptors[i].getId(), descriptors[i]);
|
||||||
theNames = theNames + " " + descriptors[i].getName() + ", ";
|
theNames = theNames + " " + descriptors[i].getName() + ", ";
|
||||||
@@ -228,7 +228,7 @@ public class DeviceRepository extends BackupHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
theDevice.setId(String.valueOf(nextId));
|
theDevice.setId(String.valueOf(nextId));
|
||||||
theDevice.setUniqueid("00:17:88:5E:D3:" + hueUniqueId(nextId));
|
theDevice.setUniqueid("00:11:22:33:44:55:66:" + hueUniqueId(nextId));
|
||||||
nextId++;
|
nextId++;
|
||||||
}
|
}
|
||||||
newdevices.put(theDevice.getId(), theDevice);
|
newdevices.put(theDevice.getId(), theDevice);
|
||||||
@@ -320,4 +320,4 @@ public class DeviceRepository extends BackupHandler {
|
|||||||
|
|
||||||
return theUniqueId;
|
return theUniqueId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user