|
本帖最后由 花开堪折枝 于 2024-5-7 13:47 编辑
先看流程
mqtt数据如下
"data": {
"year": 2018,
"month": 11,
"day": 9,
"lunarYear": 2018,
"lunarMonth": 10,
"lunarDay": 2,
"cnyear": "贰零壹捌 ",
"cnmonth": "十",
"cnday": "初二",
"hyear": "戊戌",
"cyclicalYear": "戊戌",
"cyclicalMonth": "癸亥",
"cyclicalDay": "乙巳",
"suit": "祭祀,解除,破屋,坏垣,求医,治病,馀事勿取",
"taboo": "嫁娶,安葬",
"animal": "狗",
"week": "Friday",
"festivalList": [],
"jieqi": {
"8": "立冬",
"22": "小雪"
},
"maxDayInMonth": 29,
"leap": false,
"lunarYearString": "戊戌",
"bigMonth": false
}
流程信息
[{"id":"fe3cb423.69e4f8","type":"tab","label":"流程2","disabled":false,"info":""},{"id":"b72d9cbe.6cde","type":"inject","z":"fe3cb423.69e4f8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":125,"y":144,"wires":[["33aff5d3.5ea44a"]]},{"id":"dacd9b2f.6fe928","type":"http request","z":"fe3cb423.69e4f8","name":"获取节气","method":"GET","ret":"obj","url":"https://www.sojson.com/open/api/lunar/json.shtml","tls":"","x":490,"y":133,"wires":[["ce6cef22.456e4","437d983c.91e728"]]},{"id":"ce6cef22.456e4","type":"debug","z":"fe3cb423.69e4f8","name":"调式节点","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":704,"y":48,"wires":[]},{"id":"33aff5d3.5ea44a","type":"function","z":"fe3cb423.69e4f8","name":"数据处理","func":"msg.headers = {};\nmsg.headers['user-agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36';\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":138,"wires":[["dacd9b2f.6fe928"]]},{"id":"437d983c.91e728","type":"switch","z":"fe3cb423.69e4f8","name":"","property":"payload.status","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":487,"y":220,"wires":[["18c38ec3.e88781"]]},{"id":"18c38ec3.e88781","type":"function","z":"fe3cb423.69e4f8","name":"数据处理","func":"msg.payload = msg.payload.data\nreturn msg;","outputs":1,"noerr":0,"x":669,"y":217,"wires":[["ce6cef22.456e4","f5ed75bf.050da8"]]},{"id":"f5ed75bf.050da8","type":"mqtt out","z":"fe3cb423.69e4f8","name":"mqtt发送","topic":"/node-red/jieqi","qos":"0","retain":"","broker":"1550bab3.2a8365","x":920,"y":174,"wires":[]},{"id":"1550bab3.2a8365","type":"mqtt-broker","z":"","name":"home","broker":"shenfan.f3322.net","port":"2883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
|
|