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

ha bridge down, alexa still discovering devices #1143

Open pojomojo1982 opened 5 years ago

pojomojo1982 commented 5 years ago

I cleaned up devices on ha-bridge, had naming convention issues.

I then did a renumber devices to assign fresh IDs to all devices.

I went to the Alexa webpages and did a "forget all devices" and reran discovery. However, running discovery brought the old names back and now Alexa is pointing to the wrong device (turn on desk lights actually turns on some other lights).

The old devices just kept coming back pointing to the incorrect IDs.

I shutdown Ha-bridge, did "Forget All", and reran discovery....and the devices STILL show up even though ha-bridge is down.

I have an actual hue bridge on my network and thought that might be somehow causing the issue even though devices in question not listed on that hue bridge. Disconnected real hue from network but devices still keep coming back....

Does "Forget All" option on Alexa webpage not work? Where is Alexa getting the device information if ha-bridge is down?

Please help.

audiofreak9 commented 5 years ago

I have found the forget all to not work either. It's tedious, but forget each device individually and try again.

pojomojo1982 commented 5 years ago

@audiofreak9 Just tried that approach. Didn't work. Forgot each device individually. Reran discovery without ha-bridge running. Devices still came back.

There must be a cache or something....don't know where Alexa is getting the device information from. HA-Bridge definitely not running on network.

Any other ideas?

audiofreak9 commented 5 years ago

Do you possibly have a second ha-bridge running? It happens when one isn’t stopped and you manually start another. Short, have you restarted your RPi?

pojomojo1982 commented 5 years ago

I was thinking the same thing but don't have any other instance running that I can find. I have a used PC on that I use to run HA-Bridge....I scanned that PC for any java processes running and didn't find any. It wouldn't be possible to start a second instance because the port would also already be in use.

I have rebooted the PC already too.

I even turned off all PCs in the house and Alexa still finds the devices.

quadhammer commented 5 years ago

I'm getting duplicate devices again, despite it being fixed for a while by forgetting each device individually.

'Forget All' didn't work, but now neither does the other method.

pojomojo1982 commented 5 years ago

So here's what finally worked for me:

It was painful with over a 100+ devices but slowly the number of devices being discovered started to go down....the number of devices discovered would go up every now and then but slowly worked myself down to 0 until running discovery consistently resulted in no devices being found.

Did all of above using the Alexa web app on a PC.

Booted up ha-bridge and ran discovery again. Got my newly named devices without duplicates. Devices show up as dimmable lights now instead of it saying Royal something...

No duplicates yet for the past hour. Fingers crossed.

quadhammer commented 5 years ago

What port is discovery on, so that when we eventually get lucky and get the right no., we can block it from re-discovering?

https://community.getvera.com/t/bridge-amazon-echo-to-vera-on-github/187039/2031 says that outbound UDP 1900 and 50000 are the ones to try...

pojomojo1982 commented 5 years ago

I updated the security settings in ha-bridge to require "Use Link Button"....this is supposed to only allow pairing with ha-bridge when you press the Link button. I'm hoping this is akin to ha-bridge not responding to upnp requests unless the link button is pressed. If pressed pairing is enabled for 30 seconds. First time I'm using this setting so not sure if it will work.

Corremans commented 4 years ago

Had the same issue.

I could sort it out by: -adding the devices I wanted to HA-bridge. -shutdown HA-bridge -copy the data folder to another place -deleted all alexa devices individually -started HA-bridge ( without any devices) -discovery with alexa > nothing found -shutdown Ha-bridge -copied the data folder with the devices back to the correct destination. -started HA-bridge. -Alexa discover > all new devices were found.

Hope this helps and also a thank you to the developer for making this programm! Cor

SchmuFoo commented 3 years ago

So here's what finally worked for me:

  • delete 2-3 devices together individually
  • taking the time to click "X" on the dialog box that pops up saying Device forgot successfully.....this seemed like an important step and actually made a difference. Could be purely coincidental.
  • Running Discover devices between each batch delete of 2-3 devices .. No duplicates yet for the past hour. Fingers crossed.

Unfortunatelly that trick with https://alexa.amazon.de/spa/index.html?#appliances didn't work for me (this time), I still get HA-Bridge devices, even when I have removed the HA-Bridge from the network days before.

I found this on an AmazonHelpForum, but IMHO this is only relevant for Devices which are managed with an Alexa Smart Home Skill, (@bwssytems ?)

"When each device is setup via the manufacturer's app, there is a fingerprint of that device stored in the cloud. The device must be active when deleting it so that the cloud service can see it and delete the fingerprint, thus deleting the device from the cloud.

If you deleted devices from the app while disconnected, you will have to contact the device manufactures support for them to delete them from the cloud. If not, it will keep passing the info to Alexa that it still exists.

"The device manufacturer creates the fingerprint (mac address) and the info is fed to Alexa via the api."

(https://www.amazonforum.com/s/question/0D54P00006zSyeDSAS/alexa-discovering-smart-devices-from-cache)