kakopappa / arduino-esp8266-alexa-multiple-wemo-switch

multiple belkin wemos switch emulator using ESP8266
https://sinric.pro
MIT License
308 stars 196 forks source link

Help with multiple RCSwtich.h devices? #64

Open stickboy135 opened 5 years ago

stickboy135 commented 5 years ago

Hi - I'm new to this, so please bear with me. I have two RC devices (Christmas tree and fireplace). I'd like to use one ESP8266 board (and 303MHz transmitter) to control both, and this sketch seems like it would work. Note - I previously used the earlier single switch version of your code (which is a lot more complex, and I was having some discovery issues i'm working through). I am able to properly control both devices using a simple webserver sketch however.

Here is my question - I think there are some fundamental differences between rcswitch.h and switch.h. Can you give me a few pointers on how to use the rcswitch library instead of switch.h? For example, I dont think the server loop function works, and the creation of the rcswitch object in fundamentally different. How do I intercept a request, determine which device is being requested, and then execute the proper on/off function? In your single switch version, binarystate tells me on/off, but i wasn't sure how to modify that to control two devices, which is why this version looks more attractive, but not sure how to use rcswitch instead of switch.h. Any pointers?