-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New fuctionality for celing and white bulb #10
Comments
@arripeo would you please so good to give me your code, i also use the ceiling light and run into the set_scene issue. thanks |
Hi, I also have the ceiling Light and is also interested in The code. |
Can you please share it with is? @arripeo |
Let me the time i will give you the code and description
…On Sat, 6 Oct 2018, 09:52 bednim, ***@***.***> wrote:
Can you please share it with is? @arripeo <https://github.com/arripeo>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ak_6DsexcJuo9WhqAv1TlmMSydCA_UlXks5uiGEjgaJpZM4V4NTF>
.
|
Try it |
index.txt |
try this flow with openhab node |
I hope that every thing gone well |
I don't know if you have recieved every thing let me know |
I re-paste yeelight-compat-hue-out.txt |
[{"id":"2b452407.c4036c","type":"comment","z":"9c144eca.e35f1","name":"General Notes","info":"Lo swicth su OpenHab è un dummy, non è legato ad alcuna Things\nNoi leggiamo il suo cambio di stato da Sitemap\nCon i noi di tipo Switch e Change abbiamo costruito\nuna condizione di tipo IF per valutare l'ON o OFF\nAlla Yeelight passiamo una stringa con il campo\n"on" su True o False. C'è anche una durata per il tempo\ndi passaggio dello stato in ms.\nDalla Yeelight riceviamo un oggetto che ci dà lo stato\ndella luce, con tutte le sue prop. Noi estraiamo\ndalla sezione "raw" lo stato del power e lo iniettiamo\nnello swicth dummy sulla sitemap.\nPer valutare lo stato della linea, ossia se\nla lampada è collegata in rete, usiamo l'item\nlegato alla Thing del bundle Network mappata su Openhab\nLo stato di linea viene passato ad timer che ogni 5 sec fa il refresh\ndello stato alla Yeelight. In questo modo si evita il frozen\ndella comunicazione che a volte poteva avvenire\ndopo lo spegnimeto della lampada da rete elettrica\n\n","x":830,"y":50,"wires":[]},{"id":"3d19086f.5a8298","type":"openhab2-out","z":"9c144eca.e35f1","name":"Power status","controller":"5d48dc.750ee724","itemname":"Lampada450","topic":"ItemUpdate","payload":"","x":930,"y":180,"wires":[]},{"id":"9792b2e9.f94ed","type":"openhab2-in","z":"9c144eca.e35f1","name":"Power Swicth","controller":"5d48dc.750ee724","itemname":"Lampada450","x":130,"y":50,"wires":[["607fae0a.d6eb2"],[]],"outputLabels":["State","Object"]},{"id":"607fae0a.d6eb2","type":"switch","z":"9c144eca.e35f1","name":"Command LED","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":44,"wires":[["ddf5181c.c978e8"],["196f4b93.163654"]]},{"id":"50bc87.157ac378","type":"openhab2-in","z":"9c144eca.e35f1","name":"Light450 line","controller":"5d48dc.750ee724","itemname":"NetCeiling450_Online","x":122,"y":406,"wires":[["da2bd344.0d4b6"],[]]},{"id":"e7eef76b.4f1658","type":"switch","z":"9c144eca.e35f1","name":"Power Status","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":584,"y":223,"wires":[["22fcbff0.d711"],["7823b77d.064088"]]},{"id":"22fcbff0.d711","type":"change","z":"9c144eca.e35f1","name":"Status ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":170,"wires":[["3d19086f.5a8298"]]},{"id":"7823b77d.064088","type":"change","z":"9c144eca.e35f1","name":"Status OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":200,"wires":[["3d19086f.5a8298"]]},{"id":"196f4b93.163654","type":"change","z":"9c144eca.e35f1","name":"Power OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"on":false,"duration":1000}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":584,"y":70,"wires":[["687b95bd.03f8ec"]]},{"id":"ddf5181c.c978e8","type":"change","z":"9c144eca.e35f1","name":"Power ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"on":true,"duration":1000}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":584,"y":40,"wires":[["687b95bd.03f8ec"]]},{"id":"44affd04.080b14","type":"openhab2-in","z":"9c144eca.e35f1","name":"Brigth Luce","controller":"5d48dc.750ee724","itemname":"Lampada450_bright","x":130,"y":100,"wires":[["fc377f4b.4be0a"],[]]},{"id":"ff461ebb.06e4d","type":"openhab2-in","z":"9c144eca.e35f1","name":"Colortem","controller":"5d48dc.750ee724","itemname":"Lampada450_tempcolor","x":120,"y":150,"wires":[["3de31a15.9e3a96"],[]]},{"id":"57f0bcc5.cbe9e4","type":"change","z":"9c144eca.e35f1","name":"Sun mode","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"on":true, "duration":1000, "moon":1}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":584,"y":160,"wires":[["687b95bd.03f8ec"]]},{"id":"6376d290.aa7e0c","type":"openhab2-out","z":"9c144eca.e35f1","name":"","controller":"5d48dc.750ee724","itemname":"Lampada450_bright","topic":"ItemUpdate","payload":"","x":640,"y":350,"wires":[]},{"id":"a562c03.e3da84","type":"function","z":"9c144eca.e35f1","name":"Splitting Yeelight feedback","func":"var msg1 = {payload:msg.payload.raw.power};\nvar msg2 = {payload:msg.payload.raw.nl_br};\nvar msg3 = {payload:msg.payload.raw.ct};\nvar msg4 = {payload:msg.payload.raw.bright};\nif (+msg.payload.raw.nl_br > 0){\nmsg4 = {payload:msg.payload.raw.nl_br};\n}\nvar msg5 = {payload:msg.payload.raw.sat};\nreturn [msg1, msg2, msg3, msg4, msg5];","outputs":5,"noerr":0,"x":390,"y":280,"wires":[["e7eef76b.4f1658"],["91d1950d.d66d58"],["af41be0c.9914d"],["6376d290.aa7e0c"],[]]},{"id":"af41be0c.9914d","type":"openhab2-out","z":"9c144eca.e35f1","name":"Color temperature status","controller":"5d48dc.750ee724","itemname":"Lampada450_tempcolor","topic":"ItemUpdate","payload":"","x":650,"y":310,"wires":[]},{"id":"fc377f4b.4be0a","type":"function","z":"9c144eca.e35f1","name":"Bright","func":"var bright = parseInt(msg.payload);\nmsg.payload = {"bri":bright, "scnon":true};\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":90,"wires":[["d92352a8.ef443"]]},{"id":"3de31a15.9e3a96","type":"function","z":"9c144eca.e35f1","name":"Color Temp","func":"var Ctemperature = msg.payload;\nmsg.payload = {"ct":Ctemperature};\nreturn msg;","outputs":1,"noerr":0,"x":320,"y":125,"wires":[["d92352a8.ef443"]]},{"id":"d08df6da.0d9c88","type":"change","z":"9c144eca.e35f1","name":"Night mode","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"on":true,"duration":1000, "moon":5}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":584,"y":130,"wires":[["687b95bd.03f8ec"]]},{"id":"d92352a8.ef443","type":"join","z":"9c144eca.e35f1","name":"Make Scene Object","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":604,"y":100,"wires":[["687b95bd.03f8ec"]]},{"id":"91d1950d.d66d58","type":"switch","z":"9c144eca.e35f1","name":"Moon Status","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":588,"y":257,"wires":[["e2bbbb6c.f30288"],["bf5e091.a0a5af8"]]},{"id":"e2bbbb6c.f30288","type":"change","z":"9c144eca.e35f1","name":"Moon ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":240,"wires":[["56f61c56.598614"]]},{"id":"bf5e091.a0a5af8","type":"change","z":"9c144eca.e35f1","name":"Moon OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":270,"wires":[["56f61c56.598614"]]},{"id":"56f61c56.598614","type":"openhab2-out","z":"9c144eca.e35f1","name":"Moon status","controller":"5d48dc.750ee724","itemname":"Lampada450_Moon","topic":"ItemUpdate","payload":"","x":930,"y":240,"wires":[]},{"id":"b1069cec.6e49e","type":"switch","z":"9c144eca.e35f1","name":"Moon cmd","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":160,"wires":[["d08df6da.0d9c88"],["57f0bcc5.cbe9e4"]]},{"id":"b6c53156.69441","type":"openhab2-in","z":"9c144eca.e35f1","name":"Moon Swicth","controller":"5d48dc.750ee724","itemname":"Lampada450_Moon","x":130,"y":200,"wires":[["b1069cec.6e49e"],[]],"outputLabels":["State","Object"]},{"id":"f0c1f656.c952f8","type":"function","z":"9c144eca.e35f1","name":"ToggleSW","func":"var CHtrig = msg.payload.event;\nvar CHname = msg.payload.channel;\nif (CHtrig == "SHORT_PRESSED" && CHname =="mihome:86sw2:158d00027042c6:ch1" ){\n msg.payload = '{"toggl":true}';\n return msg;\n }\n","outputs":1,"noerr":0,"x":580,"y":190,"wires":[["687b95bd.03f8ec"]]},{"id":"da2bd344.0d4b6","type":"trigger","z":"9c144eca.e35f1","op1":"true","op2":"0","op1type":"bool","op2type":"str","duration":"-5","extend":false,"units":"s","reset":"OFF","bytopic":"all","name":"","x":290,"y":400,"wires":[["28cfec3c.f89634"]]},{"id":"e2679df8.7ee1a","type":"openhab2-events","z":"9c144eca.e35f1","name":"Event2","controller":"5d48dc.750ee724","itemname":"","x":310,"y":200,"wires":[["f0c1f656.c952f8"]]},{"id":"28cfec3c.f89634","type":"yeelight-compat-hue-state","z":"9c144eca.e35f1","name":"Yeelight 450 status","server":"66a61b82.f21954","x":160,"y":270,"wires":[["a562c03.e3da84"]]},{"id":"687b95bd.03f8ec","type":"yeelight-compat-hue-out","z":"9c144eca.e35f1","name":"Yeelight 450 Command","server":"66a61b82.f21954","x":830,"y":100,"wires":[]},{"id":"eaa0a7a4.323178","type":"openhab2-events","z":"9c144eca.e35f1","name":"Event Mini Swicth","controller":"5d48dc.750ee724","itemname":"","x":130,"y":490,"wires":[["5bfdcae7.6d2ae4"]]},{"id":"5bfdcae7.6d2ae4","type":"function","z":"9c144eca.e35f1","name":"SW pulse","func":"var CHtrig = msg.payload.event;\nvar CHname = msg.payload.channel;\nif (CHtrig === "SHORT_PRESSED" && CHname ==="mihome:86sw2:158d00027042c6:dual_ch" ){\n msg.payload = {"press":1};\n return msg;\n }\n","outputs":1,"noerr":0,"x":290,"y":490,"wires":[["3127d87c.dd3448"]]},{"id":"3127d87c.dd3448","type":"openhab2-get","z":"9c144eca.e35f1","name":"check state","controller":"5d48dc.750ee724","itemname":"Lampada450_Moon","x":440,"y":490,"wires":[["2c22ad05.ccb992"]]},{"id":"2c22ad05.ccb992","type":"switch","z":"9c144eca.e35f1","name":"Moon cmd","property":"payload.state","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":600,"y":490,"wires":[["57f0bcc5.cbe9e4"],["d08df6da.0d9c88"]]},{"id":"5d48dc.750ee724","type":"openhab2-controller","z":"","name":"openhab suno","protocol":"http","host":"openhabianpi.local","port":"8080","path":"","username":"","password":""},{"id":"66a61b82.f21954","type":"yeelight-compat-hue-config","z":"","hostname":"192.168.1.105","port":"55443","name":"Yeelight 450 hub"}] |
hello @arripeo thank you very much for that! so, as a noob - where do i put this information? thanks!!! |
@bednim you have to copy and replace the file of yeelight-compat-hue-out in the diretory /.node-red/node_modules/node-red-contrib-yeelight-compat-hue/dist (pay attention that the diractory should be on your node red user folder in hedden way) and you have to copy the index.js file under the directory /.node-red/node_modules/yeelight2 |
@arripeo hi my friend, I have just done it but unfortunately it doesn't work. |
@bednim do you have stop the node red service and restat it? |
@bednim do you have copied my flow with your yeeligth configuration network? |
@bednim do you have copied my flow with your yeeligth configuration network? |
@arripeo hi, I have restarted my pi with node red but I haven't imported your flow. I'm out now so I'll do it when I'm back. Thank you |
@bednim ok try it, remeber that this is a test as no a new node_module is alredy made, so the functionality is not garantee. I hope in the help of @macmattes to make a new module |
@arripeo hello my friend - i have just tried to import your flow but node red won't let me. nevertheless - thank you very much for your time to post it here. maybe someone can one day implement it into the node. thank you once again. |
@bednim what does it mean that you can't import the flow? you have just to copy and paste or copy and import from clipboard |
@arripeo yep i went to import your flow from clipboard and i simply cant - import button is greyed out. to check i have imported different flow and all went smooth. strange. do you want to export it once again? thnks |
@bednim do you have the openhab module? |
@arripeo - no i dont. but not having module installed didnt stop me
importing flows in the past.
…On Sun, 7 Oct 2018 at 18:37, arripeo ***@***.***> wrote:
@bednim <https://github.com/bednim> do you have the openhab module?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ap2IlGNqFIJ1ur5YDYX9Wq8B36Kb5Xz5ks5uijvugaJpZM4V4NTF>
.
|
@bednim try with this semplyfied version [{"id":"3a9386fb.93350a","type":"switch","z":"79e72025.101b","name":"Command LED","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":400,"y":94,"wires":[["fa8bf6db.efaa98"],["96357c83.7f2c8"]]},{"id":"5af96e8f.4849d","type":"switch","z":"79e72025.101b","name":"Power Status","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":654,"y":273,"wires":[["2f68fa3c.8dce36"],["4d57257.2aa3cdc"]]},{"id":"2f68fa3c.8dce36","type":"change","z":"79e72025.101b","name":"Status ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":220,"wires":[[]]},{"id":"4d57257.2aa3cdc","type":"change","z":"79e72025.101b","name":"Status OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":250,"wires":[[]]},{"id":"96357c83.7f2c8","type":"change","z":"79e72025.101b","name":"Power OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"on":false,"duration":1000}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":654,"y":120,"wires":[["705cc8ec.4431a8"]]},{"id":"fa8bf6db.efaa98","type":"change","z":"79e72025.101b","name":"Power ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"on":true,"duration":1000}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":654,"y":90,"wires":[["705cc8ec.4431a8"]]},{"id":"fb738969.278e08","type":"change","z":"79e72025.101b","name":"Sun mode","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"on":true, "duration":1000, "moon":1}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":654,"y":210,"wires":[["705cc8ec.4431a8"]]},{"id":"ee1ac317.ec23f","type":"function","z":"79e72025.101b","name":"Splitting Yeelight feedback","func":"var msg1 = {payload:msg.payload.raw.power};\nvar msg2 = {payload:msg.payload.raw.nl_br};\nvar msg3 = {payload:msg.payload.raw.ct};\nvar msg4 = {payload:msg.payload.raw.bright};\nif (+msg.payload.raw.nl_br > 0){\nmsg4 = {payload:msg.payload.raw.nl_br};\n}\nvar msg5 = {payload:msg.payload.raw.sat};\nreturn [msg1, msg2, msg3, msg4, msg5];","outputs":5,"noerr":0,"x":440,"y":300,"wires":[["5af96e8f.4849d"],["ce11440.3e516c"],[],[],[]]},{"id":"ac683013.57c05","type":"function","z":"79e72025.101b","name":"Bright","func":"var bright = parseInt(msg.payload);\nmsg.payload = {"bri":bright, "scnon":true};\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":140,"wires":[["b951e595.4cf358"]]},{"id":"ac33e9c0.c07da8","type":"function","z":"79e72025.101b","name":"Color Temp","func":"var Ctemperature = msg.payload;\nmsg.payload = {"ct":Ctemperature};\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":175,"wires":[["b951e595.4cf358"]]},{"id":"101ac85b.78b1b8","type":"change","z":"79e72025.101b","name":"Night mode","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"on":true,"duration":1000, "moon":5}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":654,"y":180,"wires":[["705cc8ec.4431a8"]]},{"id":"b951e595.4cf358","type":"join","z":"79e72025.101b","name":"Make Scene Object","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":674,"y":150,"wires":[["705cc8ec.4431a8"]]},{"id":"ce11440.3e516c","type":"switch","z":"79e72025.101b","name":"Moon Status","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":658,"y":307,"wires":[["e0c4aa99.d8f368"],["f6e5081.55838f8"]]},{"id":"e0c4aa99.d8f368","type":"change","z":"79e72025.101b","name":"Moon ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":290,"wires":[[]]},{"id":"f6e5081.55838f8","type":"change","z":"79e72025.101b","name":"Moon OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":320,"wires":[[]]},{"id":"211b52e5.50329e","type":"switch","z":"79e72025.101b","name":"Moon cmd","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":210,"wires":[["101ac85b.78b1b8"],["fb738969.278e08"]]},{"id":"ead6a234.35a53","type":"function","z":"79e72025.101b","name":"ToggleSW","func":"var CHtrig = msg.payload.event;\nvar CHname = msg.payload.channel;\nif (CHtrig == "SHORT_PRESSED" && CHname =="mihome:86sw2:158d00027042c6:ch1" ){\n msg.payload = '{"toggl":true}';\n return msg;\n }\n","outputs":1,"noerr":0,"x":650,"y":240,"wires":[["705cc8ec.4431a8"]]},{"id":"b6927889.0c8238","type":"yeelight-compat-hue-state","z":"79e72025.101b","name":"Yeelight 450 status","server":"66a61b82.f21954","x":160,"y":300,"wires":[["ee1ac317.ec23f"]]},{"id":"705cc8ec.4431a8","type":"yeelight-compat-hue-out","z":"79e72025.101b","name":"Yeelight 450 Command","server":"66a61b82.f21954","x":900,"y":150,"wires":[]},{"id":"66a61b82.f21954","type":"yeelight-compat-hue-config","z":"","hostname":"192.168.1.105","port":"55443","name":"Yeelight 450 hub"}] |
@bednim no you are right, also for me is not possible to re-import. Please wait I'll try to solve it |
@bednim try now [{"id":"1616237a.7c85ed","type":"tab","label":"Control Yeelight Bagno 1","disabled":false,"info":""},{"id":"8f4cf61d.c2fb48","type":"yeelight-compat-hue-state","z":"1616237a.7c85ed","name":"Yeelight Bagno 1","server":"1d88a787.432ce8","x":150,"y":260,"wires":[["595b436c.231c4c"]]},{"id":"b8e3402f.cdd72","type":"comment","z":"1616237a.7c85ed","name":"General Notes","info":"Lo swicth su OpenHab è un dummy, non è legato ad alcuna Things\nNoi leggiamo il suo cambio di stato da Sitemap\nCon i noi di tipo Switch e Change abbiamo costruito\nuna condizione di tipo IF per valutare l'ON o OFF\nAlla Yeelight passiamo una stringa con il campo\n"on" su True o False. C'è anche una durata per il tempo\ndi passaggio dello stato in ms.\nDalla Yeelight riceviamo un oggetto che ci dà lo stato\ndella luce, con tutte le sue prop. Noi estraiamo\ndalla sezione "raw" lo stato del power e lo iniettiamo\nnello swicth dummy sulla sitemap.\nPer valutare lo stato della linea, ossia se\nla lampada è collegata in rete, usiamo l'item\nlegato alla Thing del bundle Network mappata su Openhab\nLo stato di linea viene passoto ad un item dummy di tipo string\nche riporta lo stato di linea sulla sitemap.\nLeggiamo anche lo stato di transizione di quando la lampada\nritorna in rete da un fuori linea.\nDato che abbiamo settato come valore di default\nnella lampada l'on, sappiamo che quando ritorna in rete\nlo stato è sicuramente ON, quindi forziamo lo\nswicth dummy sulla sitemap a riportarsi allo stato ON\n","x":120,"y":40,"wires":[]},{"id":"a8d7570a.aefbf8","type":"openhab2-out","z":"1616237a.7c85ed","name":"Light status to Openhab","controller":"5d48dc.750ee724","itemname":"LampadaBagno1","topic":"ItemUpdate","payload":"","x":980,"y":170,"wires":[]},{"id":"e35b835f.2fbdf","type":"yeelight-compat-hue-out","z":"1616237a.7c85ed","name":"Turn ON","server":"1d88a787.432ce8","x":770,"y":100,"wires":[]},{"id":"71a9228d.bfd75c","type":"openhab2-in","z":"1616237a.7c85ed","name":"Openhab Swicth","controller":"5d48dc.750ee724","itemname":"LampadaBagno1","x":118,"y":74,"wires":[["2dbec13f.c3499e"],[]],"outputLabels":["State","Object"]},{"id":"2dbec13f.c3499e","type":"switch","z":"1616237a.7c85ed","name":"Command LED","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":306,"y":50,"wires":[["8b24616f.0666"],["833ae869.f3d148"]]},{"id":"833ae869.f3d148","type":"change","z":"1616237a.7c85ed","name":"Power OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"on":false,"duration":1000}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":60,"wires":[["e35b835f.2fbdf"]]},{"id":"8b24616f.0666","type":"change","z":"1616237a.7c85ed","name":"Power ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"on":true,"duration":1000}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":30,"wires":[["e35b835f.2fbdf"]]},{"id":"75ce90dc.86bec","type":"openhab2-in","z":"1616237a.7c85ed","name":"LightBagno1 line","controller":"5d48dc.750ee724","itemname":"NetCeilingBagno1_Online","x":120,"y":384,"wires":[["35d74988.03a5e6","9a432604.e2ad88"],[]]},{"id":"dfdd762d.6c9e88","type":"openhab2-in","z":"1616237a.7c85ed","name":"Brigth Luce","controller":"5d48dc.750ee724","itemname":"LampadaBagno1_bright","x":106,"y":122,"wires":[["284fce51.28dcb2"],[]]},{"id":"725c286c.9903e8","type":"openhab2-in","z":"1616237a.7c85ed","name":"Colortem","controller":"5d48dc.750ee724","itemname":"LampadaBagno1_tempcolor","x":96,"y":169,"wires":[["81531e2e.edc05"],[]]},{"id":"4360ccdf.cbde64","type":"change","z":"1616237a.7c85ed","name":"Sun mode","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"on":true, "duration":1000, "moon":1}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":150,"wires":[["e35b835f.2fbdf"]]},{"id":"284fce51.28dcb2","type":"function","z":"1616237a.7c85ed","name":"Bright","func":"var bright = parseInt(msg.payload);\nmsg.payload = {"bri":bright, "scnon":true};\nreturn msg;","outputs":1,"noerr":0,"x":276,"y":80,"wires":[["19002084.22e52f"]]},{"id":"81531e2e.edc05","type":"function","z":"1616237a.7c85ed","name":"Color Temp","func":"var Ctemperature = msg.payload;\nmsg.payload = {"ct":Ctemperature};\nreturn msg;","outputs":1,"noerr":0,"x":290,"y":110,"wires":[["19002084.22e52f"]]},{"id":"19002084.22e52f","type":"join","z":"1616237a.7c85ed","name":"Make Scene Object","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":500,"y":90,"wires":[["e35b835f.2fbdf"]]},{"id":"b601523a.82ea","type":"change","z":"1616237a.7c85ed","name":"Night mode","rules":[{"t":"set","p":"payload","pt":"msg","to":"{"on":true,"duration":1000, "moon":5}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":120,"wires":[["e35b835f.2fbdf"]]},{"id":"595b436c.231c4c","type":"function","z":"1616237a.7c85ed","name":"Splitting Yeelight feedback","func":"var msg1 = {payload:msg.payload.raw.power};\nvar msg2 = {payload:msg.payload.raw.nl_br};\nvar msg3 = {payload:msg.payload.raw.ct};\nvar msg4 = {payload:msg.payload.raw.bright};\nif (+msg.payload.raw.nl_br > 0){\n msg4 = {payload:msg.payload.raw.nl_br};\n} \nvar msg5 = {payload:msg.payload.raw.sat};\nreturn [msg1, msg2, msg3, msg4, msg5];","outputs":5,"noerr":0,"x":380,"y":260,"wires":[["2b44043.3fbb8fc"],["7b0b74b0.8b8b4c"],["8ad90c15.cccce"],["e57b846e.9a0178"],[]]},{"id":"8ad90c15.cccce","type":"openhab2-out","z":"1616237a.7c85ed","name":"Color temperature status","controller":"5d48dc.750ee724","itemname":"LampadaBagno1_tempcolor","topic":"ItemUpdate","payload":"","x":740,"y":280,"wires":[]},{"id":"e57b846e.9a0178","type":"openhab2-out","z":"1616237a.7c85ed","name":"","controller":"5d48dc.750ee724","itemname":"LampadaBagno1_bright","topic":"ItemUpdate","payload":"","x":740,"y":326,"wires":[]},{"id":"2b44043.3fbb8fc","type":"switch","z":"1616237a.7c85ed","name":"Power Status","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":590,"y":210,"wires":[["9d2c74ff.a057f8"],["d2fa6890.315bc8"]]},{"id":"9d2c74ff.a057f8","type":"change","z":"1616237a.7c85ed","name":"Status ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":150,"wires":[["a8d7570a.aefbf8"]]},{"id":"d2fa6890.315bc8","type":"change","z":"1616237a.7c85ed","name":"Status OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":187,"wires":[["a8d7570a.aefbf8"]]},{"id":"3eaddea9.4893d2","type":"openhab2-in","z":"1616237a.7c85ed","name":"Moon Swicth","controller":"5d48dc.750ee724","itemname":"LampadaBagno1_Moon","x":105,"y":217,"wires":[["958d80cb.777d4"],[]],"outputLabels":["State","Object"]},{"id":"958d80cb.777d4","type":"switch","z":"1616237a.7c85ed","name":"Moon cmd","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":296,"y":140,"wires":[["b601523a.82ea"],["4360ccdf.cbde64"]]},{"id":"e9b8eb1c.b36288","type":"openhab2-events","z":"1616237a.7c85ed","name":"Event Trig","controller":"5d48dc.750ee724","itemname":"","x":290,"y":180,"wires":[["e3902649.143868"]]},{"id":"e3902649.143868","type":"function","z":"1616237a.7c85ed","name":"ToggleSW","func":"var CHtrig = msg.payload.event;\nvar CHname = msg.payload.channel;\nif (CHtrig === "SHORT_PRESSED" && CHname ==="mihome:86sw2:158d0001639cbc:ch1" ){\n msg.payload = '{"toggl":true}';\n return msg;\n }\n","outputs":1,"noerr":0,"x":480,"y":180,"wires":[[]]},{"id":"35d74988.03a5e6","type":"trigger","z":"1616237a.7c85ed","op1":"true","op2":"0","op1type":"bool","op2type":"str","duration":"-5","extend":false,"units":"s","reset":"OFF","bytopic":"all","name":"","x":310,"y":350,"wires":[["8f4cf61d.c2fb48"]]},{"id":"7b0b74b0.8b8b4c","type":"switch","z":"1616237a.7c85ed","name":"Moon Status","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":590,"y":241,"wires":[["f6872e68.b2c94"],["a24de3d8.7245b"]]},{"id":"f6872e68.b2c94","type":"change","z":"1616237a.7c85ed","name":"Moon ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":217,"wires":[["cfbdbd3d.649fa"]]},{"id":"a24de3d8.7245b","type":"change","z":"1616237a.7c85ed","name":"Moon OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":247,"wires":[["cfbdbd3d.649fa"]]},{"id":"cfbdbd3d.649fa","type":"openhab2-out","z":"1616237a.7c85ed","name":"Moon status","controller":"5d48dc.750ee724","itemname":"LampadaBagno1_Moon","topic":"ItemUpdate","payload":"","x":940,"y":230,"wires":[]},{"id":"9a432604.e2ad88","type":"switch","z":"1616237a.7c85ed","name":"Line state","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":640,"y":380,"wires":[["a8d7570a.aefbf8"]]},{"id":"1d88a787.432ce8","type":"yeelight-compat-hue-config","z":"","hostname":"192.168.1.106","port":"55443","name":"Yeelight Bagno 1"},{"id":"5d48dc.750ee724","type":"openhab2-controller","z":"","name":"openhab suno","protocol":"http","host":"openhabianpi.local","port":"8080","path":"","username":"","password":""}] |
@arripeo still cant import. can you? |
yes I can |
strange, import is still greyed out in mine .
…On Sun, 7 Oct 2018 at 20:46, arripeo ***@***.***> wrote:
yes I can
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Ap2IlEVd0JqLA_-iSjuiUy2wenm7oy6Oks5uilokgaJpZM4V4NTF>
.
|
@arripeo I also cannot import your flow too. please try to use this function on github to post a flow code: Thanks. |
@mattmattmatt if you want i've developed a modification for an huge update of the node.
In order to be clear, your node as all the yeelight open application, is focused on the coloured bulb, but the functions are not the best for all the celing products. So i've done some huge modification to your code and some aggiustement to te yeelight2 lib. Now i can connect well the ceiling, i can manage the night mode (a issue for celing light only), the toggle command and so on. The big problem for your function is that you have used the "scene" command with colour, but the cieling light as the new white bulb are only temeprature control light, so all the colur aren't necessary and the of control is different. I suggest to create an another palette for the cieling and the white bulb and generate an heavy update. In this way the node could be the best function and binding for yeelight that you can find online. As I'm not so skilled with github for modification or for pubbling a new node, if you want I can give you the function modified as for the yeelight-compat-hue-out.js and for the index.js of yeeligth 2. Let me know if you are intersted on it. Thanks
The text was updated successfully, but these errors were encountered: