bwssytems / ha-bridge

Home automation bridge that emulates a Philips Hue light system and can control other systems such as a Vera, Harmony Hub, Nest, MiLight bulbs or any other system that has an http/https/tcp/udp interface. This is a compact impl to run on small format computers. This is impl started from this project https://github.com/armzilla/amazon-echo-ha-bridge.
Apache License 2.0
1.45k stars 198 forks source link

no device detection on alexa with 5.3. #1110

Closed jluc2808 closed 5 years ago

jluc2808 commented 5 years ago

i have installed on my synology DSM 6.2.2-24922 (DS918+) a docker with the last ha-bridge V5.3.0RC10, everything is running and the HA bridge server is showing all the contents expected, but i can't add them within alexa, every discover i made don't get any devices from this running (tried with my phone, or with web and all the time the same things, no devices)

i stopped this version and restart an old version v5.2.2RC3 which is running on proxmox system. Then if i start a new discover and after 3/4 run (discovering mode) all the devices are now referenced by alexa.

jluc2808 commented 5 years ago

after some test, even with trace upnp, i suspect a problem with the listener upnp of ha-bridge on my synology (perhaps port 80 ?) here is the log : Note: port 10 is the echo Dot, port 8 is my main PC 2019-07-15 07:57:01,150 [main] INFO com.bwssystems.HABridge.HABridge - HA Bridge startup sequence... 2019-07-15 07:57:01,320 [main] INFO com.bwssystems.HABridge.HABridge - HA Bridge (v5.3.0RC10) initializing.... 2019-07-15 07:57:01,331 [main] INFO com.bwssystems.HABridge.BridgeSettings - reading from config file: data/habridge.config 2019-07-15 07:57:02,350 [main] INFO spark.staticfiles.StaticFilesConfiguration - StaticResourceHandler configured with folder = /public 2019-07-15 07:57:02,369 [main] INFO com.bwssystems.HABridge.SystemControl - System control service started.... 2019-07-15 07:57:02,437 [main] INFO com.bwssystems.HABridge.util.UDPDatagramSender - Initializing UDP response Socket... 2019-07-15 07:57:02,442 [main] INFO com.bwssystems.HABridge.util.UDPDatagramSender - UDP response Socket initialized to: 50000 2019-07-15 07:57:02.443:INFO::Thread-0: Logging initialized @1788ms to org.eclipse.jetty.util.log.StdErrLog 2019-07-15 07:57:02,447 [main] INFO com.bwssystems.HABridge.plugins.http.HTTPHome - HTTP Home created. 2019-07-15 07:57:02,453 [main] INFO com.bwssystems.HABridge.plugins.harmony.HarmonyHome - Harmony Home created. 2019-07-15 07:57:02,536 [Thread-0] INFO spark.embeddedserver.jetty.EmbeddedJettyServer - == Spark has ignited ... 2019-07-15 07:57:02,536 [Thread-0] INFO spark.embeddedserver.jetty.EmbeddedJettyServer - >> Listening on IP_NAS:8080 2019-07-15 07:57:02.542:INFO:oejs.Server:Thread-0: jetty-9.4.z-SNAPSHOT, build timestamp: 2017-11-21T21:27:37Z, git hash: 82b8fb23f757335bb3329d540ce37a2a2615f0a8 2019-07-15 07:57:02.584:INFO:oejs.session:Thread-0: DefaultSessionIdManager workerName=node0 2019-07-15 07:57:02.585:INFO:oejs.session:Thread-0: No SessionScavenger set, using defaults 2019-07-15 07:57:02.590:INFO:oejs.session:Thread-0: Scavenging every 660000ms 2019-07-15 07:57:02.630:INFO:oejs.AbstractConnector:Thread-0: Started ServerConnector@40866125{HTTP/1.1,[http/1.1]}{IP_NAS:8080} 2019-07-15 07:57:02.631:INFO:oejs.Server:Thread-0: Started @1979ms 2019-07-15 07:57:02,985 [main] INFO com.bwssystems.HABridge.plugins.harmony.HarmonyServer - setup initiated .... Jul 15, 2019 7:57:03 AM com.fasterxml.jackson.databind.ext.Java7Support WARNING: Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added 2019-07-15 07:57:05,151 [main] INFO com.bwssystems.HABridge.plugins.harmony.HarmonyServer - activity changed: [-1] PowerOff 2019-07-15 07:57:05,154 [main] INFO com.bwssystems.HABridge.plugins.NestBridge.NestHome - Nest Home created. 2019-07-15 07:57:05,168 [main] INFO com.bwssystems.nest.controller.NestSession - Starting Nest login... 2019-07-15 07:57:06,793 [main] INFO com.bwssystems.nest.controller.NestSession - Completed Nest login... 2019-07-15 07:57:07,374 [main] INFO com.bwssystems.HABridge.plugins.hue.HueHome - Hue passthru Home created. 2019-07-15 07:57:07,378 [main] INFO com.bwssystems.HABridge.plugins.hal.HalHome - HAL Home created. No HAL devices configured. 2019-07-15 07:57:07,379 [main] INFO com.bwssystems.HABridge.plugins.mqtt.MQTTHome - MQTT Home created. No MQTT Clients configured. 2019-07-15 07:57:07,381 [main] INFO com.bwssystems.HABridge.plugins.hass.HassHome - HomeAssistant Home created. No HomeAssistants configured. 2019-07-15 07:57:07,383 [main] INFO com.bwssystems.HABridge.plugins.homewizard.HomeWizardHome - HomeWizard Home created. No HomeWizard gateways configured. 2019-07-15 07:57:07,384 [main] INFO com.bwssystems.HABridge.plugins.exec.CommandHome - Command Home for system program execution created. 2019-07-15 07:57:07,386 [main] INFO com.bwssystems.HABridge.plugins.tcp.TCPHome - TCP Home created. 2019-07-15 07:57:07,387 [main] INFO com.bwssystems.HABridge.plugins.udp.UDPHome - UDP Home created. 2019-07-15 07:57:07,389 [main] INFO com.bwssystems.HABridge.plugins.vera.VeraHome - Vera Home created. No Veras configured. 2019-07-15 07:57:07,390 [main] INFO com.bwssystems.HABridge.plugins.fibaro.FibaroHome - Fibaro Home created. No Fibaros configured. 2019-07-15 07:57:07,392 [main] INFO com.bwssystems.HABridge.plugins.domoticz.DomoticzHome - Domoticz Home created. 2019-07-15 07:57:07,395 [main] INFO com.bwssystems.HABridge.plugins.somfy.SomfyHome - Somfy Home created. 2019-07-15 07:57:07,399 [main] INFO com.bwssystems.HABridge.plugins.lifx.LifxHome - LifxDevice Home created. No LifxDevices configured. 2019-07-15 07:57:07,401 [main] INFO com.bwssystems.HABridge.plugins.openhab.OpenHABHome - OpenHAB Home created. No OpenHABs configured. 2019-07-15 07:57:07,403 [main] INFO com.bwssystems.HABridge.plugins.fhem.FHEMHome - FHEM Home created. No FHEMs configured. 2019-07-15 07:57:07,407 [main] INFO com.bwssystems.HABridge.plugins.broadlink.BroadlinkHome - Broadlink Home created. No Broadlinks configured. 2019-07-15 07:57:07,409 [main] INFO com.bwssystems.HABridge.plugins.moziot.MozIotHome - Mozilla IOT Home created. No Mozilla IOTs configured. 2019-07-15 07:57:07,411 [main] INFO com.bwssystems.HABridge.plugins.homegenie.HomeGenieHome - HomeGenie Home created. No HomeGenies configured. 2019-07-15 07:57:07,435 [main] WARN com.bwssystems.HABridge.dao.GroupRepository - Error reading the file: data/group.db - Does not exist or is not readable. continuing... 2019-07-15 07:57:07,435 [main] INFO com.bwssystems.HABridge.devicemanagmeent.DeviceResource - HABridge device management service started.... 2019-07-15 07:57:07,484 [main] INFO com.bwssystems.HABridge.hue.HueMulator - Hue emulator service started.... 2019-07-15 07:57:07,542 [main] INFO com.bwssystems.HABridge.HABridge - Traceupnp: upnp config address: IP_NAS -useIface: false on web server: IP_NAS:8080 2019-07-15 07:57:07,544 [main] INFO com.bwssystems.HABridge.upnp.UpnpSettingsResource - Description xml service started.... 2019-07-15 07:57:07,553 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - UPNP Discovery Listener starting.... 2019-07-15 07:57:07,554 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: Interface: docker0 valid usable IP address: /xxxxxxx 2019-07-15 07:57:07,554 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: Adding docker0 to our upnp join interface set. 2019-07-15 07:57:07,554 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: Interface: ovs_eth1 valid usable IP address: /IP_NAS 2019-07-15 07:57:07,554 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: Adding ovs_eth1 to our upnp join interface set. 2019-07-15 07:57:07,555 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: Interface: ovs_eth0 valid usable IP address: /xxxxxxxx 2019-07-15 07:57:07,555 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: Adding ovs_eth0 to our upnp join interface set. 2019-07-15 07:57:07,555 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: Interface: lo valid usable IP address: /127.0.0.1 2019-07-15 07:57:07,555 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: Adding lo to our upnp join interface set. 2019-07-15 07:57:07,555 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Create and run mDNS service. 2019-07-15 07:57:07,595 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - UPNP Discovery Listener running and ready.... 2019-07-15 07:58:11,270 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: SSDP M-SEARCH packet from IP_MAIN_PC:57722 2019-07-15 07:58:11,921 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 1 with response address: IP_NAS:8080 to address: /IP_MAIN_PC:57722 2019-07-15 07:58:12,086 [qtp890228751-13] INFO com.bwssystems.HABridge.upnp.UpnpSettingsResource - Traceupnp: request of description.xml from: IP_MAIN_PC:8080 filled in with address: IP_NAS:8080 2019-07-15 07:58:12,572 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 2 with response address: IP_NAS:8080 to address: /IP_MAIN_PC:57722 2019-07-15 07:58:12,658 [qtp890228751-17] INFO com.bwssystems.HABridge.upnp.UpnpSettingsResource - Traceupnp: request of description.xml from: IP_MAIN_PC:8080 filled in with address: IP_NAS:8080 2019-07-15 07:58:13,223 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 3 with response address: IP_NAS:8080 to address: /IP_MAIN_PC:57722 2019-07-15 07:58:14,264 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: SSDP M-SEARCH packet from IP_MAIN_PC:57722 2019-07-15 07:58:14,915 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 1 with response address: IP_NAS:8080 to address: /IP_MAIN_PC:57722 2019-07-15 07:58:15,566 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 2 with response address: IP_NAS:8080 to address: /IP_MAIN_PC:57722 2019-07-15 07:58:16,217 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 3 with response address: IP_NAS:8080 to address: /IP_MAIN_PC:57722 2019-07-15 07:58:17,274 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: SSDP M-SEARCH packet from IP_MAIN_PC:57722 2019-07-15 07:58:17,925 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 1 with response address: IP_NAS:8080 to address: /IP_MAIN_PC:57722 2019-07-15 07:58:18,576 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 2 with response address: IP_NAS:8080 to address: /IP_MAIN_PC:57722 2019-07-15 07:58:19,227 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 3 with response address: IP_NAS:8080 to address: /IP_MAIN_PC:57722 2019-07-15 07:59:23,029 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: SSDP M-SEARCH packet from IP_ECHO_DOT:50000 2019-07-15 07:59:23,680 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 1 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:23,692 [qtp890228751-19] INFO com.bwssystems.HABridge.upnp.UpnpSettingsResource - Traceupnp: request of description.xml from: IP_ECHO_DOT:8080 filled in with address: IP_NAS:8080 2019-07-15 07:59:24,331 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 2 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:24,982 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 3 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:24,982 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: SSDP M-SEARCH packet from IP_ECHO_DOT:50000 2019-07-15 07:59:25,633 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 1 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:26,284 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 2 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:26,935 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 3 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:26,935 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: SSDP M-SEARCH packet from IP_ECHO_DOT:50000 2019-07-15 07:59:27,586 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 1 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:28,237 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 2 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:28,888 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 3 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:28,888 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: SSDP M-SEARCH packet from IP_ECHO_DOT:50000 2019-07-15 07:59:29,539 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 1 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:30,190 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 2 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:30,841 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 3 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:30,841 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: SSDP M-SEARCH packet from IP_ECHO_DOT:50000 2019-07-15 07:59:31,492 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 1 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:32,143 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 2 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:32,793 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 3 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:32,794 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: SSDP M-SEARCH packet from IP_ECHO_DOT:50000 2019-07-15 07:59:33,445 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 1 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:34,096 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 2 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000 2019-07-15 07:59:34,747 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: send upnp discovery template 3 with response address: IP_NAS:8080 to address: /IP_ECHO_DOT:50000

bwssytems commented 5 years ago

It looks like the /IP_ECHO_DOT has send an SSDP UPNP message, but the /IP_ECHO_DOT does not call the IP_NAS:8080 back to get the desciption.xml or call to get the lights from the ha-bridge. This is probably a routing issue from the echo to the NAS running Docker. I am not the docker expert so you'll need to ask some others. Also, these issues have been reported and resolved previously. Search through the closed items and also at https://github.com/aptalca/docker-ha-bridge

jluc2808 commented 5 years ago

OK i found the problem and the solution

I find a solution to change this default settings (DSM) which is reversible using this [http://tonylawrence.com/posts/unix/synology/freeing-port-80/] Note : ha-bridge docker has been already installed with https://github.com/aptalca/docker-ha-bridge 1 - connect to DSM with SSH 2 - cd /usr/syno/share/nginx (find the folder) 3 - ls (ensure you are with xx.mustache file) 4 - sudo nano server.mustache DSM.mustache WWWService.mustache (edit the 3 files with root access) 5 - find port 80 and change all references to by example 82 (ensure this port is not already used by another service) 6 - CTLo, (to write), CTLx (to exit) 7 - within DSM (user GUI) open configuration / network / general 8 - change something (by example) the server name (you could double change to get back to the original name) and each time don't forget to apply 9 - test the redirection port 82 : http://synology_IP:82 should redirect to port 5000

At this step port 80 is free (stop all the other package that could use port 80 - photostation, .....)

10 - go to docker and stop ha-bridge 11 - select the ha-bridge-package and hit modify tag 12 - go to environment tag and change the port (by default 8080 or any other port you have already entered) to port 80 > apply 12bis - at this step you are able to set the right local hour to your docker, to do inside environment tag add a new variable > name: TZ, contents: Europe/Paris (or your main city London, Amsterdam, ....) > Apply 13 - restart the docker image ha-bridge 14 - connect to ha-bridge UI : http://synology_IP:80

At this step you should get your previous config and could access to all the parameters, port 80 is now assigned to HA-bridge and you are able to discover devices with alexa (but it's not the case)

15 - with ha-bridge control > security settings > enable links : Use Link Button (or if already disable then renable) 16 - hit the link and then try a discover from alexa (i tried with the web UI and i got the devices)

NOW it is complete and you can play with.

jluc2808 commented 5 years ago

i will close this issue, because it's a limitation with echo-dot gen3 and a way to workaround with synology

So nothing to fix thanks jean-luc