Skip to content

Commit

Permalink
v5.10.0g - Alexa 2nd Gen support
Browse files Browse the repository at this point in the history
5.10.0g
 * Add 2nd Gen Alexa support to Wemo emulation discovery (arendst#1357,
arendst#1450)
  • Loading branch information
arendst committed Dec 30, 2017
1 parent 11d7c5f commit d683410
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 90 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Sonoff-Tasmota
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.

Current version is **5.10.0f** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
Current version is **5.10.0g** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.

### ATTENTION All versions

Expand Down
5 changes: 4 additions & 1 deletion sonoff/_releasenotes.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* 5.10.0f
/* 5.10.0g
* Add 2nd Gen Alexa support to Wemo emulation discovery (#1357, #1450)
*
* 5.10.0f
* Differentiate between JSON text defines and other text defines to allow for English JSON while using different locale (#1449)
* Fix display of build date and time in non-english locale (#1465)
* Add define for additional number of WS2812 schemes (#1463)
Expand Down
4 changes: 2 additions & 2 deletions sonoff/sonoff.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
====================================================*/

#define VERSION 0x050A0006
#define VERSION_STRING "5.10.0f" // Would be great to have a macro that fills this from VERSION ...
#define VERSION 0x050A0007
#define VERSION_STRING "5.10.0g" // Would be great to have a macro that fills this from VERSION ...

// Location specific includes
#include "sonoff.h" // Enumaration used in user_config.h
Expand Down
104 changes: 18 additions & 86 deletions sonoff/xdrv_wemohue.ino
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,18 @@ void PollUdp()
// AddLog_P(LOG_LEVEL_DEBUG_MORE, PSTR("UDP: M-SEARCH Packet received"));
// AddLog_P(LOG_LEVEL_DEBUG_MORE, request.c_str());

if ((EMUL_WEMO == Settings.flag2.emulation) && (request.indexOf(F("urn:belkin:device:**")) > 0)) {
if ((EMUL_WEMO == Settings.flag2.emulation) &&
((request.indexOf(F("urn:belkin:device:**")) > 0) ||
(request.indexOf(F("upnp:rootdevice")) > 0) || // Needed by 2nd generation Echo
(request.indexOf(F("ssdpsearch:all")) > 0) ||
(request.indexOf(F("ssdp:all")) > 0))) {
WemoRespondToMSearch();
}
else if ((EMUL_HUE == Settings.flag2.emulation) &&
((request.indexOf(F("st:urn:schemas-upnp-org:device:basic:1")) > 0) ||
(request.indexOf(F("st:upnp:rootdevice")) > 0) ||
(request.indexOf(F("st:ssdpsearch:all")) > 0) ||
(request.indexOf(F("st:ssdp:all")) > 0))) {
((request.indexOf(F("urn:schemas-upnp-org:device:basic:1")) > 0) ||
(request.indexOf(F("upnp:rootdevice")) > 0) ||
(request.indexOf(F("ssdpsearch:all")) > 0) ||
(request.indexOf(F("ssdp:all")) > 0))) {
HueRespondToMSearch();
}
}
Expand All @@ -241,48 +245,13 @@ void PollUdp()
\*********************************************************************************************/

const char WEMO_EVENTSERVICE_XML[] PROGMEM =
/*
// Original
"<?scpd xmlns=\"urn:Belkin:service-1-0\"?>"
"<actionList>"
"<action>"
"<name>SetBinaryState</name>"
"<argumentList>"
"<argument>"
"<retval/>"
"<name>BinaryState</name>"
"<relatedStateVariable>BinaryState</relatedStateVariable>"
"<direction>in</direction>"
"</argument>"
"</argumentList>"
"<serviceStateTable>"
"<stateVariable sendEvents=\"yes\">"
"<name>BinaryState</name>"
"<dataType>Boolean</dataType>"
"<defaultValue>0</defaultValue>"
"</stateVariable>"
"<stateVariable sendEvents=\"yes\">"
"<name>level</name>"
"<dataType>string</dataType>"
"<defaultValue>0</defaultValue>"
"</stateVariable>"
"</serviceStateTable>"
"</action>"
"</scpd>\r\n"
"\r\n";
*/

/*
// XosePerez version 20171108 - v2.3.0
"<?xml version=\"1.0\"?>"
"<scpd xmlns=\"urn:Belkin:service-1-0\">"
"<specVersion><major>1</major><minor>0</minor></specVersion>"
"<actionList>"
"<action>"
"<name>SetBinaryState</name>"
"<argumentList>"
"<argument>"
"<retval />"
"<retval/>"
"<name>BinaryState</name>"
"<relatedStateVariable>BinaryState</relatedStateVariable>"
"<direction>in</direction>"
Expand All @@ -307,48 +276,12 @@ const char WEMO_EVENTSERVICE_XML[] PROGMEM =
"<dataType>Boolean</dataType>"
"<defaultValue>0</defaultValue>"
"</stateVariable>"
"<stateVariable sendEvents=\"yes\">"
"<name>level</name>"
"<dataType>string</dataType>"
"<defaultValue>0</defaultValue>"
"</stateVariable>"
"</serviceStateTable>"
"</scpd>";
*/

// Reloxx13 from #1357
"<?scpd xmlns=\"urn:Belkin:service-1-0\"?>"
"<actionList>"
"<action>"
"<name>SetBinaryState</name>"
"<argumentList>"
"<argument>"
"<retval/>"
"<name>BinaryState</name>"
"<relatedStateVariable>BinaryState</relatedStateVariable>"
"<direction>in</direction>"
"</argument>"
"</argumentList>"
"<serviceStateTable>"
"<stateVariable sendEvents=\"yes\">"
"<name>BinaryState</name>"
"<dataType>Boolean</dataType>"
"<defaultValue>0</defaultValue>"
"</stateVariable>"
"<stateVariable sendEvents=\"yes\">"
"<name>level</name>"
"<dataType>string</dataType>"
"<defaultValue>0</defaultValue>"
"</stateVariable>"
"</serviceStateTable>"
"</action>"
"<action>"
"<name>GetBinaryState</name>"
"<argumentList>"
"<argument>"
"<retval/>"
"<name>BinaryState</name>"
"<relatedStateVariable>BinaryState</relatedStateVariable>"
"<direction>out</direction>"
"</argument>"
"</argumentList>"
"</action>"
"</actionList>"
"</scpd>\r\n"
"\r\n";

Expand All @@ -360,8 +293,7 @@ const char WEMO_RESPONSE_STATE_SOAP[] PROGMEM =
"<BinaryState>{x1</BinaryState>"
"</u:SetBinaryStateResponse>"
"</s:Body>"
"</s:Envelope>\r\n"
"\r\n";
"</s:Envelope>\r\n";

const char WEMO_SETUP_XML[] PROGMEM =
"<?xml version=\"1.0\"?>"
Expand All @@ -370,7 +302,7 @@ const char WEMO_SETUP_XML[] PROGMEM =
"<deviceType>urn:Belkin:device:controllee:1</deviceType>"
"<friendlyName>{x1</friendlyName>"
"<manufacturer>Belkin International Inc.</manufacturer>"
"<modelName>Sonoff Socket</modelName>"
"<modelName>Socket</modelName>"
"<modelNumber>3.1415</modelNumber>"
"<UDN>uuid:{x2</UDN>"
"<serialNumber>{x3</serialNumber>"
Expand All @@ -385,7 +317,7 @@ const char WEMO_SETUP_XML[] PROGMEM =
"</service>"
"</serviceList>"
"</device>"
"</root>";
"</root>\r\n";

/********************************************************************************************/

Expand Down

0 comments on commit d683410

Please sign in to comment.