A library for Mongoose OS to emulate a WEMO UPnP plug in Amazon Alexa. It is possible to emulate more than one plug per device.
Add a new instance using
bool alexa_wemo_add_instance(char *name, int relay_pin);
where name
is the friendly name of the emulated device, and relay_pin
the
GPIO pin to toggle. Returns true if no error occurred. Each instance emulates
a separate device, and there is a limit of 16 instances per device, so a single
esp8266 can emulate max. 16 plugs to toggle max. 16 GPIO pins. Adding more than
two instances per device, however, can currently lead to unstable behaviour.
Due to limitations in Alexas UPnP implementation for WEMO devices, each added instance will bind to a separate port, starting with the one specified in the libraries config.
This library is based on a blog post over at makermusings.com and code from kakopappas Alexa WEMO switch.