Unintended (emulated WeMo switch) activity if going to the Alexa Web App - Smart Home - Devices page
wmweis62 opened this issue · 10 comments
Sorry, you may have already addressed this issue. I will look at your advice in this thread #25
Kakopappa, I am using your WeMo switch emulated code as the base code for a solution I developed for people with limited mobility. I provide them with the ability to voice control their hospital beds, because for them there is no other alternative. Everything necessary to make this work is my time and money as part of a volunteer effort.
I noticed some undesirable behavior and I am wondering if this is something you also noticed and if you thought of a solution for it. (Nassir may have already contacted you regarding this, so sorry if this is duplicate)
In my solution, I have 4 WeMo emulated switches that control 4 movements of the bed. In my lab, when I discover devices I see those devices in the Devices webpage within the Amazon\Alexa web app. The issue is anytime I either open the Devices web page, or refresh the Devices web page, or click Discover in the Devices web page all 4 relays cycle on and off. The downside of this is unintended bed motion creating a possible safety issue.
Looking at the Serial Port log, I think I see the cause but I have not figured out what to do about it. Associated with the Unintended switch cycling is a GetBinaryState message that will happen when you simply open the Devices web page, or refresh the Devices web page, or click Discover on the Devices webpage . Associated with the desired switch activity is a SetBinaryState message. I contacted Amazon but don't see them doing anything about it. I also contacted WeMo just in case their engineering team had to deal with this already since testing with a physical WeMo switch does not exhibit this same behavior.
Here are some snippets from the serial port for a few scenarios -
This is what a Voice Command for Turn on relay 2 looks like: (This is desirable behavior)
########## Responding to /upnp/control/basicevent1 ... ##########
"1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1">1</u:SetBinaryState></s:Body></s:Envelope>
request:"1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1">1</u:SetBinaryState></s:Body></s:Envelope>
Got Turn on request
Switch 2 turn on ...
And here is what it looks like when you click discover new devices for the same switch even when the devices are known and online (Undesirable)
request:"1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1">1</u:GetBinaryState></s:Body></s:Envelope>
Got Turn on request
Switch 2 turn on ...########## Responding to /upnp/control/basicevent1 ... ##########
"1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1">1</u:GetBinaryState></s:Body></s:Envelope>
And this is what it looks like if you simply refresh the Devices page in the Amazon\Alexa webpage under Smart Home (Undesirable)
request:"1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1">1</u:GetBinaryState></s:Body></s:Envelope>
Got Turn on request
Switch 2 turn on ...########## Responding to /upnp/control/basicevent1 ... ##########
"1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1">1</u:GetBinaryState></s:Body></s:Envelope>
Happy to report testing is going well for the fix for handling GetBinaryState messages.
Bill Weis ... did you work at LA? If so, PM me.