As @waaren already said, it is up to you whether you choose the solution with dzVents, which is quite compact, or if you choose to implement the solution with Node Red.
As @waaren already presented his solution, I cannot stay behind.
Code: Select all
[{"id":"f1324d44.f6688","type":"tab","label":"Waterstanden","disabled":false,"info":""},{"id":"c0e85807.57038","type":"http request","z":"f1324d44.f6688","name":"Waterstand Nijmegen haven","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://waterinfo.rws.nl/api/chart?mapType=waterhoogte&locationCode=Nijmegen-haven(NIJM)&values=-6,3","tls":"","persist":false,"proxy":"","authType":"","x":460,"y":140,"wires":[["85ee7f6b.fcb8e"]]},{"id":"bb820068.b3cc58","type":"inject","z":"f1324d44.f6688","name":"10 Minute Inject","props":[{"p":"payload"}],"repeat":"600","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":190,"y":140,"wires":[["c0e85807.57038"]]},{"id":"a54daffb.02255","type":"function","z":"f1324d44.f6688","name":"","func":"var time = msg.payload.t0;\nvar height = msg.payload.series[0].data[msg.payload.series[0].data.length - 1].value;\nmsg.payload = {\"command\":\"udevice\", \"idx\":11, \"svalue\":\"Meettijdstip: \" + time +\"\\n\" + \"Waterstand: \" + height + \" cm\"};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":960,"y":140,"wires":[["995c142.98c27e8","90315b4d.41f05"]]},{"id":"995c142.98c27e8","type":"debug","z":"f1324d44.f6688","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1150,"y":200,"wires":[]},{"id":"85ee7f6b.fcb8e","type":"moment","z":"f1324d44.f6688","name":"","topic":"","input":"payload.t0","inputType":"msg","inTz":"ETC/UTC","adjAmount":0,"adjType":"days","adjDir":"add","format":"DD-MM-YYYY/HH:mm:ss","locale":"nl-NL","output":"payload.t0","outputType":"msg","outTz":"Europe/Amsterdam","x":740,"y":140,"wires":[["a54daffb.02255"]]},{"id":"90315b4d.41f05","type":"mqtt out","z":"f1324d44.f6688","name":"To Domoticz","topic":"domoticz/in","qos":"","retain":"","broker":"f9f13036.e28b58","x":1150,"y":140,"wires":[]},{"id":"f9f13036.e28b58","type":"mqtt-broker","name":"localhost","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
As I have chosen to put the data in a "Text" sensor, you will see the following result:
If you want another sensor, I can adapt the flow, quite easily.
Do not forget to change the IDX number (currently 11).