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

Amazon Echo still not recognize 5.4.0 #1270

Open Jean-Mercier opened 3 years ago

Jean-Mercier commented 3 years ago

Hello Thanks for the release

My device still not recognize by amazon echo. i try :

delete all on amazon side delete all device on ha-bridge side change upnp send delay renumber device

but amazon still not find any device (i have 3 different amazon echo, echo spot, echo dot)

i use a tplink router and upnp is available. habridge run on docker on synology

I don't find the problem.

my conf image

image

thanks

sonypsx commented 3 years ago

@npaisnel: Logoff of a alexa isn't that rude. You can do it from your mobile in the alexa app -> go to devices -> click on one of your alexas -> go pretty down to the bottom -> logoff Repeat that with every alexa. All your skills will stay intact as your mobile will stay online (don't log it off) as a alexa. Good Luck!

npaisnel commented 3 years ago

the only think that did not stay in tact was one of the Alexa devices...becaues i put my bloody fist though it and kicked it across the room.

No, removing them form the account did not help with the Devices discovery and then it is impossible to get them back in to setup mode again..No amount of pressing the buttons to get it back it to set up mode works..

They just refuse to go back to the rotating orange light . One of them now will never work again ...

Time I went to bed, before I have none left .

sonypsx commented 3 years ago

@npaisnel i cant't stop laughing and imagine you doind that: kicking Alexa through the room -> what did she said? "Kick it like Beckham?" ;) Which Generation do you have? i have 1. 2. and 4 -> did reset all of them and put them back in (without kicking them)

trpster commented 3 years ago

I'll admit that I have nothing more than anecdotal evidence to support my belief that the problems getting Alexa to recognize and properly control ha-bridge devices is due to some type of cache that Amazon maintains. My experience has shown no relationship between the number of echo dots and shows that I have (a lot) and the problems with the Alexa app showing multiple identical devices and deeming them "unresponsive." When they suddenly became unresponsive and I was unable to make any progress figuring out why, I finally decided that since ha-bridge once worked fine, I would go back to square 1. This wasn't simple, but only because I didn't realize what was involved in getting back to square 1; not as simple as just installing the latest version of ha-bridge (5.4.0?). I installed it on a different r-pi, but didn't totally kill it on the r-pi it had been running on. For those who don't want to go to that trouble, you might want to rethink; bwssytem's latest read.me is very straightforward and easy to follow. Once I did the "discover-delete repeat" process until the Alexa app showed no ha-bridge devices, I restored the devices that I had previously backed up, then "discover" found them all, and they all worked fine.
Now, of course, I'm afraid to make any changes until I have a backup plan. All of my devices are MQTT controlled, and I think I can write an app for my phone to individually control specific devices to override the Python program that automatically controls them. If my wife can't walk into the dining room and say, "Alexa, turn on the fireplace" all is not well around here. Having to launch an app and press a button or say "Turn on the fireplace" isn't as simple as having Alexa do it, but isn't stone age either. Hopefully someone will figure out what is happening and we'll be able to keep our wives happy; in the meantime... I'll not be adding or changing any devices.

Jean-Mercier commented 3 years ago

i didn't find any way to make ha bridge working again ....

i think i will stop using this solution and turn me on jeedom plugin for alexa (I will prefer stay on local exécution and not with a paid function on cloud provider but Ha bridge is broke for me and i need my wife happy ;)

Thanks for your help i will test again

sonypsx commented 3 years ago

@Jean-Mercier: Just to be curious: are your devices working when you click the test button on the habridge? I had that issue twice and i got a 404 directly out of the habridge. A full restart of my raspi did solve it.

Br sonypsx

Jean-Mercier commented 3 years ago

Yes it s works

And i delete all device create juste one with renumber but still have no device recognize from alexa

npaisnel commented 3 years ago

I think I too the same as Jean, have to go find a new solution. I have deleted all, renumbered, turned uPNO On/ off, renumbered devices, changed upnp delay both up and down,

Nothing..... same as Jean, pressing the Test Buttons on the WebGUI work fine. Just Alexa no longer discovers old or new devices

removed all three Alexa devices, and tried discovery from Alexa iPhone app..

Complete re-instal on a new RaspPi SD card maybe next option.

sonypsx commented 3 years ago

Really strange guys ... Which Linux are you running? Mine: root@raspberrypi:~# uname -a Linux raspberrypi 5.4.79+ #1373 Mon Nov 23 13:18:15 GMT 2020 armv6l GNU/Linux root@raspberrypi:~# cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" root@raspberrypi:~#

Something must be common between Jean-Mercier and npaisnel. An old release somewhere, a setting, a patch/update - simply something.

Another test: backup your habridge, set everything to stock, check if the UPNP IP in the bridge settings is the same as it should (eth0, or your wlan IP) delete all devices, create one new a simply one e.g. launch a linux cmd which write something to a file so you know it works or not

Does this work?

npaisnel commented 3 years ago

Linux x10 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l

pi@x10:~ $ uname -a Linux x10 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux

pi@x10:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)" NAME="Raspbian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" pi@x10:~ $

npaisnel commented 3 years ago

What should the upnp up setting be ? Your router .. so in my case 192.168.1.1

or an Alexa device Or the RaspberryPi Device ?

I have not manually set or changed it, and it previously was working fine for two years.

the webgui test on/ test off buttons work

If I type heyu on a1 or other commands at the command line, they all work just fine heyu nightly scheduled scripts and macros / timers continue to run every night.

Just Alexa discovery not workibg

Jean-Mercier commented 3 years ago

Really strange guys ... Which Linux are you running?

i run on a synology nas with docker Linux linuxserver-habridge1 3.10.105 #24922 SMP Fri May 10 03:00:19 CST 2019 x86_64 GNU/Linux from linuxserver image : https://hub.docker.com/layers/linuxserver/habridge/version-v5.4.0/images/sha256-f6ddb8dc5511d11ac6d1d56267b84d15321c8ff01cc336238c9ac1ac40d98917?context=explore

i'm with ip adresse in 10.0.0.0/16 CIDR

Jean-Mercier commented 3 years ago

i run on a synology nas with docker Linux linuxserver-habridge1 3.10.105 #24922 SMP Fri May 10 03:00:19 CST 2019 x86_64 GNU/Linux

hmmm it's strange this version because on dockerfile they put LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"

so it mean my image is from 10 may 2019 but i have the good version of ha-bridge 5.4.0....

i will try to delete all config conaitner registry all and test again

npaisnel commented 3 years ago

Another test: backup your habridge, set everything to stock, check if the UPNP IP in the bridge settings is the same as it should (eth0, or your wlan IP) delete all devices, create one new a simply one e.g. launch a linux cmd which write something to a file so you know it works or not

Does this work?

How do I Set everything to stock ? is there a retore defautls button? What shoudl the UPNP IP address be set to ? the Raspeberry Pi HA-Bridge device or the router or Alexa? Currently on the HA-Bridge device

sonypsx commented 3 years ago

Hello, the UPNP IP is the IP of the interface of your raspi which is connected to your network. Or in case for @Jean-Mercier its the IP of your NAS, not 100% sure with that docker image. @Jean-Mercier: i would not register all of your devices, i would create just ONE device in ha bridge for testing and see if it works.

Stock settings: Stop your ha-bridge, go to the directory where it is installed, there is a data directory - backup the files which are in that directory or simply rename the data directory and start ha-bridge again. directory and stock settings are created.

npaisnel commented 3 years ago

Hey

it worked No idea what setting it was but renaming the /habridge data/ directory to databkp and rebooting the system worked Alexa now discovered a newley created device.

Better still...I then did a move of the old devices.db file from the databkp folder to the data folder and did a 'reinitialise' from the WebGUI

Al the old devices re appeared..adn Alexa discovered them...

So for me..for now Problem dissolved.

@Jean-Mercier Try doing that .
Command line and

mv data databkp

then reboot

t Create a new device just to check Alexa is workmen and this fix works for you

Then if it does move your old device database back sudo mv device.db ~/habridge/data/device.db or what ever you path is

sonypsx commented 3 years ago

YEAHHHH! congrats! I am happy to hear that! So i guess some weird parameter in habridge.config did cause your problems ....

trpster commented 3 years ago

That's terrific news, and also explains why my stuff started working after I installed ha-bridge from scratch on a different r-pi. Now the question is (for future problems) what in habridge.config got screwed up? If I hadn't already spent so much time already I'd investigate... maybe someone else will be more adventurous.

npaisnel commented 3 years ago

I will copy and post BOTH HABRIDGE config files and maybe some one better than me can find the clue

going to be difficult I guess... as it has been fiddled with to try and get it working... and it was working with what should have been standard default config before

npaisnel commented 3 years ago

OK, so here are the two habridge.config files old not workgin one first

There are some differences, but they are only changes I have made AFTER the fault occured.

The two differences are Securtiy data and the Hue Address line is an extra in the old version.

Old one first

{"upnpconfigaddress":"192.168.1.49" "useupnpiface":false "userooms":false "serverport":80 "upnpresponseport":50000 "upnpdevicedb":"data/device.db" "upnpgroupdb":"data/group.db" "buttonsleep":100 "traceupnp":true "farenheit":true "configfile":"/home/pi/habridge/data/habridge.config" "numberoflogmessages":512 "hueaddress":{"devices":[]} "myechourl":"alexa.amazon.com/spa/index.html#cards" "webaddress":"0.0.0.0" "hubversion":"1" "securityData":"Qd29J/vcDO5HRVLZkrLiWx3gWWwb777/ABqzDX/iqp/WWsql7IEv6ShOZEP2HImTT7jx7CKGa5K4IMnnYnTPDkxDmoT5bMlzyROvXNtbPLgyuW8En0V5lOkAJ/5XgHcpoDyo4K8XhCOPmOKXhfZpWLauJ/yz+1mLtA7nbAw0luhixbkKJCZPZhB29Tz6KlaYGjBm+D0e49hPljrLjCXX6BokzWr2DTWis9K/Fm6OaUmG7rDjm49CR8ZZ20TTzQJWh3X+LnHUz4qQ6GU6J38MEhaof+/EzODlsXWDI5OSBdSdYy+3vLZyY8rIh4Y1udqKpXhCETljLE1Z3Yl4jkW6l2CBrPJPaD+oO/eM/GmhaPCRJIocIYjt8libO8+8Tlkl9ctLJ6bEdxWcx4Z8Og/xyObcRfWL1jPNszXRLXidFWPd4WkHt0eIFC11BXpDyondDlILQgi64WTlJJUwO0Q//g\u003d\u003d" "upnpsenddelay":10000 "lifxconfigured":false "broadlinkconfigured":false "tracestate":true "upnporiginal":false "seedid":100 "haaddressessecured":false "upnpadvanced":false "linkbuttontimeout":90 "settingsChanged":false "veraconfigured":false "fibaroconfigured":false "harmonyconfigured":false "hueconfigured":false "nestconfigured":false "halconfigured":false "mqttconfigured":false "hassconfigured":false "domoticzconfigured":false "somfyconfigured":false "homewizardconfigured":false "openhabconfigured":false "fhemconfigured":false "moziotconfigured":false "homegenieconfigured":false}

and the new working one

{"upnpconfigaddress":"192.168.1.49" "useupnpiface":false "userooms":false "serverport":80 "upnpresponseport":50000 "upnpdevicedb":"data/device.db" "upnpgroupdb":"data/group.db" "buttonsleep":100 "traceupnp":false "farenheit":true "configfile":"/home/pi/habridge/data/habridge.config" "numberoflogmessages":512 "myechourl":"alexa.amazon.com/spa/index.html#cards" "webaddress":"0.0.0.0" "hubversion":"9999999999" "securityData":"Qd29J/vcDO5HRVLZkrLiW/t91cmJIJppDCYmoeLtCdeKBvn2HwMDPqLZJSxWPgFX97vG33sQpBl2bwjaPR2c8M4qB2w5WOQjbFhJcYNtCX8R1mjHE3//0fRNTXijwmpc4RS7qAMQXm/M0L4OmuvY2/TeJ5Qa1URfAiwdcdYnmbT5G/jAqY4Uhtr5yixg+M9/FjYR03MCLwpfNcdc1Z5GKDu4z747ngAU0x10hh+YQv76A+IajKwPMfXGnIpDo+i7rrmcjXC3gkNmFQDjBERKmtBX92yLReatVldRVW2NVaw9RRe4Tdd/gbgmkL8/JUny7AJyauzSWLqdcYUUy7nwFDDy+sGk8jlZi+EpW2aTcnic5xihmyHXTS/fNwMrqTT7mI9h8e16yRjoJt0fmWzObGelhPMoXf/Ve6VGNa1TYYiGzbwps83NknHADAW4ZkVWDvQbICVpyLhkU24KMZrR+HaTyFbC97KtCXfjqOuyYUZZ+OziIkFRNVgL0wLAquU0q1ES5YL5Kz+GETZrJUIB2j05ILDlvPb+KVHhmdxTnk8NjqeVAlQ0zn+lAtcny7SxbANueHmiuqBoOsASftMU1snh1z11eTE6y7NgQI/rhwf8KBj2y3d+b+FWEggtf00yUWgNWpLNxW0ETOcdHwgqkAJd8hHAcbYGMC3aENeWmdCUGxxtdzOHFDQFKBKlEZrpPeXkZLu5xiF+t85vyXLv9LkB5FJkUWCpLi79qk3SaSXPratH0I6+oZ9KyzKGqHn1SlcQSCJ3RDoXYBQc5QmSGuk/ummShCOIeFUKZaRvkqyhjIaZtslNdhargeznhOMQcDT9egE8F8KyabOfrYe+tpBSfXdDgMmvYkzD4bdk5RUG5f45EHAhAhr1XtrRay2vtVrFHcWezQJCGvVE+Bk941nQIXqIKqNJdV6mevfYaYRt0htzvefhCgcoKS9yVe73jY7C7TRBJDlyJvMJkR0hF2J7xaBit2JK5J6AxlYhGGo0xIKBHKojTg\u003d\u003d" "upnpsenddelay":650 "lifxconfigured":false "broadlinkconfigured":false "tracestate":false "upnporiginal":false "seedid":100 "haaddressessecured":false "upnpadvanced":false "linkbuttontimeout":45 "settingsChanged":false "veraconfigured":false "fibaroconfigured":false "harmonyconfigured":false "hueconfigured":false "nestconfigured":false "halconfigured":false "mqttconfigured":false "hassconfigured":false "domoticzconfigured":false "somfyconfigured":false "homewizardconfigured":false "openhabconfigured":false "fhemconfigured":false "moziotconfigured":false "homegenieconfigured":false}

npaisnel commented 3 years ago

OK, so the only difference I can see are the Security data and the old file has an extra line

"hueaddress":{"devices":[]}

the other changes like hub version, upnpsenddelay linkbuttontimeout, etc are all changed on ly AFTER I treid to fix the not working

SO the old file has an extra line and different securtiyData.

Other wise all is the same

heffneil commented 3 years ago

I can not understand it! I have STOPPED the bridge - deleted all devices - rediscover and all devices are found. No no no idea how or where they are being found but it is frustrating!

trpster commented 3 years ago

My advice, based on zero data, is that if things are working well, backup the ha-bridge.config file. To heffneil, check the process that npaisnel used to get his working. My process was more brute force...delete it and install it on a different r-pi.

heffneil commented 3 years ago

I am running on mac osx and I have 100% stopped the HA-Bridge.java. I also removed all my devices by starting a new Data directory as someone suggested above.

heffneil commented 3 years ago

My server is down. I can't connect to it and it STILL find devices even the next day. Something screwy is going on!

kllngtme commented 3 years ago

I've been on and off trying to get this to work since Christmas time. I tried a brand new install on a pi and still haven't had much luck. I kept getting stale entries popping up in my Alexa devices even after deleting it multiple times. Eventually after not trying for a bit, the stales aren't coming back but since trying to get this on a new pi, even trying a windows build, I can't get anything to be picked up by the Alexas anymore from habridge. I'm glad I'm not seeing the cached items anymore but I'm not sure what else I'm missing. These are brand new from scratch builds with no configs, and nothing else on the pi to mess with anything.

On the Alexa side of things, I've now deregistered all my Alexas and reregistered them(above mentions logging out, I believe this is the term they mean, I don't see a logging off option anywhere, on the website or the app on my phone, only a deregister). I'm not having much luck..

npaisnel commented 3 years ago

It is a total nightmare and if you have done a clean install, the fix I succeeded with of of deleting the data file is not going to help.

All I can think to try ..if you have not already tiried is to NOT use the Link button.

When I succeeded I did not use the Link button. but too I had just started with a new data file only .

heffneil commented 3 years ago

I can only get my alex's / echo dots and all are storing the devices in cache? I've thought about using a new email or shutting them all down but I have A LOT.

trpster commented 3 years ago

My link time is set for 45 seconds; I suppose it's the default because I never set it. One thing to check; when you go through the process of discover/delete, ha-bridge must be running. I can post my "Bridge Control" setup if anyone thinks it will help (and can tell me the easiest way to post it). I've also backed up the ha-bridge.config file in case it will help if things turn to shit, but I've been afraid to make any changes since I got everything working. All of my devices are controlled by MQTT.

npaisnel commented 3 years ago

I do not need to use the Link button

I just tried it

I created a new device and Alexa found ti immediately ...no need to Press the Link button.

Try without using Link

kllngtme commented 3 years ago

I finally got this. Enabling the trace upnp helped me understand what was going on better. All my devices were being seen, just not connecting really. I switched the web server port from 8080 to port 80 and that was the fix. All my devices are connecting now. Phew.

audiofreak9 commented 3 years ago

@kllngtme Yes Amazon has changed discovery to only work with port 80. This occurred more than a year ago.

npaisnel commented 3 years ago

Well

I can say one thing about the 'fix' of deleting the data folder...is that is a one time fix...I have tried it again when Alexa some how came up with a new error

"Can't find device or group named X in Y's profile"

So I tried a Discover devices..no go Deleted all the devices form HA-Bridge Gui No go

So went back both fix that worked last week.

Backup the /habridge/Data folder to a different name..and re boot the server so it created a new data folder

This time.

on re creating new devices..I does not find them.

So the Fix of deleting Data and start gin a fresh 'system" was merely a fluke.

Maybe it is just a matter of leaving Alexa alone for a week or so ...so it flushes old data out of a cache some where....

dunno..but the fix is not a real fix..it was just a lucky coincidence!

npaisnel commented 3 years ago

Another update.

MY Alexa stopped responding and seeing any devices that were already found when I Accidentally Hit the Setup Remote button on the iPhone App.

After hitting that and quitting out of the app...Alexa did not see the devices..

No amount of re booting or other tricks would see them again.

Just got a messages from Alexa saying .. "No such device or Group in Neils profile."

Last night before I went to bed I de-registered both Alexa devices. This morning I plugged them back in to power and just walked away .

Give them 10 minutes and they start flashing orange and you can set them up again.

I also Deleted the data file from habridge directory

Rebooted and then copied the devices.db file back to data.

Diaan "Alexa Find new devices...and all 26 were found again.

Maybe the trick is to deregister the Echo devices and leave it all for a few hours..over night,,,

Dunno ...

But if you get stuck, worth a try .

sonypsx commented 3 years ago

@npaisnel: Thats exactly the way i was able to avoid my dupe finding of devices. Deregister Alexa will help instantly - you don't have to wait overnight or even hours. I am pretty sure this deregistering is triggering "something" back at Jeffs playground ;)

heffneil commented 3 years ago

I deactivated all my echos like you guys suggested and finally found no new devices.

Then I had to get everything working again and my installation of HA-Bridge is / was a mess. It still is. The problem is almost no one here is using Mac OSX to run this so I don't have a good reference on HOW it should be configured. I finally was able to get OLD files to reload by rebooting EVERY time. I don't know why I have to reboot but the devices and config files will not stick unless I reboot.

My files were PRE moving to port 80 for the webserver.

I am at the point where Amazon can not find any of my devices. Nothing gets discovered. Don't know why and kinda don't care anymore. I gave it the good try - but frustration and lack of being able to control this stuff - it just isn't worth the trouble anymore folks.

npaisnel commented 3 years ago

How long did you leave them de-registered for before you re-registered them and tried a discovery.

I had to de register, leave it over night , re-register them, before trying a discovery

Do you have a link to setting habridge up on Mac? I have a spare Mac Mini here I could try on

npaisnel commented 3 years ago

@npaisnel: Thats exactly the way i was able to avoid my dupe finding of devices. Deregister Alexa will help instantly - you don't have to wait overnight or even hours. I am pretty sure this deregistering is triggering "something" back at Jeffs playground ;)

heffneil commented 3 years ago

Just long enough to get them all offline. I didn't register them again until I had the bridge sorta working.

npaisnel commented 3 years ago

I found you did have to leave them unregistered for a time.
if I re registered straight away i found no devices

Jean-Mercier commented 3 years ago

@kllngtme Yes Amazon has changed discovery to only work with port 80. This occurred more than a year ago.

Thanks so i can close this issue because i'm running ha-bridge on synology docker and port 80 is reserved for synology system

it's was a long time i didn't discover device

jayjupdhig commented 3 years ago

Now it's completely finish with that kind of devices - indepdendently from the "virtual" link button - "ON" vs. "OFF": https://github.com/bwssytems/ha-bridge/issues/1295

beandi commented 3 years ago

So after not discovering any new devices for the last two weeks i decided to try and edit the unique ids in the device.db-file: My findings after some try and error: Replacing the last "-"-separator with a ":"-separator (and nine octets) did the job, every device was recognized again.