I am trying to strip off some text from the date in the output from a influxDB node, to use in a dashboard chart node. But it does not work. The date is not altered by the change node.
When I try to create the same message with an injection node, it seems to work.
So I belive there is a difference here, that I don't get...
This is my flow:
[{"id":"ee91f817.afad68","type":"influxdb in","z":"a42ecbde.f79ce8","influxdb":"3712e327.ec6fac","name":"running","query":"SELECT MEAN(value) FROM running GROUP BY time(1d) LIMIT 1","rawOutput":false,"precision":"","retentionPolicy":"","x":300,"y":380,"wires":[["8403e3b7.bdd9f","ddc5ea89.c7edd8"]]},{"id":"57ecc154.fa056","type":"debug","z":"a42ecbde.f79ce8","name":"unchanged","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":650,"y":260,"wires":[]},{"id":"3820987c.e490d8","type":"inject","z":"a42ecbde.f79ce8","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"0","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":380,"wires":[["ee91f817.afad68"]]},{"id":"ddc5ea89.c7edd8","type":"split","z":"a42ecbde.f79ce8","name":"","splt":"","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":470,"y":380,"wires":[["fe92ea38.f48e78","59465a9e.76b4c4","57ecc154.fa056"]]},{"id":"5788d0f6.72237","type":"inject","z":"a42ecbde.f79ce8","name":"","topic":"","payload":"{\"time\":\"2020-08-24T00:00:00.000Z\",\"mean\":0.2}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":320,"wires":[["59465a9e.76b4c4","57ecc154.fa056"]]},{"id":"59465a9e.76b4c4","type":"change","z":"a42ecbde.f79ce8","name":"change","rules":[{"t":"delete","p":"parts","pt":"msg"},{"t":"change","p":"payload.time","pt":"msg","from":"[0-9][0-9][0-9][0-9]-","fromt":"re","to":"","tot":"str"},{"t":"change","p":"payload.time","pt":"msg","from":"T.*","fromt":"re","to":"","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"payload.time","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.mean","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":320,"wires":[["3d8fb850.db7408"]]},{"id":"3d8fb850.db7408","type":"debug","z":"a42ecbde.f79ce8","name":"changed","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":860,"y":320,"wires":[]},{"id":"3712e327.ec6fac","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"varmepumpe","name":"","usetls":false,"tls":""}]
Example of message coming out of the split node:
{"topic":"","payload":{"time":"2020-08-24T00:00:00.000Z","mean":0.05555555555555555},"parts":{"id":"9b7d829d.49cad","type":"array","count":1,"len":1,"index":0},"_msgid":"949f4826.20a628"}
Can someone offer an explanation?