Sonoff L1 controller for Tasmota

enter image description here

Time for a new product from Sonoff - this time I'm taking Sonoff L1 Lite for a spin, talk about differences and show you how to flash tasmota on it! Complete instructions on

Features:

  • MQTT and REST support
  • Alexa and Google Assitant
  • Colour brightness and toggle

Get Yours

More about me:

If you want to get the latest updates to this project you can follow me via your preferred social media:

And if you feeling like buying me a coffee or supporting me in a more continuous way:

I hope you have enjoyed the project!

[{"id":"b8340591.d43bf8","type":"tab","label":"Sonoff L1 Lite","disabled":false,"info":"![enter image description here](https://notenoughtech.com/wp-content/uploads/2021/01/thumbnail-2.jpg)\n\nTime for a new product from Sonoff - this time I'm taking Sonoff L1 Lite for a spin, talk about differences and show you how to flash tasmota on it! \n[Complete instructions on](https://notenoughtech.com/home-automation/sonoff-l1-lite/)\n\n**Features**:\n\n-  MQTT and REST support\n- Alexa and Google Assitant \n- Colour brightness and toggle \n\n \n## Get Yours\n\n - [Sonoff L1 Lite](http://shrsl.com/2qeh2) \n - [Sonoff L1](http://shrsl.com/2qeh5)\n\n \n## More about me:\n\nIf you want to get the latest updates to this project you can follow me via your preferred social media:\n\n-   [Facebook](https://www.facebook.com/NotEnoughTECH/)\n-   [Twitter](https://twitter.com/NotEnoughTECH)\n-   [Instagram](https://www.instagram.com/notenoughtech/)\n-   [YouTube](https://www.youtube.com/user/Polepositionpage)\n\nAnd if you feeling like buying me a coffee or supporting me in a more continuous way:\n\n-   [Paypal](https://www.paypal.me/notenoughtech)\n-   [Patreon](https://www.patreon.com/NotEnoughTECH)\n\nI hope you have enjoyed the project!"},{"id":"2f4851b2.5c76fe","type":"group","z":"b8340591.d43bf8","name":"Toggle","style":{"stroke":"#92d04f","fill":"#ffffff","label":true,"label-position":"n","color":"#0070c0"},"nodes":["bd141079.5a45c","6ad6a4f2.bf4a5c","8d46bbf.2495248","987075c3.b4cef8","ef747472.e9a8f8"],"x":54,"y":199,"w":612,"h":202},{"id":"5c56af41.e9c53","type":"group","z":"b8340591.d43bf8","name":"Colour","style":{"stroke":"#0070c0","fill":"#bfdbef","label":true,"label-position":"n","color":"#000000"},"nodes":["9454a4d0.f02b88","e76443ae.b6f87","f0360f06.1d6da","a1ed19f9.dcacc8","4180f1c9.16d4d"],"x":64,"y":459,"w":562,"h":182},{"id":"6039f897.4ced88","type":"group","z":"b8340591.d43bf8","name":"Alexa","style":{"stroke":"#92d04f","fill":"#e3f3d3","label":true,"label-position":"n","color":"#001f60"},"nodes":["c4665f12.6616e","4fd9147b.f66fbc","5bd51fa1.784ce"],"x":854,"y":19,"w":552,"h":82},{"id":"82451452.3bbbc8","type":"group","z":"b8340591.d43bf8","name":"Brightness","style":{"stroke":"#3f5787","fill":"#7f7f7f","label":true,"label-position":"n","color":"#ffffff"},"nodes":["aecefa02.516568","d1eb5db1.03e1d","74074a16.d19cb4","58694bfb.b1b414","a47fd110.7f0de","37be32a3.20228e","25f2a1f2.2d7f1e","49d10ab3.2fbae4","fb6f112e.9da9c"],"x":54,"y":679,"w":572,"h":262},{"id":"bcdb7390.e88bf","type":"group","z":"b8340591.d43bf8","name":"Status updates","style":{"stroke":"#ff0000","fill":"#ffbfbf","label":true,"label-position":"n","color":"#001f60"},"nodes":["aed7adc3.9d6ef","4e68e425.49f0bc","7965941a.03d08c"],"x":54,"y":39,"w":612,"h":82},{"id":"f6ccee10.31637","type":"group","z":"b8340591.d43bf8","name":"Google Assistant","style":{"stroke":"#6f2fa0","fill":"#dbcbe7","label":true,"label-position":"n","color":"#ffffff"},"nodes":["d0f25db.b86c6a","6b9ad44e.beb15c","b61c5609.8e0d88"],"x":854,"y":179,"w":542,"h":82},{"id":"aed7adc3.9d6ef","type":"mqtt in","z":"b8340591.d43bf8","g":"bcdb7390.e88bf","name":"Sonoff L1 Lite Status","topic":"SonoffStrip/stat/RESULT","qos":"0","datatype":"json","broker":"6e117ba5.8026e4","x":170,"y":80,"wires":[["4e68e425.49f0bc"]]},{"id":"bd141079.5a45c","type":"mqtt out","z":"b8340591.d43bf8","g":"2f4851b2.5c76fe","name":"Toggle","topic":"SonoffStrip/cmnd/Power","qos":"","retain":"","broker":"6e117ba5.8026e4","x":590,"y":300,"wires":[]},{"id":"6ad6a4f2.bf4a5c","type":"inject","z":"b8340591.d43bf8","g":"2f4851b2.5c76fe","name":"ON","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":150,"y":240,"wires":[["bd141079.5a45c"]]},{"id":"8d46bbf.2495248","type":"inject","z":"b8340591.d43bf8","g":"2f4851b2.5c76fe","name":"OFF","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":150,"y":360,"wires":[["bd141079.5a45c"]]},{"id":"aecefa02.516568","type":"mqtt out","z":"b8340591.d43bf8","g":"82451452.3bbbc8","name":"brightness","topic":"SonoffStrip/cmnd/Dimmer","qos":"","retain":"","broker":"6e117ba5.8026e4","x":530,"y":840,"wires":[]},{"id":"d1eb5db1.03e1d","type":"inject","z":"b8340591.d43bf8","g":"82451452.3bbbc8","name":"Max","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":150,"y":760,"wires":[["aecefa02.516568"]]},{"id":"74074a16.d19cb4","type":"inject","z":"b8340591.d43bf8","g":"82451452.3bbbc8","name":"Min","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":150,"y":720,"wires":[["aecefa02.516568"]]},{"id":"58694bfb.b1b414","type":"random","z":"b8340591.d43bf8","g":"82451452.3bbbc8","name":"","low":"0","high":"100","inte":"true","property":"payload","x":330,"y":800,"wires":[["aecefa02.516568"]]},{"id":"a47fd110.7f0de","type":"inject","z":"b8340591.d43bf8","g":"82451452.3bbbc8","name":"Random","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":800,"wires":[["58694bfb.b1b414"]]},{"id":"9454a4d0.f02b88","type":"mqtt out","z":"b8340591.d43bf8","g":"5c56af41.e9c53","name":"COLOR","topic":"SonoffStrip/cmnd/HSBCOLOR","qos":"","retain":"","broker":"6e117ba5.8026e4","x":540,"y":560,"wires":[]},{"id":"e76443ae.b6f87","type":"inject","z":"b8340591.d43bf8","g":"5c56af41.e9c53","name":"blue","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"novostella/cmnd/HSBCOLOR","payload":"229,98,98","payloadType":"str","x":160,"y":500,"wires":[["9454a4d0.f02b88"]]},{"id":"f0360f06.1d6da","type":"inject","z":"b8340591.d43bf8","g":"5c56af41.e9c53","name":"red","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"novostella/cmnd/HSBCOLOR","payload":"357,97,97","payloadType":"str","x":160,"y":540,"wires":[["9454a4d0.f02b88"]]},{"id":"a1ed19f9.dcacc8","type":"ui_colour_picker","z":"b8340591.d43bf8","g":"5c56af41.e9c53","name":"","label":"","group":"afbc3cd5.d1188","format":"hsv","outformat":"object","showSwatch":true,"showPicker":true,"showValue":true,"showHue":false,"showAlpha":false,"showLightness":true,"square":"false","dynOutput":"false","order":1,"width":8,"height":3,"passthru":true,"topic":"","x":180,"y":600,"wires":[["4180f1c9.16d4d"]]},{"id":"4180f1c9.16d4d","type":"function","z":"b8340591.d43bf8","g":"5c56af41.e9c53","name":"","func":"var h = Math.round(msg.payload.h);\nvar s = msg.payload.s *100;\nvar v = msg.payload.v *100;\n\nmsg.payload = h.toString() +\",\"+s.toString()+\",\" + v.toString();\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":340,"y":600,"wires":[["9454a4d0.f02b88"]]},{"id":"d0f25db.b86c6a","type":"nora-light","z":"b8340591.d43bf8","g":"f6ccee10.31637","devicename":"Sonoff L1","lightcolor":true,"brightnesscontrol":true,"turnonwhenbrightnesschanges":true,"passthru":false,"statepayload":true,"brightnessoverride":"","roomhint":"Office","name":"Sonoff L1","nora":"beababcc.56e388","topic":"","onvalue":"true","onvalueType":"bool","offvalue":"false","offvalueType":"bool","x":940,"y":220,"wires":[["6b9ad44e.beb15c"]]},{"id":"6b9ad44e.beb15c","type":"function","z":"b8340591.d43bf8","g":"f6ccee10.31637","name":"","func":"function convert(y){\n    y = y.toFixed(2)\n    return y;\n}\n\nfunction color_convert(h,s,v){\n    let h1 = Math.round(h);\n    let s1 = convert(s) * 100;\n    let v1 = convert(v) * 100;\n        \n    let z = h1.toString() +\",\"+s1.toString()+\",\" + v1.toString(); \n    return z;\n}\n\nvar msg1 = null;\nvar msg2 = null;\n\n\n\nvar hue = msg.payload.color.spectrumHsv.hue;\nvar sat = msg.payload.color.spectrumHsv.saturation;\nvar val = msg.payload.color.spectrumHsv.value;\n\n// passed value\nvar color_val = color_convert(hue, sat, val);\n\n// current values\nvar data = flow.get(\"SonoffL1\");\t\nvar power = data.POWER;\nvar dimmer = data.Dimmer;\nvar colour = data.HSBColor;\nvar ct = data.CT;\n\n// toggle\nif(msg.payload.on !== power) {\n  msg = {payload: msg.payload.on, topic: \"SonoffStrip/cmnd/Power\"}; \n  return msg;\n}\n\n// dimmer\nif(msg.payload.brightness !== dimmer || color_val === colour) {\n    msg1 = {payload: 350, topic: \"SonoffStrip/cmnd/CT\"};\n    msg2 = {payload: msg.payload.brightness, topic: \"SonoffStrip/cmnd/Dimmer\"};  \n    return [[msg1,msg2]];\n    \n}\n\n// colour\nif(color_val !== colour) {\n    msg1 = {payload: color_val, topic: \"SonoffStrip/cmnd/HSBCOLOR\"};\n    msg2 = {payload: msg.payload.brightness, topic: \"SonoffStrip/cmnd/Dimmer\"};\n    return [[msg1,msg2]];\n}\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1130,"y":220,"wires":[["b61c5609.8e0d88"]]},{"id":"4e68e425.49f0bc","type":"function","z":"b8340591.d43bf8","g":"bcdb7390.e88bf","name":"Sonoff L1 state","func":"var current = flow.get(\"SonoffL1\");\nvar data =  msg.payload;\nvar state;\n\nif(data.POWER === \"ON\"){\n    data.POWER = true;\n    msg.label = \"ON\";\n}\nif(data.POWER === \"OFF\"){\n    data.POWER = false;\n    msg.label = \"OFF\";\n}\nvar save = Object.assign(current, data);\nflow.set(\"SonoffL1\", save);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is deployed.\nflow.set(\"SonoffL1\", {\"POWER\": false})","finalize":"","x":380,"y":80,"wires":[["7965941a.03d08c"]]},{"id":"987075c3.b4cef8","type":"ui_button","z":"b8340591.d43bf8","g":"2f4851b2.5c76fe","name":"","group":"afbc3cd5.d1188","order":4,"width":0,"height":0,"passthru":false,"label":"TOGGLE","tooltip":"","color":"","bgcolor":"","icon":"","payload":"toggle","payloadType":"str","topic":"","x":170,"y":300,"wires":[["ef747472.e9a8f8"]]},{"id":"ef747472.e9a8f8","type":"function","z":"b8340591.d43bf8","g":"2f4851b2.5c76fe","name":"","func":"var data = flow.get(\"SonoffL1\");\n\n\nif(data.POWER === true){\n    msg.payload = false;\n}\nelse{\n    msg.payload = true;\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":350,"y":300,"wires":[["bd141079.5a45c"]]},{"id":"25f2a1f2.2d7f1e","type":"ui_text","z":"b8340591.d43bf8","g":"82451452.3bbbc8","group":"afbc3cd5.d1188","order":5,"width":0,"height":0,"name":"","label":"Brightness","format":"{{msg.payload}}","layout":"col-center","x":530,"y":900,"wires":[]},{"id":"49d10ab3.2fbae4","type":"ui_button","z":"b8340591.d43bf8","g":"82451452.3bbbc8","name":"","group":"afbc3cd5.d1188","order":6,"width":1,"height":1,"passthru":false,"label":"Min","tooltip":"","color":"","bgcolor":"","icon":"","payload":"10","payloadType":"num","topic":"","x":150,"y":860,"wires":[["aecefa02.516568","37be32a3.20228e"]]},{"id":"fb6f112e.9da9c","type":"ui_button","z":"b8340591.d43bf8","g":"82451452.3bbbc8","name":"","group":"afbc3cd5.d1188","order":8,"width":1,"height":1,"passthru":false,"label":"Max","tooltip":"","color":"","bgcolor":"","icon":"","payload":"100","payloadType":"num","topic":"","x":150,"y":900,"wires":[["aecefa02.516568","37be32a3.20228e"]]},{"id":"b61c5609.8e0d88","type":"mqtt out","z":"b8340591.d43bf8","g":"f6ccee10.31637","name":"COLOR","topic":"","qos":"","retain":"","broker":"6e117ba5.8026e4","x":1310,"y":220,"wires":[]},{"id":"37be32a3.20228e","type":"ui_slider","z":"b8340591.d43bf8","g":"82451452.3bbbc8","name":"","label":"","tooltip":"","group":"afbc3cd5.d1188","order":7,"width":6,"height":1,"passthru":true,"outs":"all","topic":"","min":0,"max":"100","step":"5","x":310,"y":900,"wires":[["aecefa02.516568","25f2a1f2.2d7f1e"]]},{"id":"7965941a.03d08c","type":"ui_text","z":"b8340591.d43bf8","g":"bcdb7390.e88bf","group":"afbc3cd5.d1188","order":2,"width":0,"height":0,"name":"Status","label":"Status","format":"{{msg.label}}","layout":"row-spread","x":590,"y":80,"wires":[]},{"id":"c4665f12.6616e","type":"alexa-home","z":"b8340591.d43bf8","g":"6039f897.4ced88","conf":"241b578d.91d228","device":"131398","acknoledge":true,"name":"Sonoff L1","topic":"Sonoff L1","x":940,"y":60,"wires":[["4fd9147b.f66fbc"]]},{"id":"4fd9147b.f66fbc","type":"function","z":"b8340591.d43bf8","g":"6039f897.4ced88","name":"","func":"var command =  msg.command;\n\nif(command === \"TurnOnRequest\" || command === \"TurnOffRequest\"){\n    \n    msg.topic = \"SonoffStrip/cmnd/Power\";\n    return msg;\n}\n\nif(command === \"SetPercentageRequest\"){\n    msg.topic = \"SonoffStrip/cmnd/Dimmer\";\n    return msg;\n}\n\nif(command === \"SetColorRequest\"){\n    var h = Math.round(msg.payload.hue);\n    var s = msg.payload.saturation * 100;\n    var v = msg.payload.brightness * 100;\n    msg.topic = \"SonoffStrip/cmnd/HSBCOLOR\";\n    msg.payload = h.toString() +\",\"+s.toString()+\",\" + v.toString();\n    return msg;\n}\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1120,"y":60,"wires":[["5bd51fa1.784ce"]]},{"id":"5bd51fa1.784ce","type":"mqtt out","z":"b8340591.d43bf8","g":"6039f897.4ced88","name":"COLOR","topic":"","qos":"","retain":"","broker":"6e117ba5.8026e4","x":1320,"y":60,"wires":[]},{"id":"6e117ba5.8026e4","type":"mqtt-broker","name":"MQTT","broker":"home.lan","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"afbc3cd5.d1188","type":"ui_group","name":"Sonoff L1 Strip","tab":"60d9b14b.1b2a6","order":1,"disp":true,"width":"8","collapse":false},{"id":"beababcc.56e388","type":"nora-config","name":"Nora","group":"","notify":false},{"id":"241b578d.91d228","type":"alexa-home-conf","username":"quintaar"},{"id":"60d9b14b.1b2a6","type":"ui_tab","name":"Sonoff L1","icon":"dashboard","disabled":false,"hidden":false}]

Flow Info

Created 11 months, 1 week ago
Rating: 5 1

Actions

Rate:

Node Types

Core
  • function (x5)
  • inject (x7)
  • mqtt in (x1)
  • mqtt out (x5)
  • mqtt-broker (x1)
  • tab (x1)
Other

Tags

  • tasmota
  • sonoff
  • L1
  • RGB
  • LED
  • light
  • strip
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option