-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflows_Pi3.json
1 lines (1 loc) · 25.2 KB
/
flows_Pi3.json
1
[{"id":"51246dec.dd7104","type":"tab","label":"Alexa Lamps","disabled":false,"info":""},{"id":"987c9482.518ed8","type":"tab","label":"Energy"},{"id":"709d7e0.1a5c484","type":"tab","label":"CPU Temperature"},{"id":"14cc9fe7.48bf9","type":"tab","label":"DarkSky","disabled":false},{"id":"89466feb.d4e5f","type":"tab","label":"Telegram","disabled":false,"info":""},{"id":"2d0054c5.9f496c","type":"tab","label":"Flow 3"},{"id":"38b956d7.a0ea7a","type":"tab","label":"Flow 2","disabled":true,"info":""},{"id":"c8bb5525.2151c8","type":"ui_group","z":"","name":"Cpu","tab":"b9514078.a518d","order":2,"disp":false,"width":"12"},{"id":"d76a13f2.f6da1","type":"ui_base","theme":{"name":"theme-dark","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"Helvetica Neue","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"customTheme":{"name":"","default":"#4B7930","baseColor":"#4B7930","baseFont":"Helvetica Neue","reset":false},"themeState":{"base-color":{"default":"#097479","value":"#097479","edited":false},"page-titlebar-backgroundColor":{"value":"#097479","edited":false},"page-backgroundColor":{"value":"#111111","edited":false},"page-sidebar-backgroundColor":{"value":"#000000","edited":false},"group-textColor":{"value":"#0eb8c0","edited":false},"group-borderColor":{"value":"#555555","edited":false},"group-backgroundColor":{"value":"#333333","edited":false},"widget-textColor":{"value":"#eeeeee","edited":false},"widget-backgroundColor":{"value":"#097479","edited":false},"widget-borderColor":{"value":"#333333","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","dateFormat":"YYYY-MM-DD","sizes":{"sx":60,"sy":60,"gx":6,"gy":6,"cx":6,"cy":6,"px":4,"py":4}}},{"id":"44d8d276.07e63c","type":"ui_tab","z":"","name":"Energy","icon":"dashboard","order":1},{"id":"80497fe8.03683","type":"ui_group","z":"","name":"Gauges","tab":"44d8d276.07e63c","order":2,"disp":false,"width":"6"},{"id":"5b8107bc.b71678","type":"ui_group","z":"","name":"Charts","tab":"44d8d276.07e63c","order":1,"disp":false,"width":"6"},{"id":"a0703839.3943f8","type":"mqtt-broker","z":"","broker":"192.168.1.133","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"b9514078.a518d","type":"ui_tab","z":"","name":"CPU","icon":"dashboard","order":2},{"id":"8b2ad5c.7520c28","type":"sqlitedb","z":"","db":"/root/Energy.db"},{"id":"4388a798.ca22d8","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"weather","name":"","usetls":false,"tls":""},{"id":"986f6867.d414a8","type":"darksky-credentials","z":"","key_identifier":"garryhayne"},{"id":"1328cb36.f51985","type":"telegram bot","z":"89466feb.d4e5f","botname":"gaffazero1_bot","usernames":"","chatids":""},{"id":"23f0ce91.a4c562","type":"ui_tab","z":"","name":"Weather","icon":"dashboard","order":5},{"id":"fcd15f04.aceb","type":"ui_group","z":"","name":"Temperature","tab":"23f0ce91.a4c562","order":1,"disp":true,"width":"6"},{"id":"20bb2909.530486","type":"ui_group","z":"","name":"Wind","tab":"23f0ce91.a4c562","order":3,"disp":true,"width":"6"},{"id":"16aea3b2.466d5c","type":"ui_group","z":"","name":"Pressure","tab":"23f0ce91.a4c562","order":2,"disp":true,"width":"6"},{"id":"30d0e185.4f5dfe","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"salgar","name":"","usetls":false,"tls":""},{"id":"2c9ee86.1312318","type":"alexa-home-conf","z":"","username":"ghayne"},{"id":"5ea38024.b9dbd","type":"mqtt-broker","z":"","broker":"192.168.1.133","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"5d36ed91.e93b84","type":"MySQLdatabase","z":"","host":"192.168.1.2","port":"3306","db":"Energy","tz":""},{"id":"9e6e315f.c34f9","type":"debug","z":"987c9482.518ed8","name":"","active":false,"console":"false","complete":"true","x":758,"y":446,"wires":[]},{"id":"3d5ccf5f.10d6c","type":"ui_gauge","z":"987c9482.518ed8","name":"","group":"80497fe8.03683","order":1,"width":"6","height":"5","gtype":"gage","title":"","label":"W","format":"{{value | number:0}}","min":"0","max":"8000","colors":["#00b500","#e6e600","#ca3838"],"x":726,"y":126,"wires":[]},{"id":"65c80ac8.b2c1a4","type":"ui_chart","z":"987c9482.518ed8","name":"","group":"5b8107bc.b71678","order":0,"width":"6","height":"5","label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"30","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":723,"y":210,"wires":[[],[]]},{"id":"c892677b.5fbc78","type":"inject","z":"987c9482.518ed8","name":"","topic":"","payload":"[]","payloadType":"json","repeat":"","crontab":"","once":false,"x":350,"y":216,"wires":[["65c80ac8.b2c1a4"]]},{"id":"d7abcb5e.8251d8","type":"mqtt in","z":"987c9482.518ed8","name":"","topic":"Meter","qos":"2","broker":"a0703839.3943f8","x":68,"y":141,"wires":[["d71d438d.1f54d","21e9f15d.55c3ae"]]},{"id":"391ba136.f4404e","type":"exec","z":"709d7e0.1a5c484","command":"vcgencmd","addpay":false,"append":"measure_temp","useSpawn":false,"timer":"","name":"","x":250,"y":40,"wires":[["8ca8197a.cf3da8"],[],[]]},{"id":"83e23db3.56791","type":"inject","z":"709d7e0.1a5c484","name":"","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":false,"x":96,"y":28,"wires":[["391ba136.f4404e"]]},{"id":"8ca8197a.cf3da8","type":"function","z":"709d7e0.1a5c484","name":"CPU Temp Function","func":"//msg.payload = {'d':{'temp': parseFloat(msg.payload.replace(\"temp=\",\"\").replace(\"'C\\n\",\"\"))}};\nmsg.payload = parseFloat(msg.payload.replace(\"temp=\",\"\").replace(\"'C\\n\",\"\"));\nreturn msg;","outputs":1,"noerr":0,"x":440,"y":40,"wires":[["1f6fbbb8.6d9994","2ddcd317.3da9ac","d3b4ae82.8136a","f391ec27.912ac"]]},{"id":"1f6fbbb8.6d9994","type":"debug","z":"709d7e0.1a5c484","name":"","active":false,"console":"false","complete":"false","x":670,"y":40,"wires":[]},{"id":"2ddcd317.3da9ac","type":"mqtt out","z":"709d7e0.1a5c484","name":"","topic":"Pi3_CPU_Temp","qos":"2","retain":"true","broker":"a0703839.3943f8","x":680,"y":300,"wires":[]},{"id":"d3b4ae82.8136a","type":"ui_text","z":"709d7e0.1a5c484","group":"c8bb5525.2151c8","order":0,"width":"2","height":"1","name":"","label":"Temp.","format":"{{msg.payload | number:2}}","layout":"row-spread","x":690,"y":160,"wires":[]},{"id":"2d2969f7.a73f36","type":"function","z":"987c9482.518ed8","name":"","func":"\nmsg.topic = \"INSERT INTO MeterData (Watts,Millis) VALUES (\" + msg.payload[0].trim() + \",\" + msg.payload[1].trim() + \")\";\nmsg.payload = parseFloat(msg.payload[0]);\nreturn msg ;","outputs":"1","noerr":0,"x":345,"y":294,"wires":[["9e6e315f.c34f9","6c5b806a.c26c","aa7c2b60.bdfaf8","fb0529af.ce4e08","e6945e36.2ee41","56cdd8f0.512d18"]]},{"id":"fb0529af.ce4e08","type":"sqlite","z":"987c9482.518ed8","mydb":"8b2ad5c.7520c28","name":"","x":745,"y":365,"wires":[[]]},{"id":"d71d438d.1f54d","type":"join","z":"987c9482.518ed8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","x":156,"y":289,"wires":[["2d2969f7.a73f36"]]},{"id":"6c5b806a.c26c","type":"mqtt out","z":"987c9482.518ed8","name":"","topic":"Watts","qos":"2","retain":"true","broker":"a0703839.3943f8","x":720,"y":289,"wires":[]},{"id":"aa7c2b60.bdfaf8","type":"change","z":"987c9482.518ed8","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"Watts","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":505,"y":249,"wires":[["65c80ac8.b2c1a4","3d5ccf5f.10d6c"]]},{"id":"e6945e36.2ee41","type":"switch","z":"987c9482.518ed8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"20000","vt":"num"}],"checkall":"false","outputs":1,"x":511,"y":505,"wires":[[]]},{"id":"895c58bf.540bc8","type":"e-mail","z":"987c9482.518ed8","server":"smtp.gmail.com","port":"465","secure":true,"name":"[email protected]","dname":"","x":727,"y":505,"wires":[]},{"id":"1d52b486.212a0b","type":"inject","z":"987c9482.518ed8","name":"","topic":"","payload":"21000","payloadType":"num","repeat":"","crontab":"","once":false,"x":264,"y":501,"wires":[["e6945e36.2ee41"]]},{"id":"56cdd8f0.512d18","type":"influxdb out","z":"987c9482.518ed8","influxdb":"30d0e185.4f5dfe","name":"","measurement":"Watts","precision":"","retentionPolicy":"","x":796,"y":406,"wires":[]},{"id":"8742b629.0f01a8","type":"influxdb in","z":"987c9482.518ed8","influxdb":"4388a798.ca22d8","name":"","query":"Create database weather","rawOutput":false,"precision":"","retentionPolicy":"","x":564,"y":620,"wires":[["b029be3d.5a443"]]},{"id":"33ce815e.c3ad2e","type":"inject","z":"987c9482.518ed8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":250,"y":618,"wires":[[]]},{"id":"b029be3d.5a443","type":"debug","z":"987c9482.518ed8","name":"","active":true,"console":"false","complete":"false","x":867,"y":612,"wires":[]},{"id":"1d0e3d75.9d2c43","type":"darksky","z":"14cc9fe7.48bf9","darksky":"986f6867.d414a8","name":"","lon":"-3.82451","lat":"51.79719","date":"","time":"","mode":"message","lang":"en","units":"uk2","x":336,"y":125,"wires":[["15012693.dedb09","f149d209.657f8","5eb07525.1e5e5c","ababd4d8.018fc8","cd97cf24.b721d","2f869c3.13fd664"]]},{"id":"15012693.dedb09","type":"debug","z":"14cc9fe7.48bf9","name":"","active":true,"console":"false","complete":"true","x":586,"y":123,"wires":[]},{"id":"feb9fd5.576ee","type":"inject","z":"14cc9fe7.48bf9","name":"","topic":"","payload":"","payloadType":"date","repeat":"300","crontab":"","once":false,"x":116,"y":125,"wires":[["1d0e3d75.9d2c43"]]},{"id":"98d2314.de99fd","type":"mqtt out","z":"51246dec.dd7104","name":"","topic":"","qos":"2","retain":"true","broker":"a0703839.3943f8","x":770,"y":320,"wires":[]},{"id":"474f6d73.65bde4","type":"ui_audio","z":"709d7e0.1a5c484","name":"","group":"c8bb5525.2151c8","voice":"en-GB","always":true,"x":660,"y":380,"wires":[]},{"id":"27815408.1a106c","type":"ui_button","z":"709d7e0.1a5c484","name":"","group":"c8bb5525.2151c8","order":0,"width":0,"height":0,"passthru":true,"label":"button","color":"","bgcolor":"","icon":"","payload":"I Fucking Love You","payloadType":"str","topic":"","x":450,"y":380,"wires":[["474f6d73.65bde4"]]},{"id":"f391ec27.912ac","type":"ui_chart","z":"709d7e0.1a5c484","name":"","group":"c8bb5525.2151c8","order":0,"width":"6","height":"4","label":"chart","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"step","nodata":"","dot":false,"ymin":"0","ymax":"100","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":690,"y":120,"wires":[[],[]]},{"id":"a2092e44.ab401","type":"bigtimer","z":"51246dec.dd7104","outtopic":"cmnd/LittleLamps/power","outpayload1":"","outpayload2":"off","name":"Little Lamps off 23:00","lat":"51.7972","lon":"-3.8246","starttime":5001,"endtime":"1380","startoff":"-30","endoff":0,"offs":0,"outtext1":"","outtext2":"off","timeout":"5","sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"suspend":false,"random":false,"repeat":true,"atstart":true,"odd":false,"even":false,"x":130,"y":100,"wires":[[],["85a731e8.4978c"],["98d2314.de99fd"]]},{"id":"147b8a5d.1a2b86","type":"function","z":"89466feb.d4e5f","name":"","func":"var msg1 = {\"topic\": msg.topic, \"payload\": {\"chatId\" : 296548099, \"type\" : 'message', \"content\" : msg.topic + '\\n' + msg.payload} };\nreturn msg1;","outputs":1,"noerr":0,"x":322,"y":457,"wires":[["8af446d7.5aa238"]]},{"id":"971f1a15.ff3ac8","type":"inject","z":"89466feb.d4e5f","name":"","topic":"Zero1","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":156,"y":453,"wires":[["147b8a5d.1a2b86"]]},{"id":"658d8236.cb435c","type":"function","z":"89466feb.d4e5f","name":"","func":"msg.payload = msg.payload.content;\nreturn msg;","outputs":1,"noerr":0,"x":285,"y":157,"wires":[["7100d7a1.bafb48"]]},{"id":"e96ec7e8.e0d388","type":"debug","z":"89466feb.d4e5f","name":"","active":true,"console":"false","complete":"true","x":774,"y":132,"wires":[]},{"id":"7100d7a1.bafb48","type":"split","z":"89466feb.d4e5f","name":"","splt":" ","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":423,"y":157,"wires":[["4a83a582.3d9d1c"]]},{"id":"4a83a582.3d9d1c","type":"join","z":"89466feb.d4e5f","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","x":489,"y":205,"wires":[["d4c4df71.6e1a"]]},{"id":"d4c4df71.6e1a","type":"function","z":"89466feb.d4e5f","name":"","func":"msg.topic = msg.payload[0];\nmsg.payload = msg.payload[1];\nreturn msg;","outputs":1,"noerr":0,"x":629,"y":197,"wires":[[]]},{"id":"8af446d7.5aa238","type":"telegram sender","z":"89466feb.d4e5f","name":"","bot":"1328cb36.f51985","x":571,"y":460,"wires":[[]]},{"id":"9ec4b979.c8e478","type":"function","z":"51246dec.dd7104","name":"","func":" msg.topic = \"cmnd/sidelamp/power\";\n node.send(msg);\n msg.topic = \"cmnd/backlamp/power\";\n node.send(msg);\n msg.topic = \"cmnd/kitchenlamp/power\";\n node.send(msg);\n msg.topic = \"cmnd/readinglamp/power\";\n node.send(msg);","outputs":1,"noerr":0,"x":360,"y":510,"wires":[["98d2314.de99fd"]]},{"id":"998338b6.116868","type":"ui_chart","z":"14cc9fe7.48bf9","name":"","group":"fcd15f04.aceb","order":0,"width":"6","height":"6","label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"-10","ymax":"30","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":789.5,"y":229,"wires":[[],[]]},{"id":"f149d209.657f8","type":"change","z":"14cc9fe7.48bf9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.currently.temperature","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Temp","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":601.5,"y":227,"wires":[["998338b6.116868"]]},{"id":"f10067f2.0030d8","type":"ui_gauge","z":"14cc9fe7.48bf9","name":"","group":"20bb2909.530486","order":0,"width":"6","height":"6","gtype":"compass","title":"","label":"Deg.","format":"{{value}}","min":0,"max":"359","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":788.5,"y":329,"wires":[]},{"id":"5eb07525.1e5e5c","type":"change","z":"14cc9fe7.48bf9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.currently.windBearing","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Wind","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":612,"y":330,"wires":[["f10067f2.0030d8"]]},{"id":"ababd4d8.018fc8","type":"change","z":"14cc9fe7.48bf9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.currently.pressure","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"hPa","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":614,"y":404,"wires":[["29f4c650.94fe7a"]]},{"id":"29f4c650.94fe7a","type":"ui_chart","z":"14cc9fe7.48bf9","name":"","group":"16aea3b2.466d5c","order":0,"width":"6","height":"6","label":"","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"980","ymax":"1050","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":793.5,"y":398,"wires":[[],[]]},{"id":"cd97cf24.b721d","type":"change","z":"14cc9fe7.48bf9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.currently.apparentTemperature","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Apparent","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":609,"y":266,"wires":[["998338b6.116868"]]},{"id":"3afdeb85.b5e2f4","type":"debug","z":"14cc9fe7.48bf9","name":"","active":false,"console":"false","complete":"true","x":628.5,"y":532,"wires":[]},{"id":"2f869c3.13fd664","type":"change","z":"14cc9fe7.48bf9","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\t{\t\"Temperature\":data.currently.temperature,\t\"temperatureApparent\":data.currently.apparentTemperature,\t\"pressure\":data.currently.pressure,\t\"windSpeed\":data.currently.windSpeed,\t\"windGust\":data.currently.windGust,\t\"windBearing\":data.currently.windBearing,\t\"precipIntensity\":data.currently.precipIntensity,\t\"precipProbability\":data.currently.precipProbability\t}\t]\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":441.5,"y":486,"wires":[["3afdeb85.b5e2f4","d98c515d.d4651"]]},{"id":"d98c515d.d4651","type":"influxdb out","z":"14cc9fe7.48bf9","influxdb":"4388a798.ca22d8","name":"","measurement":"darksky","precision":"","retentionPolicy":"one_week","x":712.5,"y":485,"wires":[]},{"id":"e1f6c67a.dae178","type":"inject","z":"14cc9fe7.48bf9","name":"","topic":"","payload":"[]","payloadType":"json","repeat":"","crontab":"","once":false,"x":155.5,"y":370,"wires":[["29f4c650.94fe7a"]]},{"id":"277a9acb.7272c6","type":"mqtt in","z":"51246dec.dd7104","name":"","topic":"lux","qos":"2","broker":"5ea38024.b9dbd","x":90,"y":170,"wires":[["5515753e.aeb48c"]]},{"id":"7abc91d.892e67","type":"alexa-home","z":"51246dec.dd7104","conf":"2c9ee86.1312318","device":"18208","acknoledge":false,"name":"Kitchen","topic":"cmnd/kitchenlamp/power","x":90,"y":390,"wires":[["98d2314.de99fd"]]},{"id":"92584bd1.fc4fe8","type":"alexa-home","z":"51246dec.dd7104","conf":"2c9ee86.1312318","device":"18209","acknoledge":true,"name":"Side Lamp","topic":"cmnd/sidelamp/power","x":100,"y":440,"wires":[["98d2314.de99fd"]]},{"id":"10ae28ee.d3a3e7","type":"alexa-home","z":"51246dec.dd7104","conf":"2c9ee86.1312318","device":"18210","acknoledge":true,"name":"Back Lamp","topic":"cmnd/backlamp/power","x":110,"y":490,"wires":[["98d2314.de99fd"]]},{"id":"3b8a36e0.ac341a","type":"alexa-home","z":"51246dec.dd7104","conf":"2c9ee86.1312318","device":"18211","acknoledge":true,"name":"All Lamps","topic":"","x":100,"y":540,"wires":[["9ec4b979.c8e478"]]},{"id":"a5240e8c.78df2","type":"alexa-home","z":"51246dec.dd7104","conf":"2c9ee86.1312318","device":"18139","acknoledge":true,"name":"Little Lamps","topic":"cmnd/LittleLamps/power","x":110,"y":290,"wires":[["98d2314.de99fd"]]},{"id":"7773960f.a0c3d8","type":"debug","z":"51246dec.dd7104","name":"","active":true,"console":"false","complete":"true","x":780,"y":80,"wires":[]},{"id":"ac8f3d46.b6e55","type":"inject","z":"51246dec.dd7104","name":"","topic":"","payload":"LittleLamps","payloadType":"global","repeat":"","crontab":"","once":false,"x":660,"y":40,"wires":[["7773960f.a0c3d8"]]},{"id":"85a731e8.4978c","type":"change","z":"51246dec.dd7104","name":"Set Globals","rules":[{"t":"set","p":"LittleLamps","pt":"global","to":"now=solarNoon ? 1 : $globalContext(\"LittleLamps\")","tot":"jsonata"},{"t":"set","p":"readinglamp","pt":"global","to":"now=sunrise ? 1 : $globalContext(\"readinglamp\")","tot":"jsonata"},{"t":"set","p":"readinglamp","pt":"global","to":"now=sunset ? 0 : $globalContext(\"readinglamp\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":80,"wires":[[]]},{"id":"5515753e.aeb48c","type":"change","z":"51246dec.dd7104","name":"lx<50 LittleLamps on","rules":[{"t":"set","p":"payload","pt":"msg","to":"($number(payload)<50)and($globalContext(\"LittleLamps\")) ? 1","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"cmnd/LittleLamps/power","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":180,"wires":[["2c7e8fa1.29192"]]},{"id":"2c7e8fa1.29192","type":"switch","z":"51246dec.dd7104","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","outputs":1,"x":450,"y":180,"wires":[["bda115f6.9cde88"]]},{"id":"bda115f6.9cde88","type":"change","z":"51246dec.dd7104","name":"","rules":[{"t":"set","p":"LittleLamps","pt":"global","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":190,"wires":[["98d2314.de99fd","7773960f.a0c3d8"]]},{"id":"5ee322f3.4971ec","type":"change","z":"51246dec.dd7104","name":"lx<550 readinglamp on","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number(payload)<550 ? 1:0","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"cmnd/readinglamp/power","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":230,"wires":[["8f1288ba.c2b788"]]},{"id":"8f1288ba.c2b788","type":"switch","z":"51246dec.dd7104","name":"","property":"readinglamp","propertyType":"global","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","outputs":1,"x":490,"y":260,"wires":[["98d2314.de99fd"]]},{"id":"5222793d.18b398","type":"inject","z":"709d7e0.1a5c484","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":250,"y":380,"wires":[["27815408.1a106c"]]},{"id":"3ef38bbc.92ba34","type":"inject","z":"2d0054c5.9f496c","name":"","topic":"","payload":"{\"name\":\"Salgar\",\"lat\":51.797243,\"lon\":-3.824601,\"icon\":\"fa-male\"}","payloadType":"json","repeat":"","crontab":"","once":false,"x":238,"y":141,"wires":[["52021d03.8256d4"]]},{"id":"a377017.73827","type":"inject","z":"2d0054c5.9f496c","name":"","topic":"","payload":"{\"name\":\"Salgar\",\"lat\":51.797243,\"lon\":-3.824601,\"icon\":\"fa-female\"}","payloadType":"json","repeat":"","crontab":"","once":false,"x":241,"y":210,"wires":[["52021d03.8256d4"]]},{"id":"7e8d0dd3.91fba4","type":"telegram receiver","z":"89466feb.d4e5f","name":"","bot":"1328cb36.f51985","saveDataDir":"","x":327.5,"y":78,"wires":[["e96ec7e8.e0d388"],[]]},{"id":"21e9f15d.55c3ae","type":"debug","z":"987c9482.518ed8","name":"","active":false,"console":"false","complete":"false","x":689.5,"y":68,"wires":[]},{"id":"b92c8284.57b68","type":"alexa-home","z":"51246dec.dd7104","conf":"2c9ee86.1312318","device":"18207","acknoledge":true,"name":"Reading","topic":"cmnd/readinglamp/power","x":100,"y":340,"wires":[["98d2314.de99fd"]]},{"id":"52021d03.8256d4","type":"worldmap","z":"2d0054c5.9f496c","name":"","lat":"","lon":"","zoom":"18","layer":"Esri Satellite","cluster":"","maxage":"","usermenu":"show","layers":"show","panit":"true","x":452,"y":172,"wires":[]},{"id":"cafd18a1.f58618","type":"debug","z":"2d0054c5.9f496c","name":"","active":true,"console":"false","complete":"payload","x":673,"y":99,"wires":[]},{"id":"6d7ccbdc.6d5724","type":"json","z":"2d0054c5.9f496c","name":"","pretty":false,"x":309,"y":43,"wires":[["e630027f.6f73e"]]},{"id":"e630027f.6f73e","type":"change","z":"2d0054c5.9f496c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"name\": \"Salgar\",\t \"lat\":payload.lat,\t \"lon\":payload.lon,\t \"icon\": \"locate\"\t\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":491,"y":54,"wires":[["cafd18a1.f58618","52021d03.8256d4"]]},{"id":"9483092.a614af8","type":"mysql","z":"38b956d7.a0ea7a","mydb":"5d36ed91.e93b84","name":"","x":560,"y":100,"wires":[["3fafb3e0.894cbc"]]},{"id":"242a0e71.f7fda2","type":"inject","z":"38b956d7.a0ea7a","name":"","topic":"select * from Meter","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":200,"y":140,"wires":[["9483092.a614af8"]]},{"id":"3fafb3e0.894cbc","type":"debug","z":"38b956d7.a0ea7a","name":"","active":true,"console":"false","complete":"true","x":670,"y":260,"wires":[]},{"id":"b885484e.2d60f8","type":"inject","z":"38b956d7.a0ea7a","name":"","topic":"insert into Meter (Watts) Values (2000);","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":200,"y":80,"wires":[["9483092.a614af8"]]},{"id":"d6855a9c.63ebf8","type":"mqtt in","z":"38b956d7.a0ea7a","name":"","topic":"Meter","qos":"2","broker":"a0703839.3943f8","x":70,"y":20,"wires":[["c7149e58.9c4c2"]]},{"id":"c7149e58.9c4c2","type":"join","z":"38b956d7.a0ea7a","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","x":230,"y":20,"wires":[["b82bbe65.c3b65"]]},{"id":"b82bbe65.c3b65","type":"change","z":"38b956d7.a0ea7a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number($trim(payload[0]))","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"\"INSERT INTO Meter (Watts) VALUES(\"&payload&\");\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":40,"wires":[["3fafb3e0.894cbc","9483092.a614af8"]]}]