-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix WeMo Emulation #1357
Fix WeMo Emulation #1357
Conversation
i merged set and get xml to one variable to save some bytes now. |
Hey @arendst , what do u say to this? I think this is an important feature for many and they r waiting for it. |
What's wrong with the below change only:
This saves a lot of code space and apparently users never needed the GetBinaryState information. Further the Wemo emulation always supported only one device. For more devices use the Hue emulation. |
Without GetBinaryState, the alexa app does not recongnize if the modul is on or off, i would rather suggest to let it in and delete if u r getting out of space. its your descicion, ill stay with the getbinarystate response on my devices. you cannot use more than one hue bridge in routines at the moment, thats why to use wemo. i tried a few things to fix this, but it seems to be an alexa bug, cuz i read that real devices got the same problem. |
@reloxx13 could you be so kind to test the latest 5.10.0e version for positive Wemo functionality please. I do not have access to Alexa so I cannot test it and as many people seem to have problems with it I hope this finally works (again). |
Heya @arendst , attention textwall inc :D i can offer a teamviewer connection if you like. SHORT VERSION RESULT: In my personal user_config i disabled all Sensors and MQTT Services since i dont use them. LARGE VERSION RESULT: Hardware: Echo Dot 2G, Version: 597464620 No WEMO/Belkin Skill activated in Alexa. Deleted one Sonoff WEMO EMU over the Alexa Web Interface ( https://alexa.amazon.de ) Used Clean before Building (with Atom). Flashed over OTA (Web Interface) After flash and restart, WPS was active. After a few tries pressing the button 4 times to launch the WIFI Manager, the Sonoff WIFI was showing up. I connected to it and the Web Interface of Sonoff was instantly opening in my open Firefox as new Tab. I entered the correct WIFI Setting ( SSID and PW only [A-Za-z0-9] ). I hitted save, device restarted now. In the Fritzbox Interface, it showed up the newly Sonoff with a new IP (sonoff-1348, 192.168.178.201). I opened the IP in a new Tab to enable the Wemo Emulation. Device restarting. Back to Alexa, i told her "Alexa, discover new smart home devices". Okay, allow "Selfopening Ports" in fritzbox now. Now some users said, that HUE gets detected while WEMO gets not detected, ill try this: Deleted teh Wemo Device in the Alexa Web Interface. Research with Alexa over Voice: Could not find any new devices Enabled Selfopening Ports again in fritzbox
Setting log to "4 more debug" and restarting again. Deleted it again from Alexa, searched again and found again. Result: I also noticed a heavy lag before the "00:16:58 UPP: Multicast (re)joined" log entry while spamming the On/Off button in the Alexa App, this could be the reason for "Device does not respond" messages from Voice On/Off. One time i got this log by switching it on over voice control and a device did not response:
I can remember that i needed a few tries to find the Wemo Device when i first installed one Sonoff, after that i had never Problems with them. I also sniffed the network a few days ago while discovering to check if something in the MSEARCH has changed in past weeks but could not find any diferences. After i wrote that, i changed back to WEMO Emu and deleted the Hue Emu in the Alexa Web Interface, now i tried to discover a few times but it did not get discovered. Logs:
After a few more times the Wemo Devices showed up again. Now i disbale MQTT and stay on Belkin Emu. Deleted the Wemo Device and discover again, device instant found.
I tried it a few more times but after over 10-20 tries it coud not get found again. Free memory 25kb (information page). In my personal user_config i disabled all Sensors and MQTT Services since i dont use them. BR |
Additional to say, this is not a xml response problem, since the request (MSEARCH) is not even arriving the sonoff (regarding the log entries). |
THNX!!! Other users also noticed that disabling MQTT made a better experience and that's why I provide the option on the Other menu. Part of the problem is the many UDP uPnP messages being thrown at your network. In my case my Routers, Kodi and Sonos keep sending messages at tens a second. All these messages need to be scanned for M-SEARCH by tasmota leading to the situation you encounter too. The important part for me currently is that at least initially it works so the basic code is fine but the hardware seems to be useless in a busy uPnP environment... |
5.11.0 20180107 * Minor webpage HTML optimizations (#1358) * Updated German translation (#1438) * Change Sonoff Pow Energy MQTT data message and consolidate Status 8 into Status 10 * Change ADS1115 default voltage range from +/-2V to +/-6V (#1289) * Change text to Active for 3 minutes (#1364) * Change Wemo SetBinaryState to distinguish from GetBinaryState (#1357) * Change output of HTTP command to valid JSON and Array only (#1363) * Removed all MQTT, JSON and Command language defines from locale files and set fixed to English (#1473) * Renamed commands Color2,3,4 to Color3,4,5 * Fix BME280 calculation (#1051) * Fix Sonoff Bridge missed learned key if learned data contains 0x55 (End of Transmission) flag (#1095, #1294) * Fix PWM initialization in Dimmer/Color mode (#1321) * Fix Wemo Emulation (#1357) * Fix display of build date and time in non-english locale (#1465) * Fix Wemo and Hue emulation by adding M-Search response delay (#1486) * Add libraries Adafruit_BME680-1.0.5, Adafruit_Sensor-1.0.2.02, TasmotaSerial-1.0.0 and TSL2561-Arduino-Library * Add command Color2 to set color while keeping same dimmer value * Add device function pointers * Add support for SenseAir S8 CO2 sensor * Add color led signal to Carbon Dioxide (CO2) sensors using defines CO2_LOW and CO2_HIGH in user_config.h * Add support for Domoticz Air Quality sensor to be used by MH-Z19(B) and SenseAir sensors * Add support for PZEM004T energy sensor * Add support for iTead SI7021 temperature and humidity sensor by consolidating DHT22 into AM2301 and using former DHT22 as SI7021 (#735) * Add support for BME680 using adafruit libraries (#1212) * Add support for MH-Z19(B) CO2 sensor (#561, #1248) * Add multipress support and more user configurable GPIO to Sonoff Dual R2 (#1291) * Add support for TSL2561 using adafruit library (#661, #1311) * Add support for SHT3x (#1314) * Add support for Arilux LC06 (#1414) * Add Italian language file (#1449) * Add 2nd Gen Alexa support to Wemo emulation discovery (#1357, #1450) * Add define for additional number of WS2812 schemes (#1463)
5.11.0 20180107 * Minor webpage HTML optimizations (arendst#1358) * Updated German translation (arendst#1438) * Change Sonoff Pow Energy MQTT data message and consolidate Status 8 into Status 10 * Change ADS1115 default voltage range from +/-2V to +/-6V (arendst#1289) * Change text to Active for 3 minutes (arendst#1364) * Change Wemo SetBinaryState to distinguish from GetBinaryState (arendst#1357) * Change output of HTTP command to valid JSON and Array only (arendst#1363) * Removed all MQTT, JSON and Command language defines from locale files and set fixed to English (arendst#1473) * Renamed commands Color2,3,4 to Color3,4,5 * Fix BME280 calculation (arendst#1051) * Fix Sonoff Bridge missed learned key if learned data contains 0x55 (End of Transmission) flag (arendst#1095, arendst#1294) * Fix PWM initialization in Dimmer/Color mode (arendst#1321) * Fix Wemo Emulation (arendst#1357) * Fix display of build date and time in non-english locale (arendst#1465) * Fix Wemo and Hue emulation by adding M-Search response delay (arendst#1486) * Add libraries Adafruit_BME680-1.0.5, Adafruit_Sensor-1.0.2.02, TasmotaSerial-1.0.0 and TSL2561-Arduino-Library * Add command Color2 to set color while keeping same dimmer value * Add device function pointers * Add support for SenseAir S8 CO2 sensor * Add color led signal to Carbon Dioxide (CO2) sensors using defines CO2_LOW and CO2_HIGH in user_config.h * Add support for Domoticz Air Quality sensor to be used by MH-Z19(B) and SenseAir sensors * Add support for PZEM004T energy sensor * Add support for iTead SI7021 temperature and humidity sensor by consolidating DHT22 into AM2301 and using former DHT22 as SI7021 (arendst#735) * Add support for BME680 using adafruit libraries (arendst#1212) * Add support for MH-Z19(B) CO2 sensor (arendst#561, arendst#1248) * Add multipress support and more user configurable GPIO to Sonoff Dual R2 (arendst#1291) * Add support for TSL2561 using adafruit library (arendst#661, arendst#1311) * Add support for SHT3x (arendst#1314) * Add support for Arilux LC06 (arendst#1414) * Add Italian language file (arendst#1449) * Add 2nd Gen Alexa support to Wemo emulation discovery (arendst#1357, arendst#1450) * Add define for additional number of WS2812 schemes (arendst#1463)
* Change Wemo SetBinaryState to distinguish from GetBinaryState (arendst#1357) * Change output of HTTP command to valid JSON only (arendst#1363)
5.10.0c * Consolidate device serial (MH-Z19, SenseAir and Pzem004T) into TasmotaSerial library * Consolidate PWM device recognition * Fix Wemo Emulation (arendst#1357) * Add support for Arilux LC06 (arendst#1414)
5.10.0d * Renamed commands Color2,3,4 to Color3,4,5 * Add command Color2 to set color while keeping same dimmer value * Add led signal to Carbon Dioxide (CO2) sensors (see user_config.h) * Fix Wemo Emulation again (arendst#1357) * Updated German translation (arendst#1438)
5.10.0e * Add Italian language file (arendst#1449) * Fix Wemo Emulation once again closest to issue (arendst#1357)
5.10.0g * Add 2nd Gen Alexa support to Wemo emulation discovery (arendst#1357, arendst#1450)
This fixes #1223 #1243
Echo is Requesting the current state and this is powering on the device.
The Echo is asking for GetBinaryState and includes always BinaryState 1, which powered the device on.
if (request.indexOf(F("State>1</Binary")) > 0) {
I added Get and Set XML Response and made a differentiate between GET and SET Binary State.
Also, now the Alexa App shows the current state.
Please!!! Review the code, im new to this language.
TODO:
I could not find out how to Response with multi channels. i also got only sonoff basics with one channel. this happens in line 352 the hardcoded 1
For SET binary state it also sets all channels on/off. i guess the hardcoded 1 is okay.
I also attach a patch file which can be applied by git for easier review for you.
fix_wemo_emulation.zip
PS: Atom is adding a new line in the langauge file, sorry :S