Floor standing lamp as a wake-up light. Controll with an ESP8266 and MQTT.
- Use RGBW LED strips with standard driver / controller;
- Big light! 2m tall. LED strips stick to aluminium square profile;
- Clear PVC is clamped between wooden top and foot;
- Keep working remote by intercepting IR-signal and control by sending IR-comands;
- ESP8266 for MQTT integration with Home Assistant;
Current status:
It's been in it's current form since 2015. It works but still needs a cover to diffuse the light. I have been planning to get some kind of stretchy fabric like a sock to cover the PVC pipe.
I seem to have misplaced the Arduino sketch since. This has the proper IR-remote codes so I'm not keen on redoing this work. The MQTT-server, credentials, WiFi SSID and other stuff are hardcoded in, so maybe I have to at some point.
_UPDATE_:
Source code is found!
Files
libraries.zip
IRremoteESP8266 & PubSubClient libraries for Arduino
x-zip-compressed -
228.48 kB -
08/24/2022 at 09:55
It was on an older laptop that got passed along and that I happened to get on my desk for some updates. Anyway, glad to have it. Now I can improve on it, add OTA, MQTT-autodiscover etc.
And try to ignore the big cringe you get when you see your own software from a few years ago :|
#ifndef UNIT_TEST#include<Arduino.h>#endif#include<PubSubClient.h>#include<ESP8266WiFi.h>#include<ESP8266WiFiMulti.h>
ESP8266WiFiMulti WiFiMulti;
#include<WiFiClient.h>#include<WiFiClientSecure.h>#include<WiFiServer.h>#include<WiFiUdp.h>#include<IRremoteESP8266.h>#include<IRsend.h>#include<IRrecv.h>#include<IRutils.h>#define PIN_IRLED 10#define PIN_IRSENSOR 4uint16_t RECV_PIN = PIN_IRSENSOR;
unsignedlong previousMillis = 0;
unsignedlong currentMillis = 0;
constlong interval = 60000;
constchar* ssid = "***";
constchar* password = "***";
IPAddress mqtt_server(192,168,1,***);
char* message = "";
WiFiClient espClient;
PubSubClient client(espClient);
IRsend irsend(PIN_IRLED); // An IR LED is controlled by GPIO pin 4 (D2)IRrecv irrecv(RECV_PIN);
decode_results results;
voidcallback(char* topic, byte* payload, unsignedint length){
Serial.print("Message arrived [");
Serial.print(topic);
Serial.print("] ");
for (int i=0;i<length;i++) {
char receivedChar = (char)payload[i];
Serial.print(receivedChar);
if (receivedChar == '0'){
Serial.println(" - Off received");
client.publish("LEDStalamp/Response"," - ALL OFF received");
irsend.sendNEC(0xFF827D, 32);
irsend.sendNEC(0xFFE817, 32);
}
if (receivedChar == '1'){
Serial.println(" - On received");
client.publish("LEDStalamp/Response"," - ALL ON received");
irsend.sendNEC(0xFF02FD, 32);
irsend.sendNEC(0xFF6897, 32);
}
if (receivedChar == 'U'){
Serial.println("RGB+ received");
client.publish("LEDStalamp/Response"," - RGB+ received");
irsend.sendNEC(0xFF3AC5, 32);
}
if (receivedChar == 'X'){
Serial.println("RGB- received");
client.publish("LEDStalamp/Response"," - RGB- received");
irsend.sendNEC(0xFFBA45, 32);
}
if (receivedChar == 'Y'){
Serial.println("RGB OFF received");
client.publish("LEDStalamp/Response"," - RGB OFF received");
irsend.sendNEC(0xFF827D, 32);
}
if (receivedChar == 'Z'){
Serial.println("RGB ON received");
client.publish("LEDStalamp/Response"," - RGB ON received");
irsend.sendNEC(0xFF02FD, 32);
}
if (receivedChar == 'R'){
Serial.println("RGB RED received");
client.publish("LEDStalamp/Response"," - RGB RED received");
irsend.sendNEC(0xFF1AE5, 32);
}
if (receivedChar == 'G'){
Serial.println("RGB GREEN received");
client.publish("LEDStalamp/Response"," - RGB GREEN received");
irsend.sendNEC(0xFF9A65, 32);
}
if (receivedChar == 'B'){
Serial.println("RGB BLUE received");
client.publish("LEDStalamp/Response"," - RGB BLUE received");
irsend.sendNEC(0xFFA25D, 32);
}
if (receivedChar == 'W'){
Serial.println("RGB WHITE received");
client.publish("LEDStalamp/Response"," - RGB WHITE received");
irsend.sendNEC(0xFF22DD, 32);
}
if (receivedChar == 'C'){
Serial.println("RGB R1 received");
client.publish("LEDStalamp/Response"," - RGB R1 received");
irsend.sendNEC(0xFF2AD5, 32);
}
if (receivedChar == 'D'){
Serial.println("RGB R2 received");
client.publish("LEDStalamp/Response"," - RGB R2 received");
irsend.sendNEC(0xFF0AF5, 32);
}
if (receivedChar == 'E'){
Serial.println("RGB R3 received");
client.publish("LEDStalamp/Response"," - RGB R3 received");
irsend.sendNEC(0xFF38C7, 32);
}
if (receivedChar == 'F'){
Serial.println("RGB R4 received");
client.publish("LEDStalamp/Response"," - RGB R4 received");
irsend.sendNEC(0xFF18E7, 32);
}
if (receivedChar == 'H'){
Serial.println("RGB G1 received");
client.publish("LEDStalamp/Response"," - RGB G1 received");
irsend.sendNEC(0xFFAA55, 32);
}
if (receivedChar == 'I'){
Serial.println("RGB G2 received");
client.publish("LEDStalamp/Response"," - RGB G2 received");
irsend.sendNEC(0xFF8A75, 32);
}
if (receivedChar == 'J'...
Thanks Daren! Wouldn't have thought to use mylar, so great tip. You mean the stuff they use for wrapping flower bouquets? I'll be sure to try this when I can find the time to revisit this.
Use mylar, like 10-20 wraps on the inside of the pipe. The cheap kind for wrapping like gift baskets in a clear-ish crunchy thing. Also, make the ends of your chamber reflective.
It creates much more internal reflection of the lights before they escape, diffusing it very effectively.
Thanks Daren! Wouldn't have thought to use mylar, so great tip. You mean the stuff they use for wrapping flower bouquets? I'll be sure to try this when I can find the time to revisit this.