mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-19 16:41:53 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78d39325b0 | ||
|
|
208b1cad2a | ||
|
|
998450af4e | ||
|
|
d78c7c536d | ||
|
|
fb9cc64839 |
@@ -250,6 +250,8 @@ The default location for the configuration file to contain the settings for the
|
|||||||
The default location for the db to contain the devices as they are added is "data/devices.db". If you would like a different filename or directory, specify `<directory>/<filename> explicitly.
|
The default location for the db to contain the devices as they are added is "data/devices.db". If you would like a different filename or directory, specify `<directory>/<filename> explicitly.
|
||||||
#### UPNP IP Address
|
#### UPNP IP Address
|
||||||
The server defaults to the first available address on the host if this is not given. This default may NOT be the correct IP that is your public IP for your host on the network. It is best to set this parameter to not have discovery issues. Replace this value with the server ipv4 address you would like to use as the address that any upnp device will call after discovery.
|
The server defaults to the first available address on the host if this is not given. This default may NOT be the correct IP that is your public IP for your host on the network. It is best to set this parameter to not have discovery issues. Replace this value with the server ipv4 address you would like to use as the address that any upnp device will call after discovery.
|
||||||
|
#### Use UPNP Address Interface
|
||||||
|
The server tries to bind to all interfaces to respond to UPNP request. Setting this to `true` will make the binding to the interface that has the `UPNP IP Address`. The default is to be all interfaces which is set as false.
|
||||||
#### Web Server IP Address
|
#### Web Server IP Address
|
||||||
The server defaults to all interfaces on the machine (0.0.0.0). Replace this value with the server ipv4 address you would like to use as the address that will bind to a specific ip address on an interface if you would like. This is only necessary if you want to isolate how access is handled to the web UI.
|
The server defaults to all interfaces on the machine (0.0.0.0). Replace this value with the server ipv4 address you would like to use as the address that will bind to a specific ip address on an interface if you would like. This is only necessary if you want to isolate how access is handled to the web UI.
|
||||||
#### Web Server Port
|
#### Web Server Port
|
||||||
@@ -408,7 +410,7 @@ You can control items that require special calculated values using ${intensity.m
|
|||||||
|
|
||||||
For the items that want to have a date time put into the message, utilize ${time.format(yyyy-MM-ddTHH:mm:ssXXX)} where "yyyy-MM-ddTHH:mm:ssXXX" can be any format from the Java SimpleDateFormat documented here: https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
|
For the items that want to have a date time put into the message, utilize ${time.format(yyyy-MM-ddTHH:mm:ssXXX)} where "yyyy-MM-ddTHH:mm:ssXXX" can be any format from the Java SimpleDateFormat documented here: https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
|
||||||
|
|
||||||
Also, device data can be inserted into your payloads by the use of "${device.name}", "${device.id}", "${device.uniqueid}", "${device.targetDevice}", "${device.mapId}", "${device.mapType}" and "${device.deviceType}". These work just like the dimming value replacements.
|
Also, device data can be inserted into your payloads by the use of "${device.name}", "${device.id}", "${device.uniqueid}", "${device.targetDevice}", "${device.mapId}", "${device.mapType}", "${device.deviceType}", "${device.requesterAddress}", "${device.description}" and "${device.comments}". These work just like the dimming value replacements.
|
||||||
e.g.
|
e.g.
|
||||||
```
|
```
|
||||||
[{"item":"http://192.168.1.201:3480/data_request?id=action&output_format=json&DeviceNum=10&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=${intensity.math(X/4)}","type":"httpDevice"}]
|
[{"item":"http://192.168.1.201:3480/data_request?id=action&output_format=json&DeviceNum=10&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=${intensity.math(X/4)}","type":"httpDevice"}]
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>com.bwssystems.HABridge</groupId>
|
<groupId>com.bwssystems.HABridge</groupId>
|
||||||
<artifactId>ha-bridge</artifactId>
|
<artifactId>ha-bridge</artifactId>
|
||||||
<version>4.5.1</version>
|
<version>4.5.5</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>HA Bridge</name>
|
<name>HA Bridge</name>
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ public class BridgeSettingsDescriptor {
|
|||||||
@SerializedName("upnpconfigaddress")
|
@SerializedName("upnpconfigaddress")
|
||||||
@Expose
|
@Expose
|
||||||
private String upnpconfigaddress;
|
private String upnpconfigaddress;
|
||||||
|
@SerializedName("useupnpiface")
|
||||||
|
@Expose
|
||||||
|
private boolean useupnpiface;
|
||||||
@SerializedName("serverport")
|
@SerializedName("serverport")
|
||||||
@Expose
|
@Expose
|
||||||
private Integer serverport;
|
private Integer serverport;
|
||||||
@@ -104,6 +107,7 @@ public class BridgeSettingsDescriptor {
|
|||||||
public BridgeSettingsDescriptor() {
|
public BridgeSettingsDescriptor() {
|
||||||
super();
|
super();
|
||||||
this.upnpstrict = true;
|
this.upnpstrict = true;
|
||||||
|
this.useupnpiface = false;
|
||||||
this.traceupnp = false;
|
this.traceupnp = false;
|
||||||
this.nestconfigured = false;
|
this.nestconfigured = false;
|
||||||
this.veraconfigured = false;
|
this.veraconfigured = false;
|
||||||
@@ -113,8 +117,12 @@ public class BridgeSettingsDescriptor {
|
|||||||
this.halconfigured = false;
|
this.halconfigured = false;
|
||||||
this.mqttconfigured = false;
|
this.mqttconfigured = false;
|
||||||
this.hassconfigured = false;
|
this.hassconfigured = false;
|
||||||
|
this.domoticzconfigured = false;
|
||||||
|
this.somfyconfigured = false;
|
||||||
|
this.lifxconfigured = false;
|
||||||
this.farenheit = true;
|
this.farenheit = true;
|
||||||
this.whitelist = null;
|
this.whitelist = null;
|
||||||
|
this.securityData = null;
|
||||||
this.settingsChanged = false;
|
this.settingsChanged = false;
|
||||||
this.myechourl = "echo.amazon.com/#cards";
|
this.myechourl = "echo.amazon.com/#cards";
|
||||||
this.webaddress = "0.0.0.0";
|
this.webaddress = "0.0.0.0";
|
||||||
@@ -126,6 +134,12 @@ public class BridgeSettingsDescriptor {
|
|||||||
public void setUpnpConfigAddress(String upnpConfigAddress) {
|
public void setUpnpConfigAddress(String upnpConfigAddress) {
|
||||||
this.upnpconfigaddress = upnpConfigAddress;
|
this.upnpconfigaddress = upnpConfigAddress;
|
||||||
}
|
}
|
||||||
|
public boolean isUseupnpiface() {
|
||||||
|
return useupnpiface;
|
||||||
|
}
|
||||||
|
public void setUseupnpiface(boolean useupnpiface) {
|
||||||
|
this.useupnpiface = useupnpiface;
|
||||||
|
}
|
||||||
public Integer getServerPort() {
|
public Integer getServerPort() {
|
||||||
return serverport;
|
return serverport;
|
||||||
}
|
}
|
||||||
@@ -385,8 +399,10 @@ public class BridgeSettingsDescriptor {
|
|||||||
List<NamedIP> devicesList = this.getHaladdress().getDevices();
|
List<NamedIP> devicesList = this.getHaladdress().getDevices();
|
||||||
if(devicesList.get(0).getIp().contains(Configuration.DEFAULT_ADDRESS))
|
if(devicesList.get(0).getIp().contains(Configuration.DEFAULT_ADDRESS))
|
||||||
return false;
|
return false;
|
||||||
|
if(devicesList.get(0).getPassword() == null || devicesList.get(0).getPassword().trim().isEmpty()) {
|
||||||
if(this.getHaltoken() == null || this.getHaltoken().equals(""))
|
if(this.getHaltoken() == null || this.getHaltoken().equals(""))
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public Boolean isValidMQTT() {
|
public Boolean isValidMQTT() {
|
||||||
|
|||||||
@@ -74,7 +74,8 @@ public class DeviceDescriptor{
|
|||||||
@SerializedName("comments")
|
@SerializedName("comments")
|
||||||
@Expose
|
@Expose
|
||||||
private String comments;
|
private String comments;
|
||||||
|
@SerializedName("deviceState")
|
||||||
|
@Expose
|
||||||
private DeviceState deviceState;
|
private DeviceState deviceState;
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ public class DeviceRepository extends BackupHandler {
|
|||||||
{
|
{
|
||||||
DeviceDescriptor list[] = gson.fromJson(jsonContent, DeviceDescriptor[].class);
|
DeviceDescriptor list[] = gson.fromJson(jsonContent, DeviceDescriptor[].class);
|
||||||
for(int i = 0; i < list.length; i++) {
|
for(int i = 0; i < list.length; i++) {
|
||||||
|
list[i].setDeviceState(null);
|
||||||
put(list[i].getId(), list[i]);
|
put(list[i].getId(), list[i]);
|
||||||
if(Integer.decode(list[i].getId()) > nextId) {
|
if(Integer.decode(list[i].getId()) > nextId) {
|
||||||
nextId = Integer.decode(list[i].getId());
|
nextId = Integer.decode(list[i].getId());
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ public class DeviceDataDecode {
|
|||||||
private static final String DEVICE_MAPTYPE = "${device.mapType}";
|
private static final String DEVICE_MAPTYPE = "${device.mapType}";
|
||||||
private static final String DEVICE_DEVICETYPE = "${device.deviceType}";
|
private static final String DEVICE_DEVICETYPE = "${device.deviceType}";
|
||||||
private static final String DEVICE_TARGETDEVICE = "${device.targetDevice}";
|
private static final String DEVICE_TARGETDEVICE = "${device.targetDevice}";
|
||||||
|
private static final String DEVICE_REQUESTERADDRESS = "${device.requesterAddress}";
|
||||||
|
private static final String DEVICE_DESCRIPTION = "${device.description}";
|
||||||
|
private static final String DEVICE_COMMENTS = "${device.comments}";
|
||||||
|
|
||||||
public static String replaceDeviceData(String request, DeviceDescriptor device) {
|
public static String replaceDeviceData(String request, DeviceDescriptor device) {
|
||||||
if (request == null) {
|
if (request == null) {
|
||||||
@@ -58,6 +61,21 @@ public class DeviceDataDecode {
|
|||||||
notDone = true;
|
notDone = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (request.contains(DEVICE_REQUESTERADDRESS)) {
|
||||||
|
request = request.replace(DEVICE_REQUESTERADDRESS, device.getRequesterAddress());
|
||||||
|
notDone = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (request.contains(DEVICE_DESCRIPTION)) {
|
||||||
|
request = request.replace(DEVICE_DESCRIPTION, device.getDescription());
|
||||||
|
notDone = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (request.contains(DEVICE_COMMENTS)) {
|
||||||
|
request = request.replace(DEVICE_COMMENTS, device.getComments());
|
||||||
|
notDone = true;
|
||||||
|
}
|
||||||
|
|
||||||
log.debug("Request <<" + request + ">>, not done: " + notDone);
|
log.debug("Request <<" + request + ">>, not done: " + notDone);
|
||||||
}
|
}
|
||||||
return request;
|
return request;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.bwssystems.HABridge.plugins.hal;
|
package com.bwssystems.HABridge.plugins.hal;
|
||||||
|
|
||||||
|
import com.bwssystems.HABridge.NamedIP;
|
||||||
|
|
||||||
public class HalDevice {
|
public class HalDevice {
|
||||||
private String haldevicetype;
|
private String haldevicetype;
|
||||||
private String haldevicename;
|
private String haldevicename;
|
||||||
private String haladdress;
|
private NamedIP haladdress;
|
||||||
private String halname;
|
|
||||||
private Boolean secure;
|
|
||||||
private DeviceElements buttons;
|
private DeviceElements buttons;
|
||||||
public String getHaldevicetype() {
|
public String getHaldevicetype() {
|
||||||
return haldevicetype;
|
return haldevicetype;
|
||||||
@@ -19,24 +19,12 @@ public class HalDevice {
|
|||||||
public void setHaldevicename(String haldevicename) {
|
public void setHaldevicename(String haldevicename) {
|
||||||
this.haldevicename = haldevicename;
|
this.haldevicename = haldevicename;
|
||||||
}
|
}
|
||||||
public String getHaladdress() {
|
public NamedIP getHaladdress() {
|
||||||
return haladdress;
|
return haladdress;
|
||||||
}
|
}
|
||||||
public void setHaladdress(String haladdress) {
|
public void setHaladdress(NamedIP haladdress) {
|
||||||
this.haladdress = haladdress;
|
this.haladdress = haladdress;
|
||||||
}
|
}
|
||||||
public String getHalname() {
|
|
||||||
return halname;
|
|
||||||
}
|
|
||||||
public void setHalname(String halname) {
|
|
||||||
this.halname = halname;
|
|
||||||
}
|
|
||||||
public Boolean getSecure() {
|
|
||||||
return secure;
|
|
||||||
}
|
|
||||||
public void setSecure(Boolean secure) {
|
|
||||||
this.secure = secure;
|
|
||||||
}
|
|
||||||
public DeviceElements getButtons() {
|
public DeviceElements getButtons() {
|
||||||
return buttons;
|
return buttons;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,31 +112,46 @@ public class HalHome implements Home {
|
|||||||
@Override
|
@Override
|
||||||
public String deviceHandler(CallItem anItem, MultiCommandUtil aMultiUtil, String lightId, int intensity,
|
public String deviceHandler(CallItem anItem, MultiCommandUtil aMultiUtil, String lightId, int intensity,
|
||||||
Integer targetBri,Integer targetBriInc, DeviceDescriptor device, String body) {
|
Integer targetBri,Integer targetBriInc, DeviceDescriptor device, String body) {
|
||||||
|
boolean halFound = false;
|
||||||
String responseString = null;
|
String responseString = null;
|
||||||
String theUrl = anItem.getItem().getAsString();
|
String theUrl = anItem.getItem().getAsString();
|
||||||
if(theUrl != null && !theUrl.isEmpty () && theUrl.contains("http://")) {
|
if(theUrl != null && !theUrl.isEmpty () && theUrl.contains("http")) {
|
||||||
String intermediate = theUrl.substring(theUrl.indexOf("://") + 3);
|
String intermediate = theUrl.substring(theUrl.indexOf("://") + 3);
|
||||||
String hostPortion = intermediate.substring(0, intermediate.indexOf('/'));
|
String hostPortion = intermediate.substring(0, intermediate.indexOf('/'));
|
||||||
// String theUrlBody = intermediate.substring(intermediate.indexOf('/') + 1);
|
// String theUrlBody = intermediate.substring(intermediate.indexOf('/') + 1);
|
||||||
String hostAddr = null;
|
// String hostAddr = null;
|
||||||
// String port = null;
|
// String port = null;
|
||||||
if (hostPortion.contains(":")) {
|
// if (hostPortion.contains(":")) {
|
||||||
hostAddr = hostPortion.substring(0, intermediate.indexOf(':'));
|
// hostAddr = hostPortion.substring(0, intermediate.indexOf(':'));
|
||||||
// port = hostPortion.substring(intermediate.indexOf(':') + 1);
|
// port = hostPortion.substring(intermediate.indexOf(':') + 1);
|
||||||
} else
|
// } else
|
||||||
hostAddr = hostPortion;
|
// hostAddr = hostPortion;
|
||||||
log.debug("executing HUE api request to Http "
|
log.debug("executing HUE api request to Http "
|
||||||
+ (anItem.getHttpVerb() == null ? "GET" : anItem.getHttpVerb()) + ": "
|
+ (anItem.getHttpVerb() == null ? "GET" : anItem.getHttpVerb()) + ": "
|
||||||
+ anItem.getItem().getAsString());
|
+ anItem.getItem().getAsString());
|
||||||
|
|
||||||
String anUrl = BrightnessDecode.calculateReplaceIntensityValue(theUrl,
|
String anUrl = null;
|
||||||
intensity, targetBri, targetBriInc, false);
|
|
||||||
|
anUrl = BrightnessDecode.calculateReplaceIntensityValue(intermediate, intensity, targetBri, targetBriInc, false);
|
||||||
anUrl = DeviceDataDecode.replaceDeviceData(anUrl, device);
|
anUrl = DeviceDataDecode.replaceDeviceData(anUrl, device);
|
||||||
anUrl = TimeDecode.replaceTimeValue(anUrl);
|
anUrl = TimeDecode.replaceTimeValue(anUrl);
|
||||||
|
|
||||||
for (Map.Entry<String, HalInfo> entry : hals.entrySet())
|
for (Map.Entry<String, HalInfo> entry : hals.entrySet())
|
||||||
{
|
{
|
||||||
if(entry.getValue().getHalAddress().getIp().equals(hostAddr)) {
|
if(entry.getValue().getHalAddress().getIp().equals(hostPortion)) {
|
||||||
|
halFound = true;
|
||||||
|
if(entry.getValue().getHalAddress().getSecure()!= null && entry.getValue().getHalAddress().getSecure())
|
||||||
|
anUrl = "https://" + anUrl;
|
||||||
|
else
|
||||||
|
anUrl = "http://" + anUrl;
|
||||||
|
|
||||||
|
if(!anUrl.contains("?Token="))
|
||||||
|
anUrl = anUrl + "?Token=" + entry.getValue().getHalAddress().getPassword();
|
||||||
|
|
||||||
|
log.debug("executing HUE api request to Http "
|
||||||
|
+ (anItem.getHttpVerb() == null ? "GET" : anItem.getHttpVerb()) + ": "
|
||||||
|
+ anUrl);
|
||||||
|
|
||||||
if (entry.getValue().deviceCommand(anUrl) == null) {
|
if (entry.getValue().deviceCommand(anUrl) == null) {
|
||||||
log.warn("Error on calling hal to change device state: " + anUrl);
|
log.warn("Error on calling hal to change device state: " + anUrl);
|
||||||
responseString = new Gson().toJson(HueErrorResponse.createResponse("6", "/lights/" + lightId,
|
responseString = new Gson().toJson(HueErrorResponse.createResponse("6", "/lights/" + lightId,
|
||||||
@@ -146,6 +161,13 @@ public class HalHome implements Home {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!halFound) {
|
||||||
|
log.warn("No HAL found to call: " + theUrl);
|
||||||
|
responseString = new Gson().toJson(HueErrorResponse.createResponse("6", "/lights/" + lightId,
|
||||||
|
"No HAL found.", "/lights/"
|
||||||
|
+ lightId + "state", null, null).getTheErrors(), HueError[].class);
|
||||||
|
}
|
||||||
return responseString;
|
return responseString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,13 +35,13 @@ public class HalInfo {
|
|||||||
private static final String IRDATA_TYPE = "IrData";
|
private static final String IRDATA_TYPE = "IrData";
|
||||||
private HTTPHandler httpClient;
|
private HTTPHandler httpClient;
|
||||||
private NamedIP halAddress;
|
private NamedIP halAddress;
|
||||||
private String theToken;
|
|
||||||
|
|
||||||
public HalInfo(NamedIP addressName, String aGivenToken) {
|
public HalInfo(NamedIP addressName, String aGivenToken) {
|
||||||
super();
|
super();
|
||||||
httpClient = new HTTPHandler();
|
httpClient = new HTTPHandler();
|
||||||
halAddress = addressName;
|
halAddress = addressName;
|
||||||
theToken = aGivenToken;
|
if(halAddress.getPassword() == null || halAddress.getPassword().trim().isEmpty())
|
||||||
|
halAddress.setPassword(aGivenToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<HalDevice> getLights() {
|
public List<HalDevice> getLights() {
|
||||||
@@ -98,16 +98,16 @@ public class HalInfo {
|
|||||||
|
|
||||||
String theUrl = null;
|
String theUrl = null;
|
||||||
String theData;
|
String theData;
|
||||||
if(halAddress.getSecure())
|
if(halAddress.getSecure()!= null && halAddress.getSecure())
|
||||||
theUrl = "https://";
|
theUrl = "https://";
|
||||||
else
|
else
|
||||||
theUrl = "http://";
|
theUrl = "http://";
|
||||||
theUrl = theUrl + halAddress.getIp() + apiType + theToken;
|
theUrl = theUrl + halAddress.getIp() + apiType + halAddress.getPassword();
|
||||||
theData = httpClient.doHttpRequest(theUrl, null, null, null, null);
|
theData = httpClient.doHttpRequest(theUrl, null, null, null, null);
|
||||||
if(theData != null) {
|
if(theData != null) {
|
||||||
log.debug("GET " + deviceType + " HalApiResponse - data: " + theData);
|
log.debug("GET " + deviceType + " HalApiResponse - data: " + theData);
|
||||||
theHalApiResponse = new Gson().fromJson(theData, DeviceElements.class);
|
theHalApiResponse = new Gson().fromJson(theData, DeviceElements.class);
|
||||||
if(theHalApiResponse.getDeviceElements() == null) {
|
if(theHalApiResponse == null || theHalApiResponse.getDeviceElements() == null) {
|
||||||
StatusDescription theStatus = new Gson().fromJson(theData, StatusDescription.class);
|
StatusDescription theStatus = new Gson().fromJson(theData, StatusDescription.class);
|
||||||
if(theStatus.getStatus() == null) {
|
if(theStatus.getStatus() == null) {
|
||||||
log.warn("Cannot get an devices for type " + deviceType + " for hal " + halAddress.getName() + " as response is not parsable.");
|
log.warn("Cannot get an devices for type " + deviceType + " for hal " + halAddress.getName() + " as response is not parsable.");
|
||||||
@@ -125,9 +125,10 @@ public class HalInfo {
|
|||||||
HalDevice aNewHalDevice = new HalDevice();
|
HalDevice aNewHalDevice = new HalDevice();
|
||||||
aNewHalDevice.setHaldevicetype(deviceType);
|
aNewHalDevice.setHaldevicetype(deviceType);
|
||||||
aNewHalDevice.setHaldevicename(theDevice.getDeviceName());
|
aNewHalDevice.setHaldevicename(theDevice.getDeviceName());
|
||||||
aNewHalDevice.setHaladdress(halAddress.getIp());
|
NamedIP theaddress = new NamedIP();
|
||||||
aNewHalDevice.setHalname(halAddress.getName());
|
theaddress.setIp(halAddress.getIp());
|
||||||
aNewHalDevice.setSecure(halAddress.getSecure());
|
theaddress.setName(halAddress.getName());
|
||||||
|
aNewHalDevice.setHaladdress(theaddress);
|
||||||
deviceList.add(aNewHalDevice);
|
deviceList.add(aNewHalDevice);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -150,11 +151,11 @@ public class HalInfo {
|
|||||||
deviceList = new ArrayList<HalDevice>();
|
deviceList = new ArrayList<HalDevice>();
|
||||||
while (theHalDevices.hasNext()) {
|
while (theHalDevices.hasNext()) {
|
||||||
HalDevice theHalDevice = theHalDevices.next();
|
HalDevice theHalDevice = theHalDevices.next();
|
||||||
if(halAddress.getSecure())
|
if(halAddress.getSecure()!= null && halAddress.getSecure())
|
||||||
theUrl = "https://";
|
theUrl = "https://";
|
||||||
else
|
else
|
||||||
theUrl = "http://";
|
theUrl = "http://";
|
||||||
theUrl = theUrl + halAddress.getIp() + IRBUTTON_REQUEST + TextStringFormatter.forQuerySpaceUrl(theHalDevice.getHaldevicename()) + TOKEN_REQUEST + theToken;
|
theUrl = theUrl + halAddress.getIp() + IRBUTTON_REQUEST + TextStringFormatter.forQuerySpaceUrl(theHalDevice.getHaldevicename()) + TOKEN_REQUEST + halAddress.getPassword();
|
||||||
theData = httpClient.doHttpRequest(theUrl, null, null, null, null);
|
theData = httpClient.doHttpRequest(theUrl, null, null, null, null);
|
||||||
if (theData != null) {
|
if (theData != null) {
|
||||||
log.debug("GET IrData for IR Device " + theHalDevice.getHaldevicename() + " HalApiResponse - data: " + theData);
|
log.debug("GET IrData for IR Device " + theHalDevice.getHaldevicename() + " HalApiResponse - data: " + theData);
|
||||||
@@ -205,6 +206,5 @@ public class HalInfo {
|
|||||||
httpClient.closeHandler();
|
httpClient.closeHandler();
|
||||||
httpClient = null;
|
httpClient = null;
|
||||||
halAddress = null;
|
halAddress = null;
|
||||||
theToken = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class UpnpListener {
|
|||||||
private String responseAddress;
|
private String responseAddress;
|
||||||
private boolean strict;
|
private boolean strict;
|
||||||
private boolean traceupnp;
|
private boolean traceupnp;
|
||||||
|
private boolean useUpnpIface;
|
||||||
private BridgeControlDescriptor bridgeControl;
|
private BridgeControlDescriptor bridgeControl;
|
||||||
private String bridgeId;
|
private String bridgeId;
|
||||||
private String bridgeSNUUID;
|
private String bridgeSNUUID;
|
||||||
@@ -74,6 +75,7 @@ public class UpnpListener {
|
|||||||
responseAddress = theSettings.getUpnpConfigAddress();
|
responseAddress = theSettings.getUpnpConfigAddress();
|
||||||
strict = theSettings.isUpnpStrict();
|
strict = theSettings.isUpnpStrict();
|
||||||
traceupnp = theSettings.isTraceupnp();
|
traceupnp = theSettings.isTraceupnp();
|
||||||
|
useUpnpIface = theSettings.isUseupnpiface();
|
||||||
bridgeControl = theControl;
|
bridgeControl = theControl;
|
||||||
aHueConfig = HuePublicConfig.createConfig("temp", responseAddress, HueConstants.HUB_VERSION);
|
aHueConfig = HuePublicConfig.createConfig("temp", responseAddress, HueConstants.HUB_VERSION);
|
||||||
bridgeId = aHueConfig.getBridgeid();
|
bridgeId = aHueConfig.getBridgeid();
|
||||||
@@ -114,6 +116,9 @@ public class UpnpListener {
|
|||||||
else
|
else
|
||||||
log.debug(name + " ... has addr " + addr);
|
log.debug(name + " ... has addr " + addr);
|
||||||
if (InetAddressUtils.isIPv4Address(addr.getHostAddress())) {
|
if (InetAddressUtils.isIPv4Address(addr.getHostAddress())) {
|
||||||
|
if(!useUpnpIface)
|
||||||
|
IPsPerNic++;
|
||||||
|
else if(addr.getHostAddress().equals(responseAddress))
|
||||||
IPsPerNic++;
|
IPsPerNic++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1134,6 +1134,7 @@ app.service ('bridgeService', function ($rootScope, $http, $base64, $location, n
|
|||||||
|
|
||||||
this.testUrl = function (device, type, value) {
|
this.testUrl = function (device, type, value) {
|
||||||
var msgDescription = "unknown";
|
var msgDescription = "unknown";
|
||||||
|
self.getTestUser();
|
||||||
var testUrl = this.state.huebase + "/" + this.state.testuser + "/lights/" + device.id + "/state";
|
var testUrl = this.state.huebase + "/" + this.state.testuser + "/lights/" + device.id + "/state";
|
||||||
var testBody = "{\"on\":";
|
var testBody = "{\"on\":";
|
||||||
if (type === "off") {
|
if (type === "off") {
|
||||||
@@ -1151,8 +1152,13 @@ app.service ('bridgeService', function ($rootScope, $http, $base64, $location, n
|
|||||||
msgDescription = "success " + angular.toJson(response.data);
|
msgDescription = "success " + angular.toJson(response.data);
|
||||||
}
|
}
|
||||||
if (typeof(response.data[0].error) !== 'undefined') {
|
if (typeof(response.data[0].error) !== 'undefined') {
|
||||||
|
if(reponse.data[0].error.indexOf("unauthorized") > -1) {
|
||||||
|
self.displayWarn("Authorization error, please retry...", null);
|
||||||
|
}
|
||||||
|
else {
|
||||||
msgDescription = "error " + angular.toJson(response.data[0].error);
|
msgDescription = "error " + angular.toJson(response.data[0].error);
|
||||||
self.displayErrorMessage("Request Error, Pleae look in your habridge log: ", msgDescription);
|
self.displayErrorMessage("Request Error, Please look in your habridge log: ", msgDescription);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1317,11 +1323,11 @@ app.controller ('SystemController', function ($scope, $location, bridgeService,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$scope.addHaltoSettings = function (newhalname, newhalip) {
|
$scope.addHaltoSettings = function (newhalname, newhalip, newhalsecure, newhaltoken) {
|
||||||
if($scope.bridge.settings.haladdress === undefined || $scope.bridge.settings.haladdress === null) {
|
if($scope.bridge.settings.haladdress === undefined || $scope.bridge.settings.haladdress === null) {
|
||||||
$scope.bridge.settings.haladdress = { devices: [] };
|
$scope.bridge.settings.haladdress = { devices: [] };
|
||||||
}
|
}
|
||||||
var newhal = {name: newhalname, ip: newhalip }
|
var newhal = {name: newhalname, ip: newhalip, secure: newhalsecure, password: newhaltoken }
|
||||||
$scope.bridge.settings.haladdress.devices.push(newhal);
|
$scope.bridge.settings.haladdress.devices.push(newhal);
|
||||||
$scope.newhalname = null;
|
$scope.newhalname = null;
|
||||||
$scope.newhalip = null;
|
$scope.newhalip = null;
|
||||||
@@ -2202,7 +2208,6 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
|||||||
var preOffCmd = "";
|
var preOffCmd = "";
|
||||||
var nameCmd = "";
|
var nameCmd = "";
|
||||||
var aDeviceType;
|
var aDeviceType;
|
||||||
var postCmd = "?Token=" + $scope.bridge.settings.haltoken;
|
|
||||||
if(haldevice.haldevicetype === "Group") {
|
if(haldevice.haldevicetype === "Group") {
|
||||||
aDeviceType = "group";
|
aDeviceType = "group";
|
||||||
preOnCmd = "/GroupService!GroupCmd=On";
|
preOnCmd = "/GroupService!GroupCmd=On";
|
||||||
@@ -2227,29 +2232,25 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
|||||||
nameCmd = "!DeviceName=";
|
nameCmd = "!DeviceName=";
|
||||||
}
|
}
|
||||||
if((dim_control.indexOf("byte") >= 0 || dim_control.indexOf("percent") >= 0 || dim_control.indexOf("math") >= 0) && aDeviceType === "switch")
|
if((dim_control.indexOf("byte") >= 0 || dim_control.indexOf("percent") >= 0 || dim_control.indexOf("math") >= 0) && aDeviceType === "switch")
|
||||||
dimpayload = "http://" + haldevice.haladdress
|
dimpayload = "http://" + haldevice.haladdress.ip
|
||||||
+ preDimCmd
|
+ preDimCmd
|
||||||
+ dim_control
|
+ dim_control
|
||||||
+ nameCmd
|
+ nameCmd
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20");
|
||||||
+ postCmd;
|
|
||||||
else
|
else
|
||||||
dimpayload = "http://" + haldevice.haladdress
|
dimpayload = "http://" + haldevice.haladdress.ip
|
||||||
+ preOnCmd
|
+ preOnCmd
|
||||||
+ nameCmd
|
+ nameCmd
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20");
|
||||||
+ postCmd;
|
onpayload = "http://" + haldevice.haladdress.ip
|
||||||
onpayload = "http://" + haldevice.haladdress
|
|
||||||
+ preOnCmd
|
+ preOnCmd
|
||||||
+ nameCmd
|
+ nameCmd
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20");
|
||||||
+ postCmd;
|
offpayload = "http://" + haldevice.haladdress.ip
|
||||||
offpayload = "http://" + haldevice.haladdress
|
|
||||||
+ preOffCmd
|
+ preOffCmd
|
||||||
+ nameCmd
|
+ nameCmd
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20");
|
||||||
+ postCmd;
|
bridgeService.buildUrls(onpayload, dimpayload, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name, haldevice.haldevicename, haldevice.haladdress.name, aDeviceType, "halDevice", null, null);
|
||||||
bridgeService.buildUrls(onpayload, dimpayload, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname, haldevice.haldevicename, haldevice.halname, aDeviceType, "halDevice", null, null);
|
|
||||||
$scope.device = bridgeService.state.device;
|
$scope.device = bridgeService.state.device;
|
||||||
if (!buildonly) {
|
if (!buildonly) {
|
||||||
bridgeService.editNewDevice($scope.device);
|
bridgeService.editNewDevice($scope.device);
|
||||||
@@ -2260,10 +2261,10 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
|||||||
$scope.buildButtonUrls = function (haldevice, onbutton, offbutton, buildonly) {
|
$scope.buildButtonUrls = function (haldevice, onbutton, offbutton, buildonly) {
|
||||||
var actionOn = angular.fromJson(onbutton);
|
var actionOn = angular.fromJson(onbutton);
|
||||||
var actionOff = angular.fromJson(offbutton);
|
var actionOff = angular.fromJson(offbutton);
|
||||||
onpayload = "http://" + haldevice.haladdress + "/IrService!IrCmd=Set!IrDevice=" + haldevice.haldevicename.replaceAll(" ", "%20") + "!IrButton=" + actionOn.DeviceName.replaceAll(" ", "%20") + "?Token=" + $scope.bridge.settings.haltoken;
|
onpayload = "http://" + haldevice.haladdress.ip + "/IrService!IrCmd=Set!IrDevice=" + haldevice.haldevicename.replaceAll(" ", "%20") + "!IrButton=" + actionOn.DeviceName.replaceAll(" ", "%20");
|
||||||
offpayload = "http://" + haldevice.haladdress + "/IrService!IrCmd=Set!IrDevice=" + haldevice.haldevicename.replaceAll(" ", "%20") + "!IrButton=" + actionOff.DeviceName.replaceAll(" ", "%20") + "?Token=" + $scope.bridge.settings.haltoken;
|
offpayload = "http://" + haldevice.haladdress.ip + "/IrService!IrCmd=Set!IrDevice=" + haldevice.haldevicename.replaceAll(" ", "%20") + "!IrButton=" + actionOff.DeviceName.replaceAll(" ", "%20");
|
||||||
|
|
||||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-" + actionOn.DeviceName, haldevice.haldevicename, haldevice.halname, "button", "halButton", null, null);
|
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-" + actionOn.DeviceName, haldevice.haldevicename, haldevice.haladdress.name, "button", "halButton", null, null);
|
||||||
$scope.device = bridgeService.state.device;
|
$scope.device = bridgeService.state.device;
|
||||||
if (!buildonly) {
|
if (!buildonly) {
|
||||||
bridgeService.editNewDevice($scope.device);
|
bridgeService.editNewDevice($scope.device);
|
||||||
@@ -2272,9 +2273,9 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.buildHALHomeUrls = function (haldevice, buildonly) {
|
$scope.buildHALHomeUrls = function (haldevice, buildonly) {
|
||||||
onpayload = "http://" + haldevice.haladdress + "/ModeService!ModeCmd=Set!ModeName=Home?Token=" + $scope.bridge.settings.haltoken;
|
onpayload = "http://" + haldevice.haladdress.ip + "/ModeService!ModeCmd=Set!ModeName=Home";
|
||||||
offpayload = "http://" + haldevice.haladdress + "/ModeService!ModeCmd=Set!ModeName=Away?Token=" + $scope.bridge.settings.haltoken;
|
offpayload = "http://" + haldevice.haladdress.ip + "/ModeService!ModeCmd=Set!ModeName=Away";
|
||||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-HomeAway", haldevice.haldevicename, haldevice.halname, "home", "halHome", null, null);
|
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-HomeAway", haldevice.haldevicename, haldevice.haladdress.name, "home", "halHome", null, null);
|
||||||
$scope.device = bridgeService.state.device;
|
$scope.device = bridgeService.state.device;
|
||||||
if (!buildonly) {
|
if (!buildonly) {
|
||||||
bridgeService.editNewDevice($scope.device);
|
bridgeService.editNewDevice($scope.device);
|
||||||
@@ -2283,22 +2284,19 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.buildHALHeatUrls = function (haldevice, buildonly) {
|
$scope.buildHALHeatUrls = function (haldevice, buildonly) {
|
||||||
onpayload = "http://" + haldevice.haladdress
|
onpayload = "http://" + haldevice.haladdress.ip
|
||||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||||
+ "!HVACMode=Heat?Token="
|
+ "!HVACMode=Heat";
|
||||||
+ $scope.bridge.settings.haltoken;
|
dimpayload = "http://" + haldevice.haladdress.ip
|
||||||
dimpayload = "http://" + haldevice.haladdress
|
|
||||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||||
+ "!HVACMode=Heat!HeatSpValue=${intensity.percent}?Token="
|
+ "!HVACMode=Heat!HeatSpValue=${intensity.percent}";
|
||||||
+ $scope.bridge.settings.haltoken;
|
offpayload = "http://" + haldevice.haladdress.ip
|
||||||
offpayload = "http://" + haldevice.haladdress
|
|
||||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||||
+ "!HVACMode=Off?Token="
|
+ "!HVACMode=Off";
|
||||||
+ $scope.bridge.settings.haltoken;
|
bridgeService.buildUrls(onpayload, dimpayload, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-SetHeat", haldevice.haldevicename + " Heat", haldevice.haladdress.name, "thermo", "halThermoSet", null, null);
|
||||||
bridgeService.buildUrls(onpayload, dimpayload, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-SetHeat", haldevice.haldevicename + " Heat", haldevice.halname, "thermo", "halThermoSet", null, null);
|
|
||||||
$scope.device = bridgeService.state.device;
|
$scope.device = bridgeService.state.device;
|
||||||
if (!buildonly) {
|
if (!buildonly) {
|
||||||
bridgeService.editNewDevice($scope.device);
|
bridgeService.editNewDevice($scope.device);
|
||||||
@@ -2307,22 +2305,19 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.buildHALCoolUrls = function (haldevice, buildonly) {
|
$scope.buildHALCoolUrls = function (haldevice, buildonly) {
|
||||||
onpayload = "http://" + haldevice.haladdress
|
onpayload = "http://" + haldevice.haladdress.ip
|
||||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||||
+ "!HVACMode=Cool?Token="
|
+ "!HVACMode=Cool";
|
||||||
+ $scope.bridge.settings.haltoken;
|
dimpayload = "http://" + haldevice.haladdress.ip
|
||||||
dimpayload = "http://" + haldevice.haladdress
|
|
||||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||||
+ "!HVACMode=Cool!CoolSpValue=${intensity.percent}?Token="
|
+ "!HVACMode=Cool!CoolSpValue=${intensity.percent}";
|
||||||
+ $scope.bridge.settings.haltoken;
|
offpayload = "http://" + haldevice.haladdress.ip
|
||||||
offpayload = "http://" + haldevice.haladdress
|
|
||||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||||
+ "!HVACMode=Off?Token="
|
+ "!HVACMode=Off";
|
||||||
+ $scope.bridge.settings.haltoken;
|
bridgeService.buildUrls(onpayload, dimpayload, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-SetCool", haldevice.haldevicename + " Cool", haldevice.haladdress.name, "thermo", "halThermoSet", null, null);
|
||||||
bridgeService.buildUrls(onpayload, dimpayload, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-SetCool", haldevice.haldevicename + " Cool", haldevice.halname, "thermo", "halThermoSet", null, null);
|
|
||||||
$scope.device = bridgeService.state.device;
|
$scope.device = bridgeService.state.device;
|
||||||
if (!buildonly) {
|
if (!buildonly) {
|
||||||
bridgeService.editNewDevice($scope.device);
|
bridgeService.editNewDevice($scope.device);
|
||||||
@@ -2331,16 +2326,15 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.buildHALAutoUrls = function (haldevice, buildonly) {
|
$scope.buildHALAutoUrls = function (haldevice, buildonly) {
|
||||||
onpayload = "http://" + haldevice.haladdress
|
onpayload = "http://" + haldevice.haladdress.ip
|
||||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||||
+ "!HVACMode=Auto?Token="
|
+ "!HVACMode=Auto";
|
||||||
+ $scope.bridge.settings.haltoken;
|
offpayload = "http://" + haldevice.haladdress.ip
|
||||||
offpayload = "http://" + haldevice.haladdress
|
|
||||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||||
+ "!HVACMode=Off?Token="
|
+ "!HVACMode=Off";
|
||||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-SetAuto", haldevice.haldevicename + " Auto", haldevice.halname, "thermo", "halThermoSet", null, null);
|
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-SetAuto", haldevice.haldevicename + " Auto", haldevice.haladdress.name, "thermo", "halThermoSet", null, null);
|
||||||
$scope.device = bridgeService.state.device;
|
$scope.device = bridgeService.state.device;
|
||||||
if (!buildonly) {
|
if (!buildonly) {
|
||||||
bridgeService.editNewDevice($scope.device);
|
bridgeService.editNewDevice($scope.device);
|
||||||
@@ -2349,17 +2343,15 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.buildHALOffUrls = function (haldevice, buildonly) {
|
$scope.buildHALOffUrls = function (haldevice, buildonly) {
|
||||||
onpayload = "http://" + haldevice.haladdress
|
onpayload = "http://" + haldevice.haladdress.ip
|
||||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||||
+ "!HVACMode=Auto?Token="
|
+ "!HVACMode=Auto";
|
||||||
+ $scope.bridge.settings.haltoken;
|
offpayload = "http://" + haldevice.haladdress.ip
|
||||||
offpayload = "http://" + haldevice.haladdress
|
|
||||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||||
+ "!HVACMode=Off?Token="
|
+ "!HVACMode=Off";
|
||||||
$scope.device.offUrl = "http://" + haldevice.haladdress
|
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-TurnOff", haldevice.haldevicename + " Thermostat", haldevice.haladdress.name, "thermo", "halThermoSet", null, null);
|
||||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-TurnOff", haldevice.haldevicename + " Thermostat", haldevice.halname, "thermo", "halThermoSet", null, null);
|
|
||||||
$scope.device = bridgeService.state.device;
|
$scope.device = bridgeService.state.device;
|
||||||
if (!buildonly) {
|
if (!buildonly) {
|
||||||
bridgeService.editNewDevice($scope.device);
|
bridgeService.editNewDevice($scope.device);
|
||||||
@@ -2368,17 +2360,15 @@ app.controller('HalController', function ($scope, $location, bridgeService, ngDi
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.buildHALFanUrls = function (haldevice, buildonly) {
|
$scope.buildHALFanUrls = function (haldevice, buildonly) {
|
||||||
onpayload = "http://" + haldevice.haladdress
|
onpayload = "http://" + haldevice.haladdress.ip
|
||||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||||
+ "!FanMode=On?Token="
|
+ "!FanMode=On";
|
||||||
+ $scope.bridge.settings.haltoken;
|
offpayload = "http://" + haldevice.haladdress.ip
|
||||||
offpayload = "http://" + haldevice.haladdress
|
|
||||||
+ "/HVACService!HVACCmd=Set!HVACName="
|
+ "/HVACService!HVACCmd=Set!HVACName="
|
||||||
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
+ haldevice.haldevicename.replaceAll(" ", "%20")
|
||||||
+ "!FanMode=Auto?Token="
|
+ "!FanMode=Auto";
|
||||||
+ $scope.bridge.settings.haltoken;
|
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.haladdress.name + "-SetFan", haldevice.haldevicename + " Fan", haldevice.haladdress.name, "thermo", "halThermoSet", null, null);
|
||||||
bridgeService.buildUrls(onpayload, null, offpayload, false, haldevice.haldevicename + "-" + haldevice.halname + "-SetFan", haldevice.haldevicename + " Fan", haldevice.halname, "thermo", "halThermoSet", null, null);
|
|
||||||
$scope.device = bridgeService.state.device;
|
$scope.device = bridgeService.state.device;
|
||||||
if (!buildonly) {
|
if (!buildonly) {
|
||||||
bridgeService.editNewDevice($scope.device);
|
bridgeService.editNewDevice($scope.device);
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
<th sortable-header col="id" comparator-fn="comparatorUniqueId">ID</th>
|
<th sortable-header col="id" comparator-fn="comparatorUniqueId">ID</th>
|
||||||
<th sortable-header col="name">Name</th>
|
<th sortable-header col="name">Name</th>
|
||||||
<th sortable-header col="description">Description</th>
|
<th sortable-header col="description">Description</th>
|
||||||
|
<th sortable-header col="devicestate">Device State</th>
|
||||||
<th sortable-header col="deviceType">Type</th>
|
<th sortable-header col="deviceType">Type</th>
|
||||||
<th sortable-header col="targetDevice">Target</th>
|
<th sortable-header col="targetDevice">Target</th>
|
||||||
<th sortable-header col="inactive">Inactive</th>
|
<th sortable-header col="inactive">Inactive</th>
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
<td>{{device.id}}</td>
|
<td>{{device.id}}</td>
|
||||||
<td>{{device.name}}</td>
|
<td>{{device.name}}</td>
|
||||||
<td class="cr">{{device.description}}</td>
|
<td class="cr">{{device.description}}</td>
|
||||||
|
<td class="cr">on={{device.deviceState.on}},bri={{device.deviceState.on}},hue={{device.deviceState.hue}},sat={{device.deviceState.sat}},effect={{device.deviceState.effect}},ct={{device.deviceState.ct}},alert={{device.deviceState.alert}},colormode={{device.deviceState.colormode}},reachable={{device.deviceState.reachable}},XYList={{device.deviceState.xy}}</td>
|
||||||
<td>{{device.deviceType}}</td>
|
<td>{{device.deviceType}}</td>
|
||||||
<td>{{device.targetDevice}}</td>
|
<td>{{device.targetDevice}}</td>
|
||||||
<td>{{device.inactive}}</td>
|
<td>{{device.inactive}}</td>
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
ng-click="toggleSelection(haldevice.haldevicename)">
|
ng-click="toggleSelection(haldevice.haldevicename)">
|
||||||
{{haldevice.haldevicename}}</td>
|
{{haldevice.haldevicename}}</td>
|
||||||
<td>{{haldevice.haldevicetype}}</td>
|
<td>{{haldevice.haldevicetype}}</td>
|
||||||
<td>{{haldevice.halname}}</td>
|
<td>{{haldevice.haladdress.name}}</td>
|
||||||
<td>
|
<td>
|
||||||
<select name="button-on" id="button-on" ng-model="button_on">
|
<select name="button-on" id="button-on" ng-model="button_on">
|
||||||
<option ng-repeat="aButtonOn in haldevice.buttons.DeviceElements"
|
<option ng-repeat="aButtonOn in haldevice.buttons.DeviceElements"
|
||||||
|
|||||||
@@ -82,6 +82,12 @@
|
|||||||
ng-model="bridge.settings.upnpconfigaddress"
|
ng-model="bridge.settings.upnpconfigaddress"
|
||||||
placeholder="192.168.1.1"></td>
|
placeholder="192.168.1.1"></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Use UPNP Address Interface Only</td>
|
||||||
|
<td><input type="checkbox"
|
||||||
|
ng-model="bridge.settings.useupnpiface" ng-true-value=true
|
||||||
|
ng-false-value=false> {{bridge.settings.useupnpiface}}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Web Server IP Address</td>
|
<td>Web Server IP Address</td>
|
||||||
<td><input id="bridge-settings-webaddress"
|
<td><input id="bridge-settings-webaddress"
|
||||||
@@ -113,16 +119,20 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr ng-repeat="vera in bridge.settings.veraaddress.devices">
|
<tr ng-repeat="vera in bridge.settings.veraaddress.devices">
|
||||||
<td>{{vera.name}}</td>
|
<td><input id="bridge-settings-next-vera-name"
|
||||||
<td>{{vera.ip}}</td>
|
class="form-control" type="text" ng-model="vera.name"
|
||||||
|
placeholder="A Vera"></td>
|
||||||
|
<td><input id="bridge-settings-next-vera-ip"
|
||||||
|
class="form-control" type="text" ng-model="vera.ip"
|
||||||
|
placeholder="192.168.1.2"></td>
|
||||||
<td><button class="btn btn-danger" type="submit"
|
<td><button class="btn btn-danger" type="submit"
|
||||||
ng-click="removeVeratoSettings(vera.name, vera.ip)">Del</button></td>
|
ng-click="removeVeratoSettings(vera.name, vera.ip)">Del</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input id="bridge-settings-next-vera-name"
|
<td><input id="bridge-settings-new-vera-name"
|
||||||
class="form-control" type="text" ng-model="newveraname"
|
class="form-control" type="text" ng-model="newveraname"
|
||||||
placeholder="A Vera"></td>
|
placeholder="A Vera"></td>
|
||||||
<td><input id="bridge-settings-next-vera-ip"
|
<td><input id="bridge-settings-new-vera-ip"
|
||||||
class="form-control" type="text" ng-model="newveraip"
|
class="form-control" type="text" ng-model="newveraip"
|
||||||
placeholder="192.168.1.2"></td>
|
placeholder="192.168.1.2"></td>
|
||||||
<td><button class="btn btn-success" type="submit"
|
<td><button class="btn btn-success" type="submit"
|
||||||
@@ -143,20 +153,26 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr ng-repeat="harmony in bridge.settings.harmonyaddress.devices">
|
<tr ng-repeat="harmony in bridge.settings.harmonyaddress.devices">
|
||||||
<td>{{harmony.name}}</td>
|
<td><input id="bridge-settings-next-harmony-name"
|
||||||
<td>{{harmony.ip}}</td>
|
class="form-control" type="text" ng-model="harmony.name"
|
||||||
<td>{{harmony.webhook}}</td>
|
placeholder="A Harmony"></td>
|
||||||
|
<td><input id="bridge-settings-next-harmony-ip"
|
||||||
|
class="form-control" type="text" ng-model="harmony.ip"
|
||||||
|
placeholder="192.168.1.3"></td>
|
||||||
|
<td><input id="bridge-settings-next-harmony-webhook"
|
||||||
|
class="form-control" type="text" ng-model="harmony.webhook"
|
||||||
|
placeholder="http://hook?a=${activity.label}"></td>
|
||||||
<td><button class="btn btn-danger" type="submit"
|
<td><button class="btn btn-danger" type="submit"
|
||||||
ng-click="removeHarmonytoSettings(harmony.name, harmony.ip)">Del</button></td>
|
ng-click="removeHarmonytoSettings(harmony.name, harmony.ip)">Del</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input id="bridge-settings-next-harmony-name"
|
<td><input id="bridge-settings-new-harmony-name"
|
||||||
class="form-control" type="text" ng-model="newharmonyname"
|
class="form-control" type="text" ng-model="newharmonyname"
|
||||||
placeholder="A Harmony"></td>
|
placeholder="A Harmony"></td>
|
||||||
<td><input id="bridge-settings-next-harmony-ip"
|
<td><input id="bridge-settings-new-harmony-ip"
|
||||||
class="form-control" type="text" ng-model="newharmonyip"
|
class="form-control" type="text" ng-model="newharmonyip"
|
||||||
placeholder="192.168.1.3"></td>
|
placeholder="192.168.1.3"></td>
|
||||||
<td><input id="bridge-settings-next-harmony-webhook"
|
<td><input id="bridge-settings-new-harmony-webhook"
|
||||||
class="form-control" type="text" ng-model="newharmonywebhook"
|
class="form-control" type="text" ng-model="newharmonywebhook"
|
||||||
placeholder="http://hook?a=${activity.label}"></td>
|
placeholder="http://hook?a=${activity.label}"></td>
|
||||||
<td><button class="btn btn-success" type="submit"
|
<td><button class="btn btn-success" type="submit"
|
||||||
@@ -176,16 +192,20 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr ng-repeat="hue in bridge.settings.hueaddress.devices">
|
<tr ng-repeat="hue in bridge.settings.hueaddress.devices">
|
||||||
<td>{{hue.name}}</td>
|
<td><input id="bridge-settings-next-hue-name"
|
||||||
<td>{{hue.ip}}</td>
|
class="form-control" type="text" ng-model="hue.name"
|
||||||
|
placeholder="A Hue"></td>
|
||||||
|
<td><input id="bridge-settings-next-hue-ip"
|
||||||
|
class="form-control" type="text" ng-model="hue.ip"
|
||||||
|
placeholder="192.168.1.3"></td>
|
||||||
<td><button class="btn btn-danger" type="submit"
|
<td><button class="btn btn-danger" type="submit"
|
||||||
ng-click="removeHuetoSettings(hue.name, hue.ip)">Del</button></td>
|
ng-click="removeHuetoSettings(hue.name, hue.ip)">Del</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input id="bridge-settings-next-hue-name"
|
<td><input id="bridge-settings-new-hue-name"
|
||||||
class="form-control" type="text" ng-model="newhuename"
|
class="form-control" type="text" ng-model="newhuename"
|
||||||
placeholder="A Hue"></td>
|
placeholder="A Hue"></td>
|
||||||
<td><input id="bridge-settings-next-hue-ip"
|
<td><input id="bridge-settings-new-hue-ip"
|
||||||
class="form-control" type="text" ng-model="newhueip"
|
class="form-control" type="text" ng-model="newhueip"
|
||||||
placeholder="192.168.1.3"></td>
|
placeholder="192.168.1.3"></td>
|
||||||
<td><button class="btn btn-success" type="submit"
|
<td><button class="btn btn-success" type="submit"
|
||||||
@@ -201,34 +221,47 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>IP</th>
|
<th>IP</th>
|
||||||
|
<th>Token</th>
|
||||||
<th>Use SSL</th>
|
<th>Use SSL</th>
|
||||||
<th>Manage</th>
|
<th>Manage</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr ng-repeat="hal in bridge.settings.haladdress.devices">
|
<tr ng-repeat="hal in bridge.settings.haladdress.devices">
|
||||||
<td>{{hal.name}}</td>
|
<td><input id="bridge-settings-next-hal-name"
|
||||||
<td>{{hal.ip}}</td>
|
class="form-control" type="text" ng-model="hal.name"
|
||||||
<td>{{hal.secure}}</td>
|
placeholder="A Hal"></td>
|
||||||
|
<td><input id="bridge-settings-next-hal-ip"
|
||||||
|
class="form-control" type="text" ng-model="hal.ip"
|
||||||
|
placeholder="192.168.1.3:82"></td>
|
||||||
|
<td><input id="bridge-settings-next-haltoken" class="form-control"
|
||||||
|
type="password" ng-model="hal.password"
|
||||||
|
placeholder="thetoken"></td>
|
||||||
|
<td><input type="checkbox"
|
||||||
|
ng-model="hal.secure" ng-true-value=true
|
||||||
|
ng-false-value=false></td>
|
||||||
<td><button class="btn btn-danger" type="submit"
|
<td><button class="btn btn-danger" type="submit"
|
||||||
ng-click="removeHaltoSettings(hal.name, hal.ip)">Del</button></td>
|
ng-click="removeHaltoSettings(hal.name, hal.ip)">Del</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input id="bridge-settings-next-hal-name"
|
<td><input id="bridge-settings-new-hal-name"
|
||||||
class="form-control" type="text" ng-model="newhalname"
|
class="form-control" type="text" ng-model="newhalname"
|
||||||
placeholder="A Hal"></td>
|
placeholder="A Hal"></td>
|
||||||
<td><input id="bridge-settings-next-hal-ip"
|
<td><input id="bridge-settings-new-hal-ip"
|
||||||
class="form-control" type="text" ng-model="newhalip"
|
class="form-control" type="text" ng-model="newhalip"
|
||||||
placeholder="192.168.1.3:82"></td>
|
placeholder="192.168.1.3:82"></td>
|
||||||
|
<td><input id="bridge-settings-new-haltoken" class="form-control"
|
||||||
|
type="password" ng-model="newhaltoken"
|
||||||
|
placeholder="thetoken"></td>
|
||||||
<td><input type="checkbox"
|
<td><input type="checkbox"
|
||||||
ng-model="newhalsecure" ng-true-value=true
|
ng-model="newhalsecure" ng-true-value=true
|
||||||
ng-false-value=false></td>
|
ng-false-value=false></td>
|
||||||
<td><button class="btn btn-success" type="submit"
|
<td><button class="btn btn-success" type="submit"
|
||||||
ng-click="addHaltoSettings(newhalname, newhalip, newhalsecure)">Add</button></td>
|
ng-click="addHaltoSettings(newhalname, newhalip, newhalsecure, newhaltoken)">Add</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>HAL Token</td>
|
<td>HAL Token (please use token on individual HAL entry)</td>
|
||||||
<td><input id="bridge-settings-haltoken" class="form-control"
|
<td><input id="bridge-settings-haltoken" class="form-control"
|
||||||
type="password" ng-model="bridge.settings.haltoken"
|
type="password" ng-model="bridge.settings.haltoken"
|
||||||
placeholder="thetoken"></td>
|
placeholder="thetoken"></td>
|
||||||
@@ -247,26 +280,32 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr ng-repeat="mqtt in bridge.settings.mqttaddress.devices">
|
<tr ng-repeat="mqtt in bridge.settings.mqttaddress.devices">
|
||||||
<td>{{mqtt.name}}</td>
|
<td><input id="bridge-settings-next-mqtt-name"
|
||||||
<td>{{mqtt.ip}}</td>
|
class="form-control" type="text" ng-model="mqtt.name"
|
||||||
<td>{{mqtt.username}}</td>
|
placeholder="A MQTT Client ID"></td>
|
||||||
<td ng-if="mqtt.password">*******</td>
|
<td><input id="bridge-settings-next-mqtt-ip"
|
||||||
<td ng-if="!mqtt.password"> </td>
|
class="form-control" type="text" ng-model="mqtt.ip"
|
||||||
|
placeholder="MQTT Broker IP and port"></td>
|
||||||
|
<td><input id="bridge-settings-next-mqtt-username"
|
||||||
|
class="form-control" type="text" ng-model="mqtt.username"
|
||||||
|
placeholder="MQTT Broker username (optional)"></td>
|
||||||
|
<td><input id="bridge-settings-next-mqtt-password"
|
||||||
|
class="form-control" type="password" ng-model="mqtt.password"
|
||||||
|
placeholder="MQTT Broker password (opt)"></td>
|
||||||
<td><button class="btn btn-danger" type="submit"
|
<td><button class="btn btn-danger" type="submit"
|
||||||
ng-click="removeMQTTtoSettings(mqtt.name, mqtt.ip)">Del</button></td>
|
ng-click="removeMQTTtoSettings(mqtt.name, mqtt.ip)">Del</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input id="bridge-settings-next-mqtt-name"
|
<td><input id="bridge-settings-new-mqtt-name"
|
||||||
class="form-control" type="text" ng-model="newmqttname"
|
class="form-control" type="text" ng-model="newmqttname"
|
||||||
placeholder="A MQTT Client ID"></td>
|
placeholder="A MQTT Client ID"></td>
|
||||||
<td><input id="bridge-settings-next-mqtt-ip"
|
<td><input id="bridge-settings-new-mqtt-ip"
|
||||||
class="form-control" type="text" ng-model="newmqttip"
|
class="form-control" type="text" ng-model="newmqttip"
|
||||||
placeholder="MQTT Broker IP and port"></td>
|
placeholder="MQTT Broker IP and port"></td>
|
||||||
<td><input id="bridge-settings-next-mqtt-username"
|
<td><input id="bridge-settings-new-mqtt-username"
|
||||||
class="form-control" type="text" ng-model="newmqttusername"
|
class="form-control" type="text" ng-model="newmqttusername"
|
||||||
placeholder="MQTT Broker username (optional)"></td>
|
placeholder="MQTT Broker username (optional)"></td>
|
||||||
<td><input id="bridge-settings-next-mqtt-password"
|
<td><input id="bridge-settings-new-mqtt-password"
|
||||||
class="form-control" type="password" ng-model="newmqttpassword"
|
class="form-control" type="password" ng-model="newmqttpassword"
|
||||||
placeholder="MQTT Broker password (opt)"></td>
|
placeholder="MQTT Broker password (opt)"></td>
|
||||||
<td><button class="btn btn-success" type="submit"
|
<td><button class="btn btn-success" type="submit"
|
||||||
@@ -289,26 +328,35 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr ng-repeat="hass in bridge.settings.hassaddress.devices">
|
<tr ng-repeat="hass in bridge.settings.hassaddress.devices">
|
||||||
<td>{{hass.name}}</td>
|
<td><input id="bridge-settings-next-hass-name"
|
||||||
<td>{{hass.ip}}</td>
|
class="form-control" type="text" ng-model="hass.name"
|
||||||
<td>{{hass.port}}</td>
|
placeholder="A HomeAssistant"></td>
|
||||||
<td ng-if="hass.password">*******</td>
|
<td><input id="bridge-settings-next-hass-ip"
|
||||||
<td ng-if="!hass.password"> </td>
|
class="form-control" type="text" ng-model="hass.ip"
|
||||||
<td>{{hass.secure}}</td>
|
placeholder="192.168.1.3"></td>
|
||||||
|
<td><input id="bridge-settings-next-hass-port"
|
||||||
|
class="form-control" type="text" ng-model="hass.port"
|
||||||
|
placeholder="8123"></td>
|
||||||
|
<td><input id="bridge-settings-next-hass-password"
|
||||||
|
class="form-control" type="password" ng-model="hass.password"
|
||||||
|
placeholder="Home Assistant password (opt)"></td>
|
||||||
|
<td><input type="checkbox"
|
||||||
|
ng-model="hass.secure" ng-true-value=true
|
||||||
|
ng-false-value=false></td>
|
||||||
<td><button class="btn btn-danger" type="submit"
|
<td><button class="btn btn-danger" type="submit"
|
||||||
ng-click="removeHasstoSettings(hass.name, hass.ip)">Del</button></td>
|
ng-click="removeHasstoSettings(hass.name, hass.ip)">Del</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input id="bridge-settings-next-hass-name"
|
<td><input id="bridge-settings-new-hass-name"
|
||||||
class="form-control" type="text" ng-model="newhassname"
|
class="form-control" type="text" ng-model="newhassname"
|
||||||
placeholder="A HomeAssistant"></td>
|
placeholder="A HomeAssistant"></td>
|
||||||
<td><input id="bridge-settings-next-hass-ip"
|
<td><input id="bridge-settings-new-hass-ip"
|
||||||
class="form-control" type="text" ng-model="newhassip"
|
class="form-control" type="text" ng-model="newhassip"
|
||||||
placeholder="192.168.1.3"></td>
|
placeholder="192.168.1.3"></td>
|
||||||
<td><input id="bridge-settings-next-hass-port"
|
<td><input id="bridge-settings-new-hass-port"
|
||||||
class="form-control" type="text" ng-model="newhassport"
|
class="form-control" type="text" ng-model="newhassport"
|
||||||
placeholder="8123"></td>
|
placeholder="8123"></td>
|
||||||
<td><input id="bridge-settings-next-hass-password"
|
<td><input id="bridge-settings-new-hass-password"
|
||||||
class="form-control" type="password" ng-model="newhasspassword"
|
class="form-control" type="password" ng-model="newhasspassword"
|
||||||
placeholder="Home Assistant password (opt)"></td>
|
placeholder="Home Assistant password (opt)"></td>
|
||||||
<td><input type="checkbox"
|
<td><input type="checkbox"
|
||||||
@@ -334,29 +382,38 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr ng-repeat="domoticz in bridge.settings.domoticzaddress.devices">
|
<tr ng-repeat="domoticz in bridge.settings.domoticzaddress.devices">
|
||||||
<td>{{domoticz.name}}</td>
|
<td><input id="bridge-settings-next-domoticz-name"
|
||||||
<td>{{domoticz.ip}}</td>
|
class="form-control" type="text" ng-model="domoticz.name"
|
||||||
<td>{{domoticz.port}}</td>
|
placeholder="A Domoticz"></td>
|
||||||
<td>{{domoticz.username}}</td>
|
<td><input id="bridge-settings-next-domoticz-ip"
|
||||||
<td ng-if="domoticz.password">*******</td>
|
class="form-control" type="text" ng-model="domoticz.ip"
|
||||||
<td ng-if="!domoticz.password"> </td>
|
placeholder="192.168.1.3"></td>
|
||||||
|
<td><input id="bridge-settings-next-domoticz-port"
|
||||||
|
class="form-control" type="text" ng-model="domoticz.port"
|
||||||
|
placeholder="8080"></td>
|
||||||
|
<td><input id="bridge-settings-next-domoticz-username"
|
||||||
|
class="form-control" type="text" ng-model="domoticz.username"
|
||||||
|
placeholder="Domoticz username"></td>
|
||||||
|
<td><input id="bridge-settings-next-domoticz-password"
|
||||||
|
class="form-control" type="password" ng-model="domoticz.password"
|
||||||
|
placeholder="Domoticz password (opt)"></td>
|
||||||
<td><button class="btn btn-danger" type="submit"
|
<td><button class="btn btn-danger" type="submit"
|
||||||
ng-click="removeDomoticztoSettings(domoticz.name, domoticz.ip)">Del</button></td>
|
ng-click="removeDomoticztoSettings(domoticz.name, domoticz.ip)">Del</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input id="bridge-settings-next-domoticz-name"
|
<td><input id="bridge-settings-new-domoticz-name"
|
||||||
class="form-control" type="text" ng-model="newdomoticzname"
|
class="form-control" type="text" ng-model="newdomoticzname"
|
||||||
placeholder="A Domoticz"></td>
|
placeholder="A Domoticz"></td>
|
||||||
<td><input id="bridge-settings-next-domoticz-ip"
|
<td><input id="bridge-settings-new-domoticz-ip"
|
||||||
class="form-control" type="text" ng-model="newdomoticzip"
|
class="form-control" type="text" ng-model="newdomoticzip"
|
||||||
placeholder="192.168.1.3"></td>
|
placeholder="192.168.1.3"></td>
|
||||||
<td><input id="bridge-settings-next-domoticz-port"
|
<td><input id="bridge-settings-new-domoticz-port"
|
||||||
class="form-control" type="text" ng-model="newdomoticzport"
|
class="form-control" type="text" ng-model="newdomoticzport"
|
||||||
placeholder="8080"></td>
|
placeholder="8080"></td>
|
||||||
<td><input id="bridge-settings-next-domoticz-username"
|
<td><input id="bridge-settings-new-domoticz-username"
|
||||||
class="form-control" type="text" ng-model="newdomoticzusername"
|
class="form-control" type="text" ng-model="newdomoticzusername"
|
||||||
placeholder="Domoticz username"></td>
|
placeholder="Domoticz username"></td>
|
||||||
<td><input id="bridge-settings-next-domoticz-password"
|
<td><input id="bridge-settings-new-domoticz-password"
|
||||||
class="form-control" type="password" ng-model="newdomoticzpassword"
|
class="form-control" type="password" ng-model="newdomoticzpassword"
|
||||||
placeholder="Domoticz password (opt)"></td>
|
placeholder="Domoticz password (opt)"></td>
|
||||||
<td><button class="btn btn-success" type="submit"
|
<td><button class="btn btn-success" type="submit"
|
||||||
@@ -378,25 +435,32 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr ng-repeat="somfy in bridge.settings.somfyaddress.devices">
|
<tr ng-repeat="somfy in bridge.settings.somfyaddress.devices">
|
||||||
<td>{{somfy.name}}</td>
|
<td><input id="bridge-settings-next-somfy-name"
|
||||||
<td>{{somfy.ip}}</td>
|
class="form-control" type="text" ng-model="somfy.name"
|
||||||
<td>{{somfy.username}}</td>
|
placeholder="A Somfy"></td>
|
||||||
<td ng-if="somfy.password">*******</td>
|
<td><input id="bridge-settings-next-somfy-ip"
|
||||||
<td ng-if="!somfy.password"> </td>
|
class="form-control" type="text" ng-model="somfy.ip"
|
||||||
|
placeholder="https://www.tahomalink.com"></td>
|
||||||
|
<td><input id="bridge-settings-next-somfy-username"
|
||||||
|
class="form-control" type="text" ng-model="somfy.username"
|
||||||
|
placeholder="Somfy username"></td>
|
||||||
|
<td><input id="bridge-settings-next-somfy-password"
|
||||||
|
class="form-control" type="password" ng-model="somfy.password"
|
||||||
|
placeholder="Somfy password"></td>
|
||||||
<td><button class="btn btn-danger" type="submit"
|
<td><button class="btn btn-danger" type="submit"
|
||||||
ng-click="removeSomfytoSettings(somfy.name, somfy.ip)">Del</button></td>
|
ng-click="removeSomfytoSettings(somfy.name, somfy.ip)">Del</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input id="bridge-settings-next-somfy-name"
|
<td><input id="bridge-settings-new-somfy-name"
|
||||||
class="form-control" type="text" ng-model="newsomfyname"
|
class="form-control" type="text" ng-model="newsomfyname"
|
||||||
placeholder="A Somfy"></td>
|
placeholder="A Somfy"></td>
|
||||||
<td><input id="bridge-settings-next-somfy-ip"
|
<td><input id="bridge-settings-new-somfy-ip"
|
||||||
class="form-control" type="text" ng-model="newsomfyip"
|
class="form-control" type="text" ng-model="newsomfyip"
|
||||||
placeholder="https://www.tahomalink.com"></td>
|
placeholder="https://www.tahomalink.com"></td>
|
||||||
<td><input id="bridge-settings-next-somfy-username"
|
<td><input id="bridge-settings-new-somfy-username"
|
||||||
class="form-control" type="text" ng-model="newsomfyusername"
|
class="form-control" type="text" ng-model="newsomfyusername"
|
||||||
placeholder="Somfy username"></td>
|
placeholder="Somfy username"></td>
|
||||||
<td><input id="bridge-settings-next-somfy-password"
|
<td><input id="bridge-settings-new-somfy-password"
|
||||||
class="form-control" type="password" ng-model="newsomfypassword"
|
class="form-control" type="password" ng-model="newsomfypassword"
|
||||||
placeholder="Somfy password"></td>
|
placeholder="Somfy password"></td>
|
||||||
<td><button class="btn btn-success" type="submit"
|
<td><button class="btn btn-success" type="submit"
|
||||||
|
|||||||
Reference in New Issue
Block a user