diff --git a/README.md b/README.md index f9eb1d0..753a077 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The argument for the vera address should be given as it the system does not have The server defaults to the first available address on the host. Replace the -Dupnp.config.address=`` value with the server ipv4 address you would like to use. ### -Dserver.port=`` The server defaults to running on port 8080. If you're already running a server (like openHAB) on 8080, -Dserver.port=`` on the command line. -### -Dupnp.devices.db=`` +### -Dupnp.device.db=`` 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 -Dupnp.devices.db=`/ or ` if it is the same directory. ### -Dupnp.resonse.port=`` The upnp response port that will be used. The default is 50000. @@ -90,4 +90,9 @@ After this Tell Alexa: "Alexa, discover my devices" Then you can say "Alexa, Turn on the office light" or whatever name you have given your configured devices. -To view or remove devices that Alexa knows about, you can use the mobile app Menu / Settings / Connected Home \ No newline at end of file +To view or remove devices that Alexa knows about, you can use the mobile app Menu / Settings / Connected Home +## Debugging +To turn on debugging for the bridge, use the following extra parm in the command line: +``` +-Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG +``` \ No newline at end of file diff --git a/pom.xml b/pom.xml index 0869e31..1be264b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.bwssystems.HABridge ha-bridge - 0.4.2 + 0.4.3 jar HA Bridge diff --git a/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java b/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java index 7c47da2..bda8d30 100644 --- a/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java +++ b/src/main/java/com/bwssystems/HABridge/upnp/UpnpListener.java @@ -72,7 +72,7 @@ public class UpnpListener { DatagramPacket packet = new DatagramPacket(buf, buf.length); upnpMulticastSocket.receive(packet); String packetString = new String(packet.getData()); - if(packetString != null && packetString.startsWith("M-SEARCH * HTTP/1.1")) { + if(packetString != null && packetString.contains("M-SEARCH")) { if(traceupnp) log.info("Trace SSDP packet from " + packet.getAddress().getHostAddress() + ":" + packet.getPort() + " body : " + packetString); else @@ -99,8 +99,8 @@ public class UpnpListener { protected boolean isSSDPDiscovery(String body){ // log.debug("Check if this is a MAN ssdp-discover packet for a upnp basic device: " + body); //Only respond to discover request for upnp basic device from echo, the others are for the wemo - if(body != null && body.startsWith("M-SEARCH * HTTP/1.1") && body.contains("MAN: \"ssdp:discover\"")){ - if(strict && body.contains("ST: urn:schemas-upnp-org:device:basic:1")) + if(body != null && body.contains("M-SEARCH") && body.contains("\"ssdp:discover\"")){ + if(strict && body.startsWith("M-SEARCH * HTTP/1.1") && body.contains("MAN: \"ssdp:discover\"") && body.contains("ST: urn:schemas-upnp-org:device:basic:1")) return true; else if (!strict || vTwoCompatibility) return true; diff --git a/src/main/resources/public/index.html b/src/main/resources/public/index.html index a752c56..7f11ed0 100644 --- a/src/main/resources/public/index.html +++ b/src/main/resources/public/index.html @@ -36,7 +36,7 @@ diff --git a/src/main/resources/public/scripts/app.js b/src/main/resources/public/scripts/app.js index 0871caa..ff0a68e 100644 --- a/src/main/resources/public/scripts/app.js +++ b/src/main/resources/public/scripts/app.js @@ -252,7 +252,7 @@ app.controller('ViewingController', function ($scope, $location, bridgeService, app.controller('AddingController', function ($scope, bridgeService, BridgeSettings) { - $scope.device = {id: "", name: "", deviceType: "switch", onUrl: "", offUrl: ""}; + $scope.device = {id: "", name: "", deviceType: "switch", onUrl: "", offUrl: "", httpVerb: "", contentType: "", contentBody: ""}; $scope.vera = {base: "", port: "3480", id: ""}; $scope.vera.base = "http://" + BridgeSettings.veraaddress; bridgeService.device = $scope.device; @@ -334,6 +334,7 @@ app.controller('AddingController', function ($scope, bridgeService, BridgeSettin $scope.device.httpVerb = ""; $scope.device.contentType = ""; $scope.device.contentBody = ""; + $location.path('/'); }, function (error) { }