-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flow that displays Lewisville Lake TX info
Queries USGS every 30m and displays info on a dashboard
- Loading branch information
Greg Gorman
authored
Jun 13, 2019
1 parent
77d61ef
commit c806bb0
Showing
2 changed files
with
1 addition
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"id":"fcfd505c.0baac","type":"tab","label":"Lewisville Lake","disabled":false,"info":""},{"id":"409501d9.2b89d","type":"http request","z":"fcfd505c.0baac","name":"Lewisville Lake USGS Data","method":"GET","ret":"obj","paytoqs":false,"url":"https://waterservices.usgs.gov/nwis/iv/?format=json&indent=on&sites=08052800&siteStatus=all","tls":"","proxy":"","authType":"basic","x":340,"y":140,"wires":[["9493a44c.a37f78"]]},{"id":"fb1ecbd9.5a08b8","type":"inject","z":"fcfd505c.0baac","name":"Get Lake Info ","topic":"","payload":"","payloadType":"date","repeat":"1800","crontab":"","once":true,"onceDelay":"15","x":120,"y":160,"wires":[["409501d9.2b89d"]]},{"id":"85529a74.ff7288","type":"split","z":"fcfd505c.0baac","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":770,"y":140,"wires":[["f847254c.2d3ae8"]]},{"id":"9493a44c.a37f78","type":"change","z":"fcfd505c.0baac","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.value.timeSeries","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":140,"wires":[["85529a74.ff7288"]]},{"id":"b1a03907.2e6cc8","type":"switch","z":"fcfd505c.0baac","name":"","property":"payload.variable.variableCode[0].value","propertyType":"msg","rules":[{"t":"eq","v":"00035","vt":"str"},{"t":"eq","v":"00036","vt":"str"},{"t":"eq","v":"00045","vt":"str"},{"t":"eq","v":"45592","vt":"str"},{"t":"eq","v":"62614","vt":"str"},{"t":"eq","v":"00060","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":7,"x":290,"y":540,"wires":[["16ca59df.d98886"],["16215989.b80976"],["e563f858.5c70f8"],["4fd83f1a.03334"],["ab65d58d.56ca18"],["14769b93.493534"],["630c8246.196c5c"]],"outputLabels":["Wind Speed, mph","Wind Direction, degrees","Prcipitation, inches","Gate Opening, ft","Surface Elevation, ft","Discharge, CFS","fault"]},{"id":"5a4d9c78.84bd84","type":"link in","z":"fcfd505c.0baac","name":"","links":["f847254c.2d3ae8","df56490b.441838"],"x":95,"y":540,"wires":[["b1a03907.2e6cc8"]]},{"id":"f847254c.2d3ae8","type":"link out","z":"fcfd505c.0baac","name":"","links":["5a4d9c78.84bd84"],"x":855,"y":180,"wires":[]},{"id":"630c8246.196c5c","type":"debug","z":"fcfd505c.0baac","name":"Other value code","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":230,"y":660,"wires":[]},{"id":"9419bd53.dacc7","type":"ui_gauge","z":"fcfd505c.0baac","name":"","group":"9bf54798.f83e78","order":2,"width":"3","height":"3","gtype":"gage","title":"Wind Speed","label":"mph","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":610,"y":360,"wires":[]},{"id":"16ca59df.d98886","type":"change","z":"fcfd505c.0baac","name":"Get Value","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.values[0].value[0].value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":360,"wires":[["9419bd53.dacc7"]]},{"id":"16215989.b80976","type":"change","z":"fcfd505c.0baac","name":"Get Value","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.values[0].value[0].value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":400,"wires":[["370cd7e5.d5e2e8"]]},{"id":"370cd7e5.d5e2e8","type":"ui_gauge","z":"fcfd505c.0baac","name":"","group":"9bf54798.f83e78","order":3,"width":"3","height":"3","gtype":"compass","title":"Wind Dir","label":"Degrees","format":"{{value}}","min":0,"max":"360","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":600,"y":400,"wires":[]},{"id":"ab65d58d.56ca18","type":"change","z":"fcfd505c.0baac","name":"Get Value","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.values[0].value[0].value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":560,"wires":[["338ffcf0.7e9854","6d5eae43.8566","d9c1f2c2.aed75"]]},{"id":"6d5eae43.8566","type":"ui_gauge","z":"fcfd505c.0baac","name":"","group":"9bf54798.f83e78","order":4,"width":"3","height":"3","gtype":"gage","title":"Lake Level","label":"Feet ASL","format":"{{value}}","min":"481","max":"532","colors":["#fff200","#00ff49","#ca3838"],"seg1":"","seg2":"","x":750,"y":600,"wires":[]},{"id":"338ffcf0.7e9854","type":"ui_chart","z":"fcfd505c.0baac","name":"","group":"9bf54798.f83e78","order":10,"width":"0","height":"0","label":"Lake Level History","chartType":"line","legend":"false","xformat":"dd HH:mm","interpolate":"linear","nodata":"No Data","dot":true,"ymin":"481","ymax":"532","removeOlder":"4","removeOlderPoints":"10000","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":770,"y":560,"wires":[["e873d5c8.b826d8"]]},{"id":"e563f858.5c70f8","type":"change","z":"fcfd505c.0baac","name":"Get Value","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.values[0].value[0].value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":500,"wires":[["4cf98744.86e1d8"]]},{"id":"4cf98744.86e1d8","type":"ui_chart","z":"fcfd505c.0baac","name":"","group":"9bf54798.f83e78","order":11,"width":0,"height":0,"label":"Rain History","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"1","removeOlder":"8","removeOlderPoints":"10000","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":750,"y":500,"wires":[["e3c70092.cd615"]]},{"id":"d9c1f2c2.aed75","type":"join","z":"fcfd505c.0baac","name":"Buffer two measurements","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":790,"y":640,"wires":[["dff64e9e.c42fd"]]},{"id":"dff64e9e.c42fd","type":"change","z":"fcfd505c.0baac","name":"Convert to 1|0|-1","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number(payload[1]) - $number(payload[0]) > 0 ? 1 : $number(payload[1]) - $number(payload[0]) < 0 ? -1 :0","tot":"jsonata"},{"t":"set","p":"enabled","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":620,"wires":[["841d72b4.1cc95"]]},{"id":"e873d5c8.b826d8","type":"file","z":"fcfd505c.0baac","name":"","filename":"LakeHistoryFile","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":960,"y":560,"wires":[[]]},{"id":"6caa82b9.db448c","type":"inject","z":"fcfd505c.0baac","name":"Trigger History File Load","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":170,"y":260,"wires":[["241fcbb5.b83ac4","377c8618.ed02fa"]]},{"id":"241fcbb5.b83ac4","type":"file in","z":"fcfd505c.0baac","name":"","filename":"LakeHistoryFile","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":460,"y":240,"wires":[["e9c5c859.32c4c8"]]},{"id":"e9c5c859.32c4c8","type":"json","z":"fcfd505c.0baac","name":"","property":"payload","action":"","pretty":false,"x":650,"y":240,"wires":[["338ffcf0.7e9854"]]},{"id":"e3c70092.cd615","type":"file","z":"fcfd505c.0baac","name":"","filename":"RainHistoryFile","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":920,"y":500,"wires":[[]]},{"id":"377c8618.ed02fa","type":"file in","z":"fcfd505c.0baac","name":"","filename":"RainHistoryFile","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":460,"y":280,"wires":[["41456d63.5237c4"]]},{"id":"41456d63.5237c4","type":"json","z":"fcfd505c.0baac","name":"","property":"payload","action":"","pretty":false,"x":650,"y":280,"wires":[["4cf98744.86e1d8"]]},{"id":"4fd83f1a.03334","type":"change","z":"fcfd505c.0baac","name":"Get Values","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.values","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":860,"wires":[["a99c52bc.b8a32"]]},{"id":"8f9b0dc1.0021a","type":"switch","z":"fcfd505c.0baac","name":"Split Gates","property":"payload.method[0].methodDescription","propertyType":"msg","rules":[{"t":"eq","v":"GATE 1","vt":"str"},{"t":"eq","v":"GATE 2","vt":"str"},{"t":"eq","v":"GATE 3","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":830,"y":900,"wires":[["d53bb472.dee788"],["76225923.f31768"],["f5199697.893be8"],[]]},{"id":"cec62eea.6be05","type":"ui_gauge","z":"fcfd505c.0baac","name":"","group":"9bf54798.f83e78","order":6,"width":"3","height":"3","gtype":"donut","title":"Gate A Status","label":"Ft","format":"{{value}}","min":0,"max":"5","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1160,"y":880,"wires":[]},{"id":"a99c52bc.b8a32","type":"split","z":"fcfd505c.0baac","name":"Separate Array","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":660,"y":860,"wires":[["27110182.54cbce","8f9b0dc1.0021a"]]},{"id":"27110182.54cbce","type":"debug","z":"fcfd505c.0baac","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":830,"y":820,"wires":[]},{"id":"51d27377.d61b9c","type":"ui_gauge","z":"fcfd505c.0baac","name":"","group":"9bf54798.f83e78","order":7,"width":"3","height":"3","gtype":"donut","title":"Gate B Status","label":"Ft","format":"{{value}}","min":0,"max":"5","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1160,"y":920,"wires":[]},{"id":"1d51b9ff.535a86","type":"ui_gauge","z":"fcfd505c.0baac","name":"","group":"9bf54798.f83e78","order":8,"width":"3","height":"3","gtype":"donut","title":"Gate C Status","label":"Ft","format":"{{value}}","min":0,"max":"5","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1160,"y":960,"wires":[]},{"id":"d53bb472.dee788","type":"change","z":"fcfd505c.0baac","name":"Get Value","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.value[0].value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":860,"wires":[["cec62eea.6be05"]]},{"id":"76225923.f31768","type":"change","z":"fcfd505c.0baac","name":"Get Value","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.value[0].value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":900,"wires":[["51d27377.d61b9c"]]},{"id":"f5199697.893be8","type":"change","z":"fcfd505c.0baac","name":"Get Value","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.value[0].value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":940,"wires":[["1d51b9ff.535a86"]]},{"id":"85c74181.1d37d","type":"http request","z":"fcfd505c.0baac","name":"Trinity River USGS Data","method":"GET","ret":"obj","paytoqs":false,"url":"https://waterservices.usgs.gov/nwis/iv/?format=json&sites=08053000¶meterCd=00060,00065&siteStatus=all","tls":"","proxy":"","authType":"basic","x":330,"y":100,"wires":[["9493a44c.a37f78"]]},{"id":"4c11d0a9.bf057","type":"inject","z":"fcfd505c.0baac","name":"Get Flow Info ","topic":"","payload":"","payloadType":"date","repeat":"1800","crontab":"","once":true,"onceDelay":"5","x":140,"y":40,"wires":[["85c74181.1d37d"]]},{"id":"14769b93.493534","type":"change","z":"fcfd505c.0baac","name":"Get Value","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.values[0].value[0].value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":600,"wires":[["b4bea71d.2f2448","327ab0a7.37db8"]]},{"id":"b4bea71d.2f2448","type":"ui_gauge","z":"fcfd505c.0baac","name":"","group":"9bf54798.f83e78","order":9,"width":"3","height":"3","gtype":"donut","title":"Discharge","label":"CFS","format":"{{value}}","min":"300","max":"6000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":740,"y":680,"wires":[]},{"id":"327ab0a7.37db8","type":"debug","z":"fcfd505c.0baac","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":600,"y":720,"wires":[]},{"id":"dc7421e1.0df3a","type":"ui_template","z":"fcfd505c.0baac","group":"9bf54798.f83e78","name":"How I did it","order":1,"width":0,"height":0,"format":"<p>I used a realtime data source from the <a href=https://waterservices.usgs.gov/rest/IV-Test-Tool.html>USGS</a>. You need to find the Site ID using the <a href=https://waterdata.usgs.gov/nwis/uv?site_no=08052800>USGS Water Information System</a>. The query can return many formats, I chose JSON and then process as I need it.</p>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":870,"y":300,"wires":[[]]},{"id":"cddfbe25.8cb83","type":"ui_button","z":"fcfd505c.0baac","name":"","group":"9bf54798.f83e78","order":5,"width":"3","height":"3","passthru":false,"label":"{{payload}}","tooltip":"","color":"{{colour}}","bgcolor":"{{background}}","icon":"","payload":"","payloadType":"str","topic":"","x":1390,"y":680,"wires":[[]]},{"id":"9fd97359.71672","type":"change","z":"fcfd505c.0baac","name":"","rules":[{"t":"set","p":"background","pt":"msg","to":"red","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"<i class=\"material-icons\">trending_up</i> UP","tot":"str"},{"t":"set","p":"colour","pt":"msg","to":"white","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1220,"y":640,"wires":[["cddfbe25.8cb83"]]},{"id":"841d72b4.1cc95","type":"switch","z":"fcfd505c.0baac","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"-1","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":990,"y":680,"wires":[["9fd97359.71672"],["2766e7bd.1020f8"],["8e8c7edd.6bb71"]]},{"id":"2766e7bd.1020f8","type":"change","z":"fcfd505c.0baac","name":"","rules":[{"t":"set","p":"background","pt":"msg","to":"yellow","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"<i class=\"material-icons\">trending_flat</i> UNCH","tot":"str"},{"t":"set","p":"colour","pt":"msg","to":"black","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1220,"y":680,"wires":[["cddfbe25.8cb83"]]},{"id":"8e8c7edd.6bb71","type":"change","z":"fcfd505c.0baac","name":"","rules":[{"t":"set","p":"background","pt":"msg","to":"green","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"<i class=\"material-icons\">trending_down</i> DOWN","tot":"str"},{"t":"set","p":"colour","pt":"msg","to":"black","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1220,"y":720,"wires":[["cddfbe25.8cb83"]]},{"id":"52061dd5.2b7024","type":"inject","z":"fcfd505c.0baac","name":"Get 2nd measurement at startup","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":"30","x":180,"y":200,"wires":[["409501d9.2b89d"]]},{"id":"9bf54798.f83e78","type":"ui_group","z":"","name":"Lewisville Lake (30m Updates)","tab":"37898252.e98cee","order":3,"disp":true,"width":"12","collapse":false},{"id":"37898252.e98cee","type":"ui_tab","z":"","name":"Lake and Stock Info","icon":"dashboard","order":3,"disabled":false,"hidden":false}] |