Tell us about yourself!

Complete Your Profile
  • How to Connect Your Somfy Remote to Alexa With an ESP8266 to Control Your Motorized Blinds

    https://github.com/anil-gangwani/4-devices-with-le...I believe it came from here... I moved out of the flat with the Somfy blinds and so haven't used this in many months unfortunately.

    View Instructable »
  • How to Connect Your Somfy Remote to Alexa With an ESP8266 to Control Your Motorized Blinds

    Hi Tich1 - I wasn't able to get the Fauxmo library approach to work, so I adapted another bit of sample code I found.#include <ESP8266WiFi.h>#include <ESP8266WebServer.h>#include <WiFiUdp.h>#include <functional>#include "switch.h"#include "UpnpBroadcastResponder.h"#include "CallbackFunction.h"// prototypesboolean connectWifi();//on/off callbacksbool loungeShadesUp();bool loungeShadesDown();bool kitchenLightsOn();bool kitchenLightsOff();// Change this before you flashconst char* ssid = "YOUR_WIFI_SSID";const char* password = "YOUR_WIFI_PASSWORD";boolean wifiConnected = false;UpnpBroadcastResponder upnpBroadcastResponder;#define UP D1#define DOWN D2Switch *lounge = NULL;Switch *kitchen = NULL;bool isloungeSh...

    see more »

    Hi Tich1 - I wasn't able to get the Fauxmo library approach to work, so I adapted another bit of sample code I found.#include <ESP8266WiFi.h>#include <ESP8266WebServer.h>#include <WiFiUdp.h>#include <functional>#include "switch.h"#include "UpnpBroadcastResponder.h"#include "CallbackFunction.h"// prototypesboolean connectWifi();//on/off callbacksbool loungeShadesUp();bool loungeShadesDown();bool kitchenLightsOn();bool kitchenLightsOff();// Change this before you flashconst char* ssid = "YOUR_WIFI_SSID";const char* password = "YOUR_WIFI_PASSWORD";boolean wifiConnected = false;UpnpBroadcastResponder upnpBroadcastResponder;#define UP D1#define DOWN D2Switch *lounge = NULL;Switch *kitchen = NULL;bool isloungeShadesUp = false;void setup(){ Serial.begin(9600); // Setup the control pins pinMode(DOWN, OUTPUT); pinMode(UP, OUTPUT); digitalWrite(DOWN, HIGH); // Set UP and DOWN HIGH so the remote doesn't activate on start up digitalWrite(UP, HIGH); // Initialise wifi connection wifiConnected = connectWifi(); if (wifiConnected) { upnpBroadcastResponder.beginUdpMulticast(); // Define your switches here. Max 10 // Format: Alexa invocation name, local port no, on callback, off callback lounge = new Switch("Lounge Shades", 80, loungeShadesUp, loungeShadesDown); Serial.println("Adding switches upnp broadcast responder"); upnpBroadcastResponder.addDevice(*lounge); //upnpBroadcastResponder.addDevice(*kitchen); }}void loop(){ if (wifiConnected) { upnpBroadcastResponder.serverLoop(); //kitchen->serverLoop(); lounge->serverLoop(); }}bool loungeShadesUp() { Serial.print("Opening shades... "); digitalWrite(UP, LOW); delay(5000); digitalWrite(UP, HIGH); Serial.println("OK"); isloungeShadesUp = true; return isloungeShadesUp;}bool loungeShadesDown() { Serial.print("Closing shades... "); digitalWrite(DOWN, LOW); delay(5000); digitalWrite(DOWN, HIGH); Serial.println("OK"); isloungeShadesUp = false; return isloungeShadesUp;}// connect to wifi – returns true if successful or false if notboolean connectWifi() { boolean state = true; int i = 0; WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); Serial.println(""); Serial.println("Connecting to WiFi"); // Wait for connection Serial.print("Connecting ..."); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); if (i > 10) { state = false; break; } i++; } if (state) { Serial.println(""); Serial.print("Connected to "); Serial.println(ssid); Serial.print("IP address: "); Serial.println(WiFi.localIP()); } else { Serial.println(""); Serial.println("Connection failed."); } return state;}

    View Instructable »