HowTo: NodeRed – Control the Instagram(*)-Lamp

The article NodeRed/Tasmota – Building an Instagram (*) icon lamp explains how to build your own Instagram (*) lamp. The goal is to link these later with your SmartHome and, for example, to light up as soon as new notifications are available for you.

With the following NodeCode you can now test your selfmade Instagram (*) lamp.

(*) NOTE: Instagram® and the Instagram logo are registered trademarks of Instagram, LLC in the US and other countries.

Hints for our lovely english readers: Basically, many of the articles on Nerdiy.de are translations from the original german articles. Therefore, it may happen here and there that some illustrations are not available in english and that some translations are weird/strange/full of mistakes or generally totaly wrong. So if you find some obvious (or also not obvious) mistakes don't hesitate to leave us a hint about that in the comment section. 
Also please don't get confused, that instead of a "dot" often a "comma" is used as decimal separator. 🙂


Safety instructions

I know the following hints are always a bit annoying and seem unnecessary. But unfortunately, many people who knew it "better" from carelessness lost their eyes, fingers or other things or hurt themselves. In comparison, a loss of data is almost not worth mentioning, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Even the coolest project is worth no injury or other annoyance. https://www.nerdiy.de/sicherheitshinweise/


Requirements

Helpful Articles:
Of course NodeRed should already be installed so that you can take over this configuration.
How to prepare a RaspberryPi and then NodeRed installed on it is described in the following articles.

The following articles describe what to do to prepare the RaspberryPi:
RaspberryPi – Setting up for Nerdiys!
RaspberryPi – The First Configuration!
RaspberryPi – Control the RaspberryPi via SSH
NodeRed – Installing NodeRed on the RaspberryPi
NodeRed – install new nodes

Required tools:
-none-

Required material:

In the following list you will find all the parts you need to implement this article.


In die NodeRed Konfigurationsoberfläche einloggen

Bevor Ihr eure NodeRed Konfiguration bearbeiten könnt müsst Ihr Euch - falls aktiviert - zunächst in die NodeRed Konfigurationsoberfläche einloggen.

Ansicht des Loginbildschirms. Hier müsst Ihr die Logindaten eingeben die Ihr während der Konfiguration des Logins angegeben habt. Infos dazu findet Ihr im Artikel NodeRed - Benutzerlogin einrichten.

Import Node Code

With the following NodeCode you can control your Instagram (*) – lamp. For this you may need to change the name of your lamp (if this is not “instagramLampe”).

To test this code you can easily import it into your NodeRed installation. Tips can be found in the article NodeRed – Import and Export Node Code.

The following color values will work very well – assuming the right LEDs are set to replicate the look of the typical Instagram icon.

  • Corner bottom right: 4f032b
  • Corner top right: 34053d
  • Corner top left: 030240
  • Left center: 34053d
  • Left middle below: 3e0d04
  • Corner bottom left: 492603
Structure of the NodeCode.

Here is the actual NodeCode:

[{"id":"c37bd97.4d1c028","type":"comment","z":"73482476.7e376c","name":"instagramLampe","info":"","x":180,"y":420,"wires":[]},{"id":"d64a497f.f54bc8","type":"function","z":"73482476.7e376c","name":"","func":"if(msg.payload=="on")n    msg.payload=true;nelsen    msg.payload=false;nnreturn msg;","outputs":1,"noerr":0,"x":390,"y":500,"wires":[["a88887de.f43e08"]]},{"id":"210a24e9.26b7ec","type":"link in","z":"73482476.7e376c","name":"konturLampe","links":["1c0fd2a8.9119ad"],"x":415,"y":460,"wires":[["a88887de.f43e08"]]},{"id":"8e8c7bec.df42e8","type":"function","z":"73482476.7e376c","name":"","func":"msg.payload="#"+msg.payload;nreturn msg;","outputs":1,"noerr":0,"x":410,"y":620,"wires":[["8d68e856.9e3a88"]]},{"id":"6c79bfff.2fbff","type":"inject","z":"73482476.7e376c","name":"","topic":"","payload":"#ff9900","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":410,"y":660,"wires":[["8d68e856.9e3a88"]]},{"id":"8d68e856.9e3a88","type":"mqtt out","z":"73482476.7e376c","name":"","topic":"cmnd/instagramLampe/Color","qos":"","retain":"","broker":"c94e86db.dfcde8","x":640,"y":620,"wires":[]},{"id":"2e2fba16.94c916","type":"link in","z":"73482476.7e376c","name":"","links":[],"x":435,"y":700,"wires":[["8d68e856.9e3a88"]]},{"id":"d1278e63.990fe","type":"ui_colour_picker","z":"73482476.7e376c","name":"","label":"instagramLampe","group":"9efc6f05.1b9a2","format":"hex","outformat":"string","showSwatch":true,"showPicker":true,"showValue":true,"showHue":false,"showAlpha":true,"showLightness":true,"dynOutput":"false","order":27,"width":0,"height":0,"passthru":true,"topic":"","x":210,"y":620,"wires":[["8e8c7bec.df42e8","47598a20.b9de44"]]},{"id":"8b7d95f3.cf93f8","type":"ui_switch","z":"73482476.7e376c","name":"","label":"instagramLampe","group":"5303eeb6.d88a3","order":23,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":710,"y":560,"wires":[["a88887de.f43e08"]]},{"id":"a88887de.f43e08","type":"Sonoff device","z":"73482476.7e376c","mode":"0","broker":"c94e86db.dfcde8","device":"instagramLampe","name":"","onValue":"ON","offValue":"OFF","cmdPrefix":"cmnd","statPrefix":"stat","telePrefix":"tele","x":710,"y":500,"wires":[["8b7d95f3.cf93f8"]]},{"id":"13da8df0.cf29c2","type":"alexa-local","z":"73482476.7e376c","devicename":"instagramLampe","inputtrigger":false,"x":210,"y":500,"wires":[["d64a497f.f54bc8"]]},{"id":"9ffab097.22d1d","type":"ui_slider","z":"73482476.7e376c","name":"","label":"instagramLampe","group":"f54c9fbb.228b6","order":0,"width":0,"height":0,"passthru":true,"topic":"","min":0,"max":"100","step":1,"x":210,"y":560,"wires":[["87b7d7f7.0a6f08"]]},{"id":"87b7d7f7.0a6f08","type":"mqtt out","z":"73482476.7e376c","name":"","topic":"cmnd/instagramLampe/Dimmer","qos":"","retain":"","broker":"c94e86db.dfcde8","x":450,"y":560,"wires":[]},{"id":"de827df6.6eb21","type":"inject","z":"73482476.7e376c","name":"","topic":"","payload":"#1e22e1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":420,"y":740,"wires":[["8d68e856.9e3a88"]]},{"id":"47598a20.b9de44","type":"debug","z":"73482476.7e376c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":390,"y":780,"wires":[]},{"id":"c94e86db.dfcde8","type":"mqtt-broker","z":"","name":"Server-Mqtt","broker":"server.fritz.box","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"9efc6f05.1b9a2","type":"ui_group","z":"","name":"Licht-Farbe","tab":"b29a978f.019318","disp":true,"width":"6","collapse":false},{"id":"5303eeb6.d88a3","type":"ui_group","z":"","name":"Licht","tab":"b29a978f.019318","disp":true,"width":"6","collapse":false},{"id":"f54c9fbb.228b6","type":"ui_group","z":"","name":"Licht-Helligkeit","tab":"b29a978f.019318","disp":true,"width":"6","collapse":false},{"id":"b29a978f.019318","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

I hope everything worked as described. If not or you have any other questions or suggestions, please let me know in the comments. Also, ideas for new projects are always welcome. 🙂

Fab

P.S. Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you appreciate it that I share these information with you, I would be happy about a small donation to the coffee box. 🙂

Buy Me a Coffee at ko-fi.com

Leave a Reply

Your email address will not be published. Required fields are marked *