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 199 forks source link

Alexa suddenly started saying "device not responding" #1125

Open octoplayer2 opened 5 years ago

octoplayer2 commented 5 years ago

HA bridge has been working perfectly for years+, V4.5.5 on a Rasp PI. Last night it suddenly stopped responding to voice requests, Alexa says for any device that "the device is not responding". I "forgot" all devices on Alexa, and rediscovered them, so that is talking to the HA Bridge. I can control devices from the test buttons on HA bridge, so that is working. I have restarted the router, Alexa, and PI, but still get the problem.

There was a warning in the Bridge log about the UPNP IP not having a valid device on it - spurious as the IP was correct and for the PI that Bridge is running on. I reset value to 0000, reinitialised and it has updated back to the same IP, but without the error in the log this time.

The only thing that changed on the network was that I added a new HP wifi printer to the network yesterday, but the IP for that is correct, and it is turned off. I cannot see any changes in the router that that could have made.

Any suggestions welcome...

morgi23 commented 5 years ago

Hi, How do I change the bridge port from 8080 to 80? I’m using latest Ha Bridge 5.3.0 on a raspberry pi. Thanks!

bwssytems commented 5 years ago

https://github.com/bwssytems/ha-bridge/blob/master/README.md

morgi23 commented 5 years ago

Changing to port 80 from “Bridge control” tab is not working for me. It keeps going back to port 8080. I might doing something wrong here...

quadhammer commented 5 years ago

Changing to port 80 from “Bridge control” tab is not working for me. It keeps going back to port 8080. I might doing something wrong here...

Same here. Try stopping the server and starting it with the -Dserver.port argument instead. In Windows the .bat file looks something like this: @echo off cd c:\echobridge java -jar -Dserver.port=80 "C:\echobridge\ha-bridge-5.3.0.jar" exit

The readme.md above will have more info.

icibt commented 5 years ago

I faced the same issue. First thing I did was I changed the port to 80 but to no avail. After that I switched the logging level to DEBUG and actually saw that Alexa was actually trying to add new user (weird?) but was hitting an error "user add toContinue was false, returning not authorized" in the HueMulator.java class. There were some if conditional statements in this class and they had something to do with the Use Link Button. So I set the Bridge Control -> Update Security Settings -> Use Link Button to false, Updated the settings and Alexa immediately found all the devices. So you might try that.

TL;DR; Try setting Use Link Button to false in Bridge Control -> Update Security Settings -> Use Link Button

I am using (Ha-Bridge 5.1.0)

gohamstergo commented 5 years ago

Wiped all devices from my Echo and tried without link button. no joy. no log activity from my dot in the debug logs either.

morgi23 commented 5 years ago

Ok, managed to solve this problem. What worked for me was to change port 8080 to port 80. Instructions for newbies like me:

  1. Install Putty
  2. SSH into the raspberry pi (you need to enter the the IP address of the raspberry pi)
  3. Enter user name and password
  4. Enter this command: sudo nano /etc/systemd/system/habridge.service
  5. Edit the file : change port 8080 to 80, and press ctrl-X, then Y.
  6. Enter this command: sudo nano /home/pi/habridge/data/habridge.config
  7. Edit the file : change port 8080 to 80, and press ctrl-X, then Y.

Done :) It worked for me without rediscover the devices, but if it doesn't work, try to forget and rediscover all alexa devices from the alexa app.

gohamstergo commented 5 years ago

The issue for most people is that they can't use port 80. It's why we weren't using it to begin with as other services are already using it.

morgi23 commented 5 years ago

The issue for most people is that they can't use port 80. It's why we weren't using it to begin with as other services are already using it.

What kind of services?

mcwieger commented 5 years ago

For Synology users services like Photo Station. Issue for me is that I've seen fragmented tips and hints to create or update files with certain info to run a reverse proxy, but no step-by-step guide. I mean, I can update a file by pasting text in it, but no one has been able to say which file and/or where they are located. I lack the Apache/Nginx knowledge to know where everything is located (plus it seems that on every version of Linux config files are located in different places).

gohamstergo commented 5 years ago

What kind of services?

read the other comments

GitDev28 commented 5 years ago

HAB: 5.3.0 on RPi 3b with Stretch (Linux raspberrypi 4.14.98-v7+)

In my case, replacing jetty's port to 80, renumbering the devices in HA Bridge, forgetting all devices and discovering again didn't help much. After enabling and checking the log, I saw that they call made by alexa is not with the right ID. For example, a call to device ID 122 provides these logs:

2019-10-04 04:56:11,351 [qtp6470313-72] INFO  com.bwssystems.HABridge.hue.HueMulator - Tracestate: hue state change requested: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx from 192.168.x.xx body: {"on":true}
2019-10-04 04:56:11,353 [qtp6470313-72] WARN  com.bwssystems.HABridge.hue.HueMulator - Could not find device: 14 for hue state change request: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx from 192.168.x.xx body: {"on":true}

2019-10-04 04:57:22,421 [qtp6470313-70] INFO  com.bwssystems.HABridge.hue.HueMulator - Tracestate: hue state change requested: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx from 192.168.x.xx body: {"on":false}
2019-10-04 04:57:22,422 [qtp6470313-70] WARN  com.bwssystems.HABridge.hue.HueMulator - Could not find device: 14 for hue state change request: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx from 192.168.x.xx body: {"on":false}

This is the old ID (i.e. 14). The only solution I have is to call each devices via Alexa to trigger an entry in the log and note the old ID, and then replace them in the ./habridge/data/devices.db By doing so, it works as before except that some of the "switches" I have created are not found by Alexa... Progressing slowly to put everything back up again.

heffneil commented 5 years ago

Man this is odd. There is trouble here for some strange reason. I mean between this and the port 80 thing tack on the inability for many of us to add new devices it sounds like we should be nervous. I don't want to forget devices and pray I don't have problems communicating with what I have.... Fingers crossed this gets better or figured out soon!

e-bits commented 5 years ago

Hi, i'm facing exactly the same issue on my side. Running ha-bridge on Synology NAS. I try to connect the HUE App to ha-bridge. This is only working if i'm running on Port 80. HUE App can find the Bridge and i can successfully add the emulated devices. If i try the same running on Port 8080 this won't work.

So my question is this issue really related to an Alexa Firmware upgrade? Because if HUE App can't find the ha-bridge running on Port 8080 I guess Alexa can't find the devices either.

I'm pretty new to ha-bridge and probably I'm mixing things up. However, I would be interested to hear your opinion.

Thanks. Cheers e-bits

bwssytems commented 5 years ago

Make sure you have read all about the networking routes for your synology. Also, if you are using docker, there are even more things you will need to do. Search the issues here.

Dr-know commented 4 years ago

Make sure you have read all about the networking routes for your synology. Also, if you are using docker, there are even more things you will need to do. Search the issues here.

Alexa not finding devices on my HA-bridge running in docker image on Synoloy ! I can not change HA-bridge to port 80 --> this is thi gui port for Synology and they do not let me change it ..

Where is this "networking routes for synology with docker" ??

Ps, are there plans to also include a sonos api helper ? like Fibaro and Harmony ? i no users a other docker image for this sonos API ..

jimkernsjr commented 4 years ago

Hi All... First a couple points to the noobs: Your ISP blocking port 80 has NOTHING to do with ANYTHING here. YOU DO NOT FORWARD ports to the WAN (Internet) to use this software! When I see comments like "my ISP blocks 80" and thumbs up on that comment I have concern. My response is good - it's protecting you from yourself. The port forwarding comes into play when you are running this in a docker or VM and have other services running on that port on the host machine. It does NOT mean forwarding 80 to the internet. Please read the readme more carefully, and please understand what you are doing when you forward ports to the internet before your expose your NAS or other device to attack.

Also the windows hosts file (or linux for that matter), has nothing to do with ports! It's for host name to IP recognition only. Tinkering with the hosts will NOT do anything to help with this software - it doesn't work by hostname.

That being said, this software must be EXPOSED to the LAN on 80 (not necessarily ran on 80)for it to work reliably with any echo device >gen 2 - there are several methods to accomplish that. If you are new and you really dont know how to forward ports to VM's/Docker/etc, a quick fix can be to run the software on a Raspberry Pi (DO NOT install Apache/Web server). Even a $10 Pi Zero works it seems.

I've also been having a similar problem with "not responding", yet it still works. If I ask to turn on the lights, it does, then says after a couple seconds "not responding". Other times it says "OK". I'm on 5.3.0. Anyone else run into this? Is there a timeout somewhere?
I killed all devices and rediscovered - nothing.

jimkernsjr commented 4 years ago

Update OFF works ok, but ON gives "blah blah blah" appears to be malfunctioning. Of course there is no difference pressing OFF and ON on the web GUI - both respond promptly as successful. So somehow between the bridge and Alexa, there seems to be a wierd issue. Turning logs to DEBUG doesnt cause anything to jump out at me.

audiofreak9 commented 4 years ago

@jimkernsjr thanks for taking the time to explain the incorrect assumptions, I couldn’t get past my facepalm to reply.

All, Phillips Hue uses port 80, Amazon is aligning with Phillips Hue. This is also why the official HUE apps won’t discover your bridges that don’t use port 80. I doubt Amazon will undo this software change.

Shinjo01x commented 4 years ago

Even if this thread is old, I ll try my luck.

My habridge was working fine on 8080 until i Need to reinstall ist yesterday. I ve tried everything, but cant get alexa find any devices. I guess ist caused to the port change and I Need to use port 80. But I rund my Bridge on a synology nas, so cant use port 80.

Does anyone have a solution? and can maybe guide me to get it work again?

bwssytems commented 3 years ago

PLease try the new RC4 release

Kammi61871 commented 3 years ago

on pi's u can add a new ip on your network adapter works on eth0 and wlan0

sudo ifconfig wlan0:0 192.168.0.144 netmask 255.255.255.255

so u can make multiple port 80 on 1 device

output sudo ifconfig

pi@raspberrypi:~ $ sudo ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b8:27:eb:56:14:30  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 10684825  bytes 3200716939 (2.9 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10684825  bytes 3200716939 (2.9 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.142  netmask 255.255.255.0  broadcast 192.168.0.255
        ether b8:27:eb:03:41:65  txqueuelen 1000  (Ethernet)
        RX packets 1202003  bytes 170234753 (162.3 MiB)
        RX errors 0  dropped 58321  overruns 0  frame 0
        TX packets 1584269  bytes 389475184 (371.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.144  netmask 255.255.255.255  broadcast 192.168.0.255
        ether b8:27:eb:03:41:65  txqueuelen 1000  (Ethernet)

wlan0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.146  netmask 255.255.255.255  broadcast 192.168.0.255
        ether b8:27:eb:03:41:65  txqueuelen 1000  (Ethernet)

wlan0:2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.148  netmask 255.255.255.255  broadcast 192.168.0.255
        ether b8:27:eb:03:41:65  txqueuelen 1000  (Ethernet)

wlan0:3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.186  netmask 255.255.255.255  broadcast 192.168.0.255
        ether b8:27:eb:03:41:65  txqueuelen 1000  (Ethernet)

wlan0:4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.150  netmask 255.255.255.255  broadcast 192.168.0.255
        ether b8:27:eb:03:41:65  txqueuelen 1000  (Ethernet)

but the problem is not solved alexa find devices but saying not respondig bridge version v5.4.0

what have i done

update to v5.4.0 renumber devices let alexa search for new devices she found 11 devices but all not responding

the test links in bridge on/off works perfect

FIXED works again

https://github.com/bwssytems/ha-bridge/issues/1283