Giter VIP home page Giter VIP logo

Comments (6)

riban-bw avatar riban-bw commented on August 9, 2024 1

That almost works. You need to add a condition around the SetBinaryState, e.g.

if(request.indexOf("SetBinaryState") >= 0) {
        if(request.indexOf("<BinaryState>1</BinaryState>") >= 0) {
            Serial.println("Got Turn on request");
            turnOnRelay();
        }
  
        if(request.indexOf("<BinaryState>0</BinaryState>") >= 0) {
            Serial.println("Got Turn off request");
            turnOffRelay();
        }
      }

Also, although the code works, sendRelayState() should use u:GetBinaryStateResponse tag, not u:SetBinaryStateResponse tag.

You don't need the trailing "\r\n" in the GetBinaryStateResponse.

I am not sure why my attempts to implement this failed!

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024 1

Can you check this and verify on your gen 2, please?

https://gist.github.com/kakopappa/02299a8ceec0aaaad3ea3bd7f2af8066

diff:
https://gist.github.com/kakopappa/02299a8ceec0aaaad3ea3bd7f2af8066/revisions
If it working for you. I will retest on my eco and update the project.

Thanks a lot

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024

https://gist.github.com/kakopappa/02299a8ceec0aaaad3ea3bd7f2af8066

can you give this a try and let me know.

from arduino-esp8266-alexa-multiple-wemo-switch.

riban-bw avatar riban-bw commented on August 9, 2024

Sorry for delay - two of my ESP8266 modules died! The code works but I had to make some changes for my device:

const int relayPin = D1; //D1 is not recognised as a constant by most ESP8266 boards in Arduino. Suggest using universal constant

connectWifi() does not connect to wifi. I used WiFiManager to get it working. I don't know why your code does not work for me. (Yes I did set SSID / password!)

from arduino-esp8266-alexa-multiple-wemo-switch.

tommyfranke avatar tommyfranke commented on August 9, 2024

Hi all.
@kakopappa, thank's for the great work.
The above code works wonderful on my new Amazon Dot V2 with actual Firmware 595459620.
My Nodemcu was found at once, you don't need the Wemo-Skill!!!

@riban-bw
you have to increase the wait time of 5 seconds in connectWifi() to about 10 or more seconds.
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
if (i > 20){ //--------------------increase to your needs
state = false;
break;
}
i++;
}

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024

thanks, code updated.

from arduino-esp8266-alexa-multiple-wemo-switch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.