2023年9月29日 星期五

Node-Red Dashboard

 Node-Red Dashboard 



 

節點

設定

Inject

Msg.payload :Use the toggle switch to start / stop the generation of random numbers

text

{{msg.payload}}

 

inject

週期性 1秒執行一次

switch

On payload :  true

Off payload :  false

function

Random #s

if( msg.payload === false ) {

    return null;

}

msg.payload = Math.round(Math.random()*100);

return msg;

chart

 


Gauge

 

Slider

 


Text

 

Switch

msg.payload > 90

template

msg.payload : Alert : Critical Value Detected {{payload}}

notification

Top right

 


[{"id":"2aeb3b7c.7a1e5c","type":"inject","z":"47a8c4a5.ba4714","name":"","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"str"}],"repeat":"1","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":110,"y":140,"wires":[["cc96c240.90a93"]]},{"id":"1910e637.2cfbea","type":"function","z":"47a8c4a5.ba4714","name":"Random #s","func":"if( msg.payload === false ) {\n    return null;\n}\nmsg.payload = Math.round(Math.random()*100);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":140,"wires":[["bc218cf4.508e2"]]},{"id":"bc10b2e7.c144f8","type":"ui_chart","z":"47a8c4a5.ba4714","name":"Chart","group":"1454ffb1.6e2f","order":1,"width":0,"height":0,"label":"Random #","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"Querying Entropy","dot":false,"ymin":"0","ymax":"100","removeOlder":"1","removeOlderPoints":"","removeOlderUnit":"60","cutout":"","useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"x":350,"y":240,"wires":[[]]},{"id":"557c8db7.8c2cd4","type":"ui_gauge","z":"47a8c4a5.ba4714","name":"Gauge","group":"1454ffb1.6e2f","order":2,"width":0,"height":0,"gtype":"gage","title":"Gauge","label":"units","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":350,"y":280,"wires":[]},{"id":"7f62527e.e7067c","type":"ui_slider","z":"47a8c4a5.ba4714","name":"","label":"Slider","group":"1454ffb1.6e2f","order":3,"width":0,"height":0,"passthru":true,"topic":"","min":0,"max":"100","step":"","x":350,"y":320,"wires":[[]]},{"id":"45ef900.f6932f","type":"ui_text","z":"47a8c4a5.ba4714","group":"1454ffb1.6e2f","order":4,"width":0,"height":0,"name":"","label":"Text","format":"{{msg.payload}}","layout":"row-spread","x":350,"y":360,"wires":[]},{"id":"cc96c240.90a93","type":"ui_switch","z":"47a8c4a5.ba4714","name":"","label":"Switch","tooltip":"","group":"ed1d5d5f.dc5c58","order":2,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","topicType":"str","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","animate":true,"className":"","x":270,"y":140,"wires":[["1910e637.2cfbea"]]},{"id":"ba7045e9.bad2","type":"ui_text","z":"47a8c4a5.ba4714","group":"ed1d5d5f.dc5c58","order":1,"width":0,"height":0,"name":"","label":"","format":"{{msg.payload}}","layout":"row-spread","className":"","x":270,"y":60,"wires":[]},{"id":"8f48941c.73a7f","type":"inject","z":"47a8c4a5.ba4714","name":"Instructions","props":[{"p":"payload","v":"Use the toggle switch to start / stop the generation of random numbers","vt":"str"},{"p":"topic","v":"","vt":"str"}],"repeat":"","crontab":"","once":true,"topic":"","payload":"Use the toggle switch to start / stop the generation of random numbers","payloadType":"str","x":110,"y":60,"wires":[["ba7045e9.bad2"]]},{"id":"e24396b6.4fe748","type":"ui_toast","z":"47a8c4a5.ba4714","position":"top right","displayTime":"5","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"","x":790,"y":400,"wires":[]},{"id":"821084fb.210548","type":"switch","z":"47a8c4a5.ba4714","name":"Warn on High Values","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"90","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":400,"y":400,"wires":[["9de2c880.141548"]]},{"id":"9de2c880.141548","type":"template","z":"47a8c4a5.ba4714","name":"Alert Msg","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Alert : Critical Value Detected {{payload}}","output":"str","x":600,"y":400,"wires":[["e24396b6.4fe748"]]},{"id":"bc218cf4.508e2","type":"link out","z":"47a8c4a5.ba4714","name":"","links":["5ecb2b4b.05bf4c"],"x":555,"y":140,"wires":[]},{"id":"5ecb2b4b.05bf4c","type":"link in","z":"47a8c4a5.ba4714","name":"","links":["bc218cf4.508e2"],"x":115,"y":320,"wires":[["bc10b2e7.c144f8","557c8db7.8c2cd4","7f62527e.e7067c","45ef900.f6932f","821084fb.210548"]]},{"id":"1454ffb1.6e2f","type":"ui_group","z":"47a8c4a5.ba4714","name":"Dashboard Controls","tab":"f65c9267.a2ce5","order":2,"disp":true,"width":"6"},{"id":"ed1d5d5f.dc5c58","type":"ui_group","name":"Start / Stop","tab":"f65c9267.a2ce5","order":1,"disp":true,"width":"6"},{"id":"f65c9267.a2ce5","type":"ui_tab","z":"47a8c4a5.ba4714","name":"Introduction","icon":"dashboard","order":2}]

沒有留言:

張貼留言

2024產專班 作業2 (純模擬)

2024產專班 作業2  (純模擬) 1) LED ON,OFF,TIMER,FLASH 模擬 (switch 控制) 2)RFID卡號模擬 (buttom  模擬RFID UID(不從ESP32) Node-Red 程式 [{"id":"d8886...