Hi everybody,
I am new here and want to build a weather station for my garden with Node-Red.
But now I have the problem that I want to connect a wind sensor to the Pi and the counting of the reed relays/contacts does not work as I want it to.
With the help of a "timed counter" I wanted to count every second the number of closed/open contacts. Unfortunately I never get "0" out. This means in reverse that I will not get a value when there is no wind.
Does any of you have another idea?
Here is my flow:
[
{
"id": "77f55f1.81340a",
"type": "rpi-gpio in",
"z": "8fce6b6d.1acf48",
"name": "GPIO27",
"pin": "13",
"intype": "down",
"debounce": "25",
"read": true,
"x": 260,
"y": 780,
"wires": [
[
"5a1777c.b72f288"
]
]
},
{
"id": "5a1777c.b72f288",
"type": "timed-counter",
"z": "8fce6b6d.1acf48",
"name": "CountGPIO27",
"timelimit": "1",
"timeunit": "1000",
"withhold": true,
"fixedtimeout": true,
"pertopic": false,
"x": 440,
"y": 780,
"wires": [
[
"1bc4fc7d.bedfe4"
]
]
},
{
"id": "1bc4fc7d.bedfe4",
"type": "function",
"z": "8fce6b6d.1acf48",
"name": "",
"func": "var msg = { payload:msg.count };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 610,
"y": 780,
"wires": [
[
"e2b6c2cd.02269",
"6e79bb99.739644",
"85804b86.ea72d8"
]
]
},
{
"id": "85804b86.ea72d8",
"type": "debug",
"z": "8fce6b6d.1acf48",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 970,
"y": 780,
"wires": []
},
{
"id": "e2b6c2cd.02269",
"type": "function",
"z": "8fce6b6d.1acf48",
"name": "mps",
"func": "msg.payload = ((msg.payload+2)/3);\nmsg.payload = msg.payload.toFixed(1)\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 770,
"y": 740,
"wires": [
[
"37678919.a79dd6",
"e6d1ca03.efb108"
]
]
},
{
"id": "37678919.a79dd6",
"type": "debug",
"z": "8fce6b6d.1acf48",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 970,
"y": 740,
"wires": []
},
{
"id": "6e79bb99.739644",
"type": "function",
"z": "8fce6b6d.1acf48",
"name": "kmph",
"func": "msg.payload = (((msg.payload+2)/3)*3.6);\nmsg.payload = msg.payload.toFixed(1)\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 770,
"y": 820,
"wires": [
[
"68aa0e1e.75fc5",
"51a7a8d7.5a4bd8"
]
]
},
{
"id": "68aa0e1e.75fc5",
"type": "debug",
"z": "8fce6b6d.1acf48",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 970,
"y": 820,
"wires": []
},
{
"id": "e6d1ca03.efb108",
"type": "ui_gauge",
"z": "8fce6b6d.1acf48",
"name": "",
"group": "48b04313.4ea4cc",
"order": 2,
"width": 0,
"height": 0,
"gtype": "donut",
"title": "",
"label": "m/s",
"format": "{{value}}",
"min": "0",
"max": "50",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"x": 970,
"y": 700,
"wires": []
},
{
"id": "51a7a8d7.5a4bd8",
"type": "ui_gauge",
"z": "8fce6b6d.1acf48",
"name": "",
"group": "48b04313.4ea4cc",
"order": 2,
"width": 0,
"height": 0,
"gtype": "donut",
"title": "",
"label": "km/h",
"format": "{{value}}",
"min": "0",
"max": "100",
"colors": [
"#00b500",
"#e6e600",
"#ca3838"
],
"seg1": "",
"seg2": "",
"x": 970,
"y": 860,
"wires": []
},
{
"id": "48b04313.4ea4cc",
"type": "ui_group",
"z": "",
"name": "Windgeschwindigkeit",
"tab": "1494dab6.b69d15",
"order": 3,
"disp": true,
"width": "6",
"collapse": false
},
{
"id": "1494dab6.b69d15",
"type": "ui_tab",
"z": "",
"name": "Wetterstation",
"icon": "dashboard",
"order": 1,
"disabled": false,
"hidden": false
}
]