Open Harveg opened 3 years ago
[{"id":"9959013b.d741e","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"ae52b984.b0db38","type":"http request","z":"9959013b.d741e","name":"","method":"POST","ret":"obj","paytoqs":"ignore","url":"http://192.168.0.141:3000/api/alerts/1/pause","tls":"","persist":false,"proxy":"","authType":"bearer","x":490,"y":200,"wires":[["9b07bc30.07b0c"]]},{"id":"cddae128.357e9","type":"inject","z":"9959013b.d741e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":200,"wires":[["ae52b984.b0db38"]]},{"id":"dbecdba0.41f598","type":"function","z":"9959013b.d741e","name":"","func":"msg.header = {\n '/api/alerts/1'\n};\nreturn msg;","outputs":1,"noerr":4,"initialize":"","finalize":"","x":120,"y":300,"wires":[["ae52b984.b0db38"]]},{"id":"9b07bc30.07b0c","type":"debug","z":"9959013b.d741e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":910,"y":200,"wires":[]},{"id":"a3fd5184.4fb02","type":"inject","z":"9959013b.d741e","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"paused\":true}","payloadType":"json","x":160,"y":80,"wires":[["ae52b984.b0db38"]]},{"id":"77ee5b28.cafb14","type":"inject","z":"9959013b.d741e","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"paused\":false}","payloadType":"json","x":160,"y":120,"wires":[["ae52b984.b0db38"]]}]
Im Fall das ein Raum nicht genutzt wird sollte der Grafana Alert pausiert werden und sobald dass wieder eine Lot-Nr eingegeben wird, wird dieser aktiviert. https://grafana.com/docs/grafana/latest/http_api/alerting/ Im Node-Red einen Sub-Flow erstellen welcher die HTTP Api von Grafana ansteuert.