you want the arrows visible or invisible depending on which way the power is flowing now?
yes
But what does it have to do with the database?
its just temporary storage, the db structure is not finished, cause i cannot get the code correct.
[{"id":"54a9a5742e6589df","type":"inject","z":"0f9de81aaa0f53ef","name":"grid 10kw","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"grid","payload":"10","payloadType":"num","x":1060,"y":280,"wires":[["b0f91c6b7a6a9ebe"]]},{"id":"98de6e3932b870cb","type":"inject","z":"0f9de81aaa0f53ef","name":"grid 5kw","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"grid","payload":"5","payloadType":"num","x":1070,"y":320,"wires":[["b0f91c6b7a6a9ebe"]]},{"id":"d64e5e3cef802ac1","type":"inject","z":"0f9de81aaa0f53ef","name":"grid 0kw","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"grid","payload":"0","payloadType":"num","x":1070,"y":360,"wires":[["b0f91c6b7a6a9ebe"]]},{"id":"20ecf3913e027a6d","type":"inject","z":"0f9de81aaa0f53ef","name":"pv 10kw","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"pv","payload":"10","payloadType":"num","x":1180,"y":160,"wires":[["b0f91c6b7a6a9ebe"]]},{"id":"2eba78cae8d3539d","type":"inject","z":"0f9de81aaa0f53ef","name":"pv 5kw","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"pv","payload":"5","payloadType":"num","x":1180,"y":200,"wires":[["b0f91c6b7a6a9ebe"]]},{"id":"617c9b100fa7de22","type":"inject","z":"0f9de81aaa0f53ef","name":"pv 0kw","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"pv","payload":"0","payloadType":"num","x":1180,"y":240,"wires":[["b0f91c6b7a6a9ebe"]]},{"id":"568404e6d863285c","type":"inject","z":"0f9de81aaa0f53ef","name":"home 10kw","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"home","payload":"10","payloadType":"num","x":1310,"y":280,"wires":[["b0f91c6b7a6a9ebe"]]},{"id":"97da716273846630","type":"inject","z":"0f9de81aaa0f53ef","name":"home 5kw","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"home","payload":"5","payloadType":"num","x":1310,"y":320,"wires":[["b0f91c6b7a6a9ebe"]]},{"id":"c735f94eec9b7789","type":"inject","z":"0f9de81aaa0f53ef","name":"home 0kw","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"home","payload":"0","payloadType":"num","x":1310,"y":360,"wires":[["b0f91c6b7a6a9ebe"]]},{"id":"ed5e86035a25a4ad","type":"inject","z":"0f9de81aaa0f53ef","name":"bp 10kw","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"bp","payload":"10","payloadType":"num","x":1180,"y":400,"wires":[["b0f91c6b7a6a9ebe"]]},{"id":"84fb9bb7243ccdc3","type":"inject","z":"0f9de81aaa0f53ef","name":"bp 5kw","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"bp","payload":"5","payloadType":"num","x":1180,"y":440,"wires":[["b0f91c6b7a6a9ebe"]]},{"id":"f18a622f04ac9109","type":"inject","z":"0f9de81aaa0f53ef","name":"bp 0kw","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"bp","payload":"0","payloadType":"num","x":1180,"y":480,"wires":[["b0f91c6b7a6a9ebe"]]},{"id":"b0f91c6b7a6a9ebe","type":"join","z":"0f9de81aaa0f53ef","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1490,"y":300,"wires":[["0f0a0d4929135d48","ee178b050bd410cc"]]},{"id":"0f0a0d4929135d48","type":"debug","z":"0f9de81aaa0f53ef","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1530,"y":220,"wires":[]},{"id":"ee178b050bd410cc","type":"function","z":"0f9de81aaa0f53ef","name":"pv,home,bp","func":"//var pv = payload.pv\n//var home = payload.home\n//var bp = payload.bp\n//var grid = \"0\"\n\n//math... \nvar plusorminus = (msg.payload.home - msg.payload.pv)\nmsg.payload = plusorminus;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1670,"y":300,"wires":[["62b7b58.d85804c"]]},{"id":"62b7b58.d85804c","type":"switch","z":"0f9de81aaa0f53ef","name":"","property":"$number(payload)","propertyType":"jsonata","rules":[{"t":"lt","v":"0","vt":"num"},{"t":"gt","v":"0","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1510,"y":440,"wires":[["b2f576f7.07073"],["8e0f836.ea41a8"],["4855cece.93e67"]]},{"id":"4855cece.93e67","type":"debug","z":"0f9de81aaa0f53ef","name":"0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1690,"y":480,"wires":[]},{"id":"b2f576f7.07073","type":"debug","z":"0f9de81aaa0f53ef","name":"-1 (overproduction","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1730,"y":400,"wires":[]},{"id":"8e0f836.ea41a8","type":"debug","z":"0f9de81aaa0f53ef","name":"1 (from power source)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1740,"y":440,"wires":[]}]