Re: [mh] Help for Alexa Integration - Hue Emulation-SOLVED

Gianni Veloce via misterhouse-users <[email protected]> Wed, 9 Mar 2022 10:33:04 +0000 (UTC)
Newsgroups gmane.comp.misc.misterhouse.user
Message-ID <[email protected]>
 Dear Wayne
Very nice explanation about Alexa integration..I was more of less aware how it works but did not know WHY it did not work for me.
So the good news is that the new AlexaBridge.pm (v.2.) module that you provided solved my problem. But cannot uderstand why it is not included in Misterhouse Github files to help others avoid the trouble I had?
Many thanks for your help and congrats for developing this module!
In a nutshell "if you have an Echo Dot device you need the v.2 MH module for devices discovery as the module in the MH distro will not work"
P.S. To note that this is the same pm file that Giles provided me as well and works with him. Many thanks to GIles as well for this persistent support..
TIA
GV
    On Tuesday, March 8, 2022, 06:33:09 PM GMT+2, Wayne Gatlin <[email protected]> wrote:  
 
 I have some newer echos and they all seem to work but they are already paired with MH so it seems to be skipping the initial "pairing" part where it gets the user from MH. 

The discovery uses multicast/UPnp for discovery and that part for you seems to be working. This is what the UDP 1900/50000 is for.
 - The echo is sending the SSDP discovery request and MH is responding with the discovery.xml which contains the URL base for the next request.
- The echo is sending a post to MH /api (using the base url from the discovery.xml) and MH responds with the username that will be used from then on. This is the part where you would normally have to push the pair button on the hue to allow the echo to pair with it. It's possible that the echo doesn't like the username that we are responding with, so I updated it in the code linked below. 

- The echo then does a discovery request for all lights to "/api/lights/lights" the username in this case is statically set to "lights" and is the second section of the URL "/api/<username>/lights" 

- At this point the echo should be done with the discovery, but in your logs it just starts over with the pairing process requesting the username again with a post to/api. 
Update your AlexaBridge.pm with the one below:
https://raw.githubusercontent.com/waynieack/misterhouse/AlexaBridge/lib/AlexaBridge.pm


If the password change doesn't resolve the issue I have a new mh.private.ini option that allows you to force a longer version of the discovery response. So just update the AlexaBridge.pm, do a full restart and see if it resolves your issue, if not then add the option below to your mh.private.ini and do another full restart. 

alexaForceLongFormat=1

Also send the current mh.private.ini alexa settings.
It would be nice if we could see debugs from the echo but I am not sure how to get that. 

_Wayne

On Sun, Mar 6, 2022 at 3:16 AM Gianni Veloce via misterhouse-users <[email protected]> wrote:

 hi Misterhouse lovers!!
I hope someone can help me againFor the last days I am trying to integrate my new Alexa Echo Dor/Gen3 to MH, but in vain :(.Devices discovery does not work neither from the Alexa Dot nor from the Amazon-Alexa web interface (no devices found)Searched the internet exhaustively and not many articles found for mh a=while some more found for OpenHub but did not help me so far as see quite old.
i am using mh version 5.0 with perl 5.28.1 on a brand new Raspberry Pi 4.Both RPI and Alexa Dot are in te same network and Alexa works in genaral responidng to std voice commands etx
On my Rpi I have setup the mh.private.ini as described in the guide here for the "Chunked Method"Amazon Echo and Google Home local integration using MH native Hue Emulation · hollie/misterhouse Wiki · GitHuband I have also setup a couple of my lights as Alexa items in the mht file and I see that the mhp generated includes them..
As my mh is running on local port 8080 (user non-root) i used the iptables redirect
 iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080which seems to work as running http://mhIpAddress/description.xmlbrings me the Hue XML file
Also in mh.log I see that the notifier/listener are activatedmh.log: - creating alexaSsdpNotification on udp 50000mh.log: - creating alexaSsdpListen on udp  1900
One strange thing is that although i have set debug in the .ini withdebug = alexa:5
I dont see any debug messages at all in the print.log....and wonder why...
Hope I gave a good overview of my case so can someone help?
Can you confirm that Alexa integration works currently with MH or is perhaps somehow broken?And if possible  provide some examples for INI and MHT entries?Of course any other tips/advices are very welcome!
TIA
 GV________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users