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

Sonoff Wemo Emulation Support #63

Open
gmbytrn opened this issue Jan 25, 2018 · 0 comments
Open

Sonoff Wemo Emulation Support #63

gmbytrn opened this issue Jan 25, 2018 · 0 comments

Comments

@gmbytrn
Copy link

gmbytrn commented Jan 25, 2018

Hi there

I have a Sonoff Basic running Tasmota firmware, these support use via Amazon Alexa by running a Wemo emulator.

Seeing this I manually added my Sonoff device (as discovery did not work) and it returns the device information fine but would not action commands or subscription to events.

I have managed to get the 'setBinaryState' and 'getBinaryState' commands working by adding the "Content-Length" header under 'soapAction' and then inserting the length of the payload string as the data value. It seems that the Wemo emulation on the Sonoff does not support the "Transfer-Encoding: chunked" header which gets applied by default by the 'http.request function' (link) if the "Content-Length" header is not present.

var payload = (body ? xml.ele(body) : xml).end();

  var options = {
    host: this.host,
    port: this.port,
    path: this.services[serviceType].controlURL,
    method: 'POST',
    headers: {
      'SOAPACTION': '"' + serviceType + '#' + action + '"',
      'Content-Type': 'text/xml; charset="utf-8"',
      'Content-Length': payload.length
    }
  };

It does not look like the Wemo emulation currently supports event subscription but I am looking into this currently.

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

No branches or pull requests

1 participant