Close
0%
0%

Sunset lamp

A lamp the changes with the sun

Similar projects worth following
replaced the inards of a basic lamp with 2 neopixel rings, and an esp8266

github repo for the arduino code:

https://github.com/Br3nda/thing-restful-rgb-lamp/blob/master/thing_wifi_lamp.ino

  • 1 × old lamp, that expects 5V usb power
  • 1 × esp8266
  • 2 × neopixel rings

View all 8 project logs

  • 1
    Step 1

    OpenHAB items:

    Switch Lamp_Switch "Lamp"
    
    String Lamp_Red  "Lamp Red"
    
    String Lamp_Green "Lamp Green"
    
    String Lamp_Blue "Lamp Blue"
    
    String Lamp_Brightness "Lamp Brightness"

    OpenHAB Rules

    rule "Turn Lamp off"
    when 
        Item Lamp_Switch received command OFF
    then
        sendHttpGetRequest("http://10.1.1.83/lamp/OFF")
    end
    
    rule "Turn Lamp on"
    when 
        Item Lamp_Switch received command ON
    then
        sendHttpGetRequest("http://10.1.1.83/lamp/ON")
    end
    
    rule "Change lamp brightness"
    when
        Item Lamp_Brightness received command
    then
        sendHttpGetRequest("http://10.1.1.83/lamp/brightness/" + receivedCommand)
        postUpdate(Lamp_Brightness, "")
    end
    
    rule "Change lamp red level"
    when
        Item Lamp_Red received command
    then
        sendHttpGetRequest("http://10.1.1.83/lamp/red/" + receivedCommand)
        postUpdate(Lamp_Red, "")
    end
    
    rule "Change lamp green level"
    when
        Item Lamp_Green received command
    then
        sendHttpGetRequest("http://10.1.1.83/lamp/green/" + receivedCommand)
        postUpdate(Lamp_Green, "")
    end
    
    rule "Change lamp blue level"
    when
        Item Lamp_Blue received command
    then
        sendHttpGetRequest("http://10.1.1.83/lamp/blue/" + receivedCommand)
        postUpdate(Lamp_Blue, "")
    end
    

    OpenHAB Sitemap

    sitemap lamp label="Lamp"
    {
      Frame label="Lamp controls" icon="lamp" { 
        Switch item=Lamp_Switch
        Switch item=Lamp_Brightness mappings=["DOWN"='-', "UP"='+']
        Switch item=Lamp_Red mappings=["DOWN"='-', "UP"='+']
        Switch item=Lamp_Green mappings=["DOWN"='-', "UP"='+']
        Switch item=Lamp_Blue mappings=["DOWN"='-', "UP"='+']
      }
    }
    

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates