Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Household profiles #98

Closed
1 task
nickbalch opened this issue May 9, 2020 · 10 comments
Closed
1 task

Support for Household profiles #98

nickbalch opened this issue May 9, 2020 · 10 comments
Labels

Comments

@nickbalch
Copy link

  • Issues not following the template may be closed for that reason alone.
  • Operating system and version: Raspbian Buster
  • Python version: Python 3.7.3
  • Fauxmo version (fauxmo --version): v0.5.0
  • Echo device type (e.g. Echo, Echo Plus, Dot): Echo
  • [Echo Firmware Version]: 653619520

My Issue

I appear to have a problem with fauxmo when using
a) additional Alexa household profiles
b) 2 separate amazon alexa accounts.
When using a different profile or account to the one I originally set up the devices with, Echo (or alexa app) does not detect devices configured.

In my profile, fauxmo devices remain correctly detected and controlled.
In the other adult profile in my household, the fauxmo devices are not detected or controlled.
I also have wemo devices, these are correctly detected across profiles and accounts.

I am using the mqtt plugin to connect to two sonoff switches, flashed with homie firmware

WHYT

  • control using IOS Alexa App or Echo - same issues
  • running fauxmo as a service or from command line
  • logging into my profile, or resetting the echo device to be registered to my profile is consistently successful in connecting to and controlling fauxmo devices.

My conclusion is that fauxmo is not allowing additional profiles or accounts to detect and control devices.

If there is a specific message or event I should seek out in the debug log, I can do so.


Please make sure you've taken these steps before submitting a new issue:

  • Try to reproduce the issue with Fauxmo installed in a
    venv
  • [Y] Ensure you're running a supported version of Python
    Requires Python >= 3.6.0 for Fauxmo >= 0.4.0
  • [Y] Run Fauxmo in debug mode (-vvv) and include relevant output
  • [Y] Include your Fauxmo config.json
  • [Y] Search the existing (including closed) issues
    "FAUXMO": {
        "ip_address": "auto"
    },
    "PLUGINS": {
        "MQTTPlugin": {
            "path": "/home/pi/fauxmo/plugins/mqttplugin.py",
            "DEVICES": [
                {
                    "port": 12349,
                    "on_cmd": [ "homie/sonoff-a/switch/on/set", "true" ],
                    "off_cmd": [ "homie/sonoff-a/switch/on/set", "false" ],
                    "state_cmd": "homie/sonoff-a/switch/on/set",
                    "name":"Bedside Lamp",
                    "mqtt_server": "192.168.0.115",
                    "mqtt_port": 1883
                },
                {
                    "port": 12350,
                    "on_cmd": [ "homie/sonoff-3/switch/on/set", "true" ],
                    "off_cmd": [ "homie/sonoff-3/switch/on/set", "false" ],
                    "state_cmd": "homie/sonoff-3/switch/on/set",
                    "name":"Side Lamps",
                    "mqtt_server": "192.168.0.115",
                    "mqtt_port": 1883
                }
            ]
        }
    }
}
@n8henrie
Copy link
Owner

n8henrie commented May 21, 2020

If there is a specific message or event I should seek out in the debug log, I can do so.

Please do -- run Fauxmo from the command line with extra verbose output, output everything to a file, go through the motions of the behavior you're describing above, then post the log (if it's extremely long, feel free to post to pastebin or what have you and then post a link).

EDIT: To be transparent, I didn't even realize you could have multiple "households," and I haven't tried with other profiles, so I have no idea what the issue might be.

@nickbalch
Copy link
Author

nickbalch commented May 23, 2020

Hi - here are two logs:
Fauxmo devices were removed from alexa
Echo IP is 192.168.0.180
I tried to turn off some devices that fill the logs, but I have three sonos devices that seem to be very chatty.

"success" https://pastebin.com/q0Kkw2Hk
Fauxmo started
iPhone 1, household profile = "nick" : run alexa app -> discover devices -> switch -> wemo
2 new items detected
Use app for a successful switch on/off of one device
Terminated fauxmo

"fail" https://pastebin.com/9hEQ2gvB
Fauxmo started
iPhone 2, household profile = "Sxx" : run alexa app -> discover devices -> switch -> wemo
app reports no items detected
terminated fauxmo

I am not at all sure how to interpret the logs, but the "fail.log" contains nothing from the echo's IP address - I note, for example, ssdp.discover messages from the echo ip in the "success.log"

Thus, it would appear that the echo does not to query fauxmo the second time. I am not sure, therefore, if there is anything you can do from within fauxmo to solve this.

For the two Wemo devices I have, I follow the same procedure to add wemo devices to the second profile in the household.

In case it's important, the echo is registered to the first profile, the second profile is using my wife's amazon account, defined as a profile within "my" household and showing as another adult in the Echo app.

@n8henrie
Copy link
Owner

So just to make sure I am understanding the situation:

One amazon account, with two (adult) profiles.

One Echo registered under one of these, the other registered under the other.

Added some devices (let's just say one switch and one light) to one of the Echos, works fine. Try to add the same devices to the second echo, nothing is discovered.

Is that right?

If so, can you try a few things just for kicks?

  1. Remove all devices from all Echo configs. You know that you can successfully add to one Echo under one profile. Can you add it to the second Echo (under the other profile) if you add discover devices on the second Echo first?
  2. If you can add to the second device, that means that both devices work, and both profiles work. If you try to then discover on the first device, I assume you see the same problem?
  3. If you can't add to the second device (even when you discover there first), that suggests there is either a problem with your device, or that Echo devices have trouble discovering from a "second profile," which would be interesting to know.

Hope that makes sense.

Is there any chance that the second device is on a different network? (Some routers broadcast a 2.4 and 5 ghz, not sure if the Echo can do both.)

@nickbalch
Copy link
Author

nickbalch commented May 24, 2020

Hi - One clarification to your understanding: there is just one amazon echo involved. Registered to me - "profile1". A second profile was added, my wife's - "profile2".

Thus, I have now tested by starting discovery, with no fauxmo devices in the app.
My conclusion: "profile2" is unable to ever detect devices.

For all these logs, the active profile on the echo is "profile2" (which is the usual situation)
All devices are on the same wifi network, interestingly, all on 2.4 ghz (Unifi APs that are broadcasting on both frequencies)

One other thing I wanted to check:
I am removing devices simply by deleting them from the amazon app (with fauxmo not running) - is that sufficient, is there any other clearout I should do? I terminate and restart fauxmo from the command line as follows: fauxmo -vvv -c config.json 2>&1 | tee log.log

Here is a log of "profile2" running a device discovery from IOS app.
https://pastebin.com/0uMezB0h
All fauxmo devices were removed via the app.

Here is a log of "profile1" subsequently running a device discovery, from IOS and successfully finding the fauxmo devices.
https://pastebin.com/ha6ehbRs

Then finally, "profile2" attempting a discovery, right after success in discovering with "profile1"
https://pastebin.com/pzALmSvY

If you would like me to try with a second echo device, I could set one up ... I have an unopened dot somewhere I could try with.

@n8henrie
Copy link
Owner

If you would like me to try with a second echo device, I could set one up ... I have an unopened dot somewhere I could try with.

No, I just misunderstood. But thanks for offering.

Here is a log of "profile2" running a device discovery from IOS app.

Huh, that looks different, right? I see several discover requests and responses. Didn't work though, huh?

Then finally, "profile2" attempting a discovery, right after success in discovering with "profile1"

I see them there, too.

This definitely looks different than the first logs you pointed, where there were no discover requests.

Now I'm suspicious if it might be "just one of those things" with the Echo. I've definitely had periods of times when it refused to discover new devices or alternatively kept rediscovering devices that I had taken offline.

I'll see if I can debug a little on this soon.

@nickbalch
Copy link
Author

nickbalch commented May 25, 2020

In my hurry, I didn't turn off a very particular device (it has two IPs 192.168.0.8 + 18) - this might make the logs a little bit more tricky to compare - apologies for that. It looks like the discovery messages in the second seem to be associated with this server.

EDIT - I mean second set of logs. I was curious to explore behaviour with a second echo device, it's really trivial to to do. Setting up in next couple of days and will share results

@n8henrie
Copy link
Owner

n8henrie commented Jun 9, 2020 via email

@n8henrie
Copy link
Owner

Just wanted to note that I haven't forgotten this issue. I tested on my wife's iPhone and confirm it does not pick up new devices in her Alexa app; when I change nothing but subsequently run "discover devices" on my phone they are discovered. I'm not sure why. Will continue to investigate.

@nickbalch
Copy link
Author

nickbalch commented Jul 12, 2020

Hi - thank you for the update, I truly appreciate you continuing to look into this.
There is clearly something particular (peculiar) the echo devices do with household profiles and discovery

Potential workaround:
I have found that setting up a second echo (a dot), with my wife as the sole profile on it, allows for discovery to work. Control of discovered devices continues to function ok, even if the dot is unplugged, using the original echo with my wife's household profile.

@n8henrie
Copy link
Owner

Thanks for the update!

Looks like this is probably an upstream issue: https://www.amazonforum.com/s/question/0D54P00006zSzPQSA0/using-smart-devices-echo-with-multiple-profiles

I will likely close the issue unless it looks like there is something Fauxmo specific here. Thank you for pointing it out and your help with troubleshooting!

BTW, the link in that thread for "more information" is not working for me, at least not on mobile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants