makermusings / fauxmo

Emulated Belkin WeMo devices that work with the Amazon Echo
MIT License
525 stars 176 forks source link

Returned ip adress not correct #38

Open kevstone122 opened 4 years ago

kevstone122 commented 4 years ago

Hello together!

There is a function "def act(self, client_address, state, name):" which gives the ip adress, state and name back, when there was a command from Alexa!

My idea is to create for example just one device called "light" I will have two Alexa's (Echo dot) in two different rooms. So if i am in the first room and i say "Alexa switch on the light", then the light should switch on in this room. Same in the second room with the second Alexa and the second lamp.

My idea was to handle this over the IP adress. I know which IP adress is in which room and so i can filter the commands and can switch on different outputs!

I found out, that the ip adress which i get back from the function "act" is always just one of the both alexas, but doesn't matter in which room i send the voice command. It is always the same IP adress.

Do you have any idea why? Can you help me with this problem?

Thank you a lot kevstone122

ramgarden commented 4 years ago

I thought the Alexa service exists as a single cloud service so there's no concept of an individual Echo device? Unless something comes back from the Alexa cloud service that gives some ID or NAME of the individual Echo device you might can capture that? But the cloud service might not have any knowledge of your internal network IP addresses and would only know your WAN IP address of your router / POP.

On Thu, Nov 14, 2019 at 4:18 PM kevstone122 notifications@github.com wrote:

Hello together!

There is a function "def act(self, client_address, state, name):" which gives the ip adress, state and name back, when there was a command from Alexa!

My idea is to create for example just one device called "light" I will have two Alexa's (Echo dot) in two different rooms. So if i am in the first room and i say "Alexa switch on the light", then the light should switch on in this room. Same in the second room with the second Alexa and the second lamp.

My idea was to handle this over the IP adress. I know which IP adress is in which room and so i can filter the commands and can switch on different outputs!

I found out, that the ip adress which i get back from the function "act" is always just one of the both alexas, but doesn't matter in which room i send the voice command. It is always the same IP adress.

Do you have any idea why? Can you help me with this problem?

Thank you a lot kevstone122

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/makermusings/fauxmo/issues/38?email_source=notifications&email_token=AAU4DTIKJ3EDBAEIPBFGDDDQTW6CZA5CNFSM4JNRZ47KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HZOAY5A, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAU4DTJNNN5EKGQ7ZAVDPQTQTW6CZANCNFSM4JNRZ47A .

kevstone122 commented 4 years ago

I thought the Alexa service exists as a single cloud service so there's no concept of an individual Echo device? Unless something comes back from the Alexa cloud service that gives some ID or NAME of the individual Echo device you might can capture that? But the cloud service might not have any knowledge of your internal network IP addresses and would only know your WAN IP address of your router / POP.

Thank you for the fast answer! I understand, but i get the internal IP adress back in the function "act". I tried it with different VLANs. One Echo is in 10.0.3.XX and the other one in 10.0.1.XX. There is no communication between these two networks, but if i say the voice command in the 10.0.3.XX network, i get always 10.0.1.XX adress back! Also in this network (10.0.1.XX) is the raspberry with the fauxmo script. So somehow the AMazon service knows, when der is a command from another Echo dot (10.0.3.XX), to send the reply back to right echo dot (10.0.1.XX). For me is not clear how amazon know this, but maybe there will be some extra information in the protocol!? Maybe just because first time i said at the echo dot in 10.0.1.XX "Search devices" and so this echo dot found all of them as first or as "host"...The app and the cloud just show the summary of all devices i think and each echo dot is a "host" of maximum 16 devices, right?

Thank you!

kevstone122 commented 4 years ago

Hello together again!

Has nobody an idea for this? Thank you a lot!

mrdvt92 commented 4 years ago

Has nobody an idea for this? Thank you a lot!

If I remember correctly you have two networks in your home and two echos and you want the echos to use "local" configuration for "local" lights and then also have "global" shared lights.

My recommendation is to have two echo accounts and then Proxy ARP the global shared assets into each local network.

echo1 on local1 <- proxy arp -> shared assets <- proxy arp -> echo2 on local2

Michael R. Davis

mrdvt92

kevstone122 commented 4 years ago

Thanks for your reply!

Yes you understand it right and general this is a vrey good i idea. I never think about two accounts! But there is one problem: The two,three echo dots don't know each other and each one needs to learn my voice, my favourite songs, playlists and so on. So good to seperate for the voice command, but not good for the standard alexa features. You know what i mean?

Best will be, if there is some IP information from which echo dot was coming the command. Voice message --> Recorded by echo dot --> upload to Amazon to transfer voice to text --> send text back to echo dot --> echo dot send internal out the command with IP Adress..... Then the command will be recieved by the fauxmo script on raspberry and raspberry should also get the sended IP.....With an easy IF ELSE you can seperate the commands.

If "Light ON" + IP 1 THEN Room 1 ON IF "Light ON" + IP2 THEN Room 2 ON

Two different Lights with the same Voice command "Light ON"