For Gen24
Heres my implementation in HA with NodeRed and Sunspec Integration with Amber Electric
[{"id":"2460b7dd22fc0358","type":"tab","label":"Fronius Export Control Updated","disabled":false,"info":"","env":[]},{"id":"74dfb6afdf121d19","type":"group","z":"2460b7dd22fc0358","g":"66f0121a8b516555","name":"Enable Modbus Control - Max Output","style":{"label":true},"nodes":["4424e65c47235621","a88ec308cb52529a","f6bd5f54023308ae","8ea2ce8d05922290","d11275dec03844b6"],"x":1234,"y":539,"w":612,"h":162},{"id":"6993516a32a59b71","type":"group","z":"2460b7dd22fc0358","g":"66f0121a8b516555","name":"Disable Modbus Control - Limit Exports","style":{"label":true},"nodes":["e8bc3c34e4cb3f79","091ca0116b29db01","d4b4a54cb4aa17bb","073cc64d0420449c","95cb0b89c5be0909"],"x":1234,"y":739,"w":652,"h":162},{"id":"0cddcf6a8d4b09b6","type":"group","z":"2460b7dd22fc0358","g":"66f0121a8b516555","name":"Main Inverter Connected to Smart Meter","style":{"label":true},"nodes":["275bac20521dd815","31a7f969cf40e341","de8198b8483efb73","690bd84223e55379"],"x":1954,"y":659,"w":552,"h":142},{"id":"87543ce341c9e85d","type":"group","z":"2460b7dd22fc0358","g":"66f0121a8b516555","name":"Check Current WMaxLimEna","style":{"label":true},"nodes":["1859bb751ba0b5f0","4c52d84c52b01173","d06268381d9b1ba0"],"x":654,"y":559,"w":552,"h":142},{"id":"c46c62d7c69ba03a","type":"group","z":"2460b7dd22fc0358","g":"66f0121a8b516555","name":"Check Current WMaxLimEna","style":{"label":true},"nodes":["400182d674067c57","2b0c3617f5138257","5358b681c1fa3106"],"x":654,"y":759,"w":552,"h":122},{"id":"7c23f29e75638c08","type":"group","z":"2460b7dd22fc0358","g":"3e13df5b7039c004","name":"Second Inverter","style":{"label":true},"nodes":["a4d0152614a3671a","a2e60142c5be6a27","b9bccdc929bb7d54","87edb8670d5a32bb"],"x":1974,"y":1099,"w":572,"h":142},{"id":"c2afb15cb81777b8","type":"group","z":"2460b7dd22fc0358","g":"3e13df5b7039c004","name":"Dynamically Adjust the Secondary Inverter","style":{"label":true},"nodes":["95a5082971e6020d","6e0841d7f1b17b23","a84ab0e422e01311","54a89747c60a891d","f795ea8883d2a275","8ee37061c0cb1243","4c7a4b52a6607dac","e848c661cc6a1c9d","a6e826a02ccbc499","bf24288cf494992c","a7562a9309c05f96","27bf33342ce1e2dc","6fae0df315e7a4d1","9e079b793920b391","5acdfe004850534e","9da8d43e08d423c1","4d6165e9a0c55a3c","aaa39d4ab978700b","6e2437edceb64e40","f92ca82c5955f83c"],"x":614,"y":1279,"w":1512,"h":322},{"id":"8a8194d59417d91d","type":"group","z":"2460b7dd22fc0358","name":"Check 1 Minute Intervals","style":{"label":true},"nodes":["605792a73279325e","320786e1166ef1dc","2ed29017e4d3c228","19d4852685542b32","49aecce2493817e0"],"x":14,"y":759,"w":392,"h":227},{"id":"07080c7a21ef1938","type":"group","z":"2460b7dd22fc0358","name":"Check Battery Discharge - If Yes - Max Output","style":{"label":true},"nodes":["26222171c54a8ba8","becb5d2ee3e31bc3","2835bc346487d09c"],"x":14,"y":1139,"w":512,"h":162},{"id":"f7570cd12838d1bc","type":"group","z":"2460b7dd22fc0358","g":"3e13df5b7039c004","name":"Enable Modbus Control - Max Output","style":{"label":true},"nodes":["9262736b24c3dcf6","b26b238368b5fa83","911998946c7fe805","620bc736d07d3a2a","5eff2d6200c379b7"],"x":1214,"y":1099,"w":632,"h":162},{"id":"8022a2d03c6d4139","type":"group","z":"2460b7dd22fc0358","g":"3e13df5b7039c004","name":"Check Current WMaxLimPct","style":{"label":true},"nodes":["52109d151076b72c","72ea2cd944293cf4","1afdb5a6e1052829"],"x":634,"y":1119,"w":572,"h":142},{"id":"66f0121a8b516555","type":"group","z":"2460b7dd22fc0358","name":"Primary Inverter with Smart Meter","style":{"label":true},"nodes":["5658c3ae97fca855","158465a3e54de723","164d38eedc9e7059","93c8592b3ac2c868","74dfb6afdf121d19","6993516a32a59b71","0cddcf6a8d4b09b6","87543ce341c9e85d","c46c62d7c69ba03a"],"x":614,"y":479,"w":1918,"h":482},{"id":"3e13df5b7039c004","type":"group","z":"2460b7dd22fc0358","name":"Secondary Inverter","style":{"label":true},"nodes":["78921d383f9b79ea","1224a2a8f51a13d6","7c23f29e75638c08","c2afb15cb81777b8","f7570cd12838d1bc","8022a2d03c6d4139"],"x":588,"y":1039,"w":1984,"h":588},{"id":"8ea2ce8d05922290","type":"junction","z":"2460b7dd22fc0358","g":"74dfb6afdf121d19","x":1280,"y":640,"wires":[["a88ec308cb52529a"]]},{"id":"690bd84223e55379","type":"junction","z":"2460b7dd22fc0358","g":"0cddcf6a8d4b09b6","x":1980,"y":740,"wires":[["de8198b8483efb73"]]},{"id":"d11275dec03844b6","type":"junction","z":"2460b7dd22fc0358","g":"74dfb6afdf121d19","x":1780,"y":640,"wires":[["690bd84223e55379"]]},{"id":"073cc64d0420449c","type":"junction","z":"2460b7dd22fc0358","g":"6993516a32a59b71","x":1300,"y":780,"wires":[["091ca0116b29db01"]]},{"id":"95cb0b89c5be0909","type":"junction","z":"2460b7dd22fc0358","g":"6993516a32a59b71","x":1802.592529296875,"y":782.6665649414062,"wires":[["690bd84223e55379"]]},{"id":"87edb8670d5a32bb","type":"junction","z":"2460b7dd22fc0358","g":"7c23f29e75638c08","x":2000,"y":1180,"wires":[["b9bccdc929bb7d54"]]},{"id":"4c7a4b52a6607dac","type":"junction","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","x":640,"y":1440,"wires":[["bf24288cf494992c","f795ea8883d2a275","9e079b793920b391"]]},{"id":"620bc736d07d3a2a","type":"junction","z":"2460b7dd22fc0358","g":"f7570cd12838d1bc","x":1260,"y":1200,"wires":[["b26b238368b5fa83"]]},{"id":"5eff2d6200c379b7","type":"junction","z":"2460b7dd22fc0358","g":"f7570cd12838d1bc","x":1760,"y":1200,"wires":[["87edb8670d5a32bb"]]},{"id":"19d4852685542b32","type":"junction","z":"2460b7dd22fc0358","g":"8a8194d59417d91d","x":380,"y":920,"wires":[["1859bb751ba0b5f0","52109d151076b72c"]]},{"id":"49aecce2493817e0","type":"junction","z":"2460b7dd22fc0358","g":"8a8194d59417d91d","x":380,"y":960,"wires":[["400182d674067c57","26222171c54a8ba8"]]},{"id":"275bac20521dd815","type":"debug","z":"2460b7dd22fc0358","g":"0cddcf6a8d4b09b6","name":"PRIMARY: Inverter Set","active":false,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":2350,"y":760,"wires":[]},{"id":"4424e65c47235621","type":"inject","z":"2460b7dd22fc0358","g":"74dfb6afdf121d19","name":"ExportLimitOFF","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"str","x":1360,"y":580,"wires":[["a88ec308cb52529a"]]},{"id":"a88ec308cb52529a","type":"function","z":"2460b7dd22fc0358","g":"74dfb6afdf121d19","name":"100% Max Power","func":"var values = [(10000),(0),(0),(0),(1)];\n\nmsg.payload = { \n 'value': values,\n 'fc': 16,\n 'unitid': 1,\n 'address': 40242,\n 'quantity': 5\n} \n\nreturn msg","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1510,"y":660,"wires":[["f6bd5f54023308ae","d11275dec03844b6"]]},{"id":"f6bd5f54023308ae","type":"debug","z":"2460b7dd22fc0358","g":"74dfb6afdf121d19","name":"PRIMARY: MAX POWA SET","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1680,"y":580,"wires":[]},{"id":"31a7f969cf40e341","type":"modbus-response","z":"2460b7dd22fc0358","g":"0cddcf6a8d4b09b6","name":"","registerShowMax":20,"x":2330,"y":700,"wires":[]},{"id":"de8198b8483efb73","type":"modbus-flex-write","z":"2460b7dd22fc0358","g":"0cddcf6a8d4b09b6","name":"Fronius-Storage","showStatusActivities":true,"showErrors":true,"showWarnings":true,"server":"bcc4229c.180ac","emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"10","x":2100,"y":740,"wires":[["31a7f969cf40e341","275bac20521dd815"],["275bac20521dd815"]]},{"id":"e8bc3c34e4cb3f79","type":"inject","z":"2460b7dd22fc0358","g":"6993516a32a59b71","name":"ExportLimitOn","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"str","x":1350,"y":860,"wires":[["091ca0116b29db01"]]},{"id":"091ca0116b29db01","type":"function","z":"2460b7dd22fc0358","g":"6993516a32a59b71","name":"WMaxLim_Ena = 0","func":"msg.payload = { \n 'value': 0,\n 'fc': 6,\n 'unitid': 1,\n 'address': 40246,\n 'quantity': 1\n} \n\nreturn msg","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1510,"y":780,"wires":[["d4b4a54cb4aa17bb","95cb0b89c5be0909"]]},{"id":"d4b4a54cb4aa17bb","type":"debug","z":"2460b7dd22fc0358","g":"6993516a32a59b71","name":"PRIMARY: Set Export Limit","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1720,"y":860,"wires":[]},{"id":"5658c3ae97fca855","type":"comment","z":"2460b7dd22fc0358","g":"66f0121a8b516555","name":"When Positive Feed In - Max Output","info":"","x":1380,"y":520,"wires":[]},{"id":"158465a3e54de723","type":"comment","z":"2460b7dd22fc0358","g":"66f0121a8b516555","name":"When Negative Feed In - Limit Exports to 0","info":"","x":1400,"y":920,"wires":[]},{"id":"1859bb751ba0b5f0","type":"modbus-getter","z":"2460b7dd22fc0358","g":"87543ce341c9e85d","name":"Read_WMaxLimEna","showStatusActivities":false,"showErrors":false,"showWarnings":false,"logIOActivities":false,"unitid":"1","dataType":"HoldingRegister","adr":"40246","quantity":"1","server":"bcc4229c.180ac","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":true,"delayOnStart":false,"startDelayTime":"","x":780,"y":600,"wires":[["4c52d84c52b01173"],[]]},{"id":"4c52d84c52b01173","type":"switch","z":"2460b7dd22fc0358","g":"87543ce341c9e85d","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":990,"y":600,"wires":[["8ea2ce8d05922290"],["d06268381d9b1ba0"]]},{"id":"400182d674067c57","type":"modbus-getter","z":"2460b7dd22fc0358","g":"c46c62d7c69ba03a","name":"Read_WMaxLimEna","showStatusActivities":false,"showErrors":false,"showWarnings":false,"logIOActivities":false,"unitid":"1","dataType":"HoldingRegister","adr":"40246","quantity":"1","server":"bcc4229c.180ac","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":true,"delayOnStart":false,"startDelayTime":"","x":780,"y":800,"wires":[["2b0c3617f5138257"],[]]},{"id":"2b0c3617f5138257","type":"switch","z":"2460b7dd22fc0358","g":"c46c62d7c69ba03a","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":970,"y":800,"wires":[["073cc64d0420449c"],["5358b681c1fa3106"]]},{"id":"d06268381d9b1ba0","type":"debug","z":"2460b7dd22fc0358","g":"87543ce341c9e85d","name":"PRIMARY: Already Max","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":660,"wires":[]},{"id":"5358b681c1fa3106","type":"debug","z":"2460b7dd22fc0358","g":"c46c62d7c69ba03a","name":"PRIMARY: Already Limit","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":840,"wires":[]},{"id":"164d38eedc9e7059","type":"comment","z":"2460b7dd22fc0358","g":"66f0121a8b516555","name":"If WMaxLimEna is 0, set it to 1, if 1, then do nothing","info":"","x":850,"y":520,"wires":[]},{"id":"93c8592b3ac2c868","type":"comment","z":"2460b7dd22fc0358","g":"66f0121a8b516555","name":"If WMaxLimEna is 1, set it to 0, if 0, then do nothing","info":"","x":830,"y":920,"wires":[]},{"id":"a4d0152614a3671a","type":"debug","z":"2460b7dd22fc0358","g":"7c23f29e75638c08","name":"SECONDARY: Inverter Set","active":false,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":2380,"y":1200,"wires":[]},{"id":"a2e60142c5be6a27","type":"modbus-response","z":"2460b7dd22fc0358","g":"7c23f29e75638c08","name":"","registerShowMax":20,"x":2350,"y":1140,"wires":[]},{"id":"b9bccdc929bb7d54","type":"modbus-flex-write","z":"2460b7dd22fc0358","g":"7c23f29e75638c08","name":"Fronius-Storage","showStatusActivities":false,"showErrors":true,"showWarnings":false,"server":"ecd41b68db8d4254","emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"10","x":2120,"y":1180,"wires":[["a2e60142c5be6a27","a4d0152614a3671a"],["a4d0152614a3671a"]]},{"id":"95a5082971e6020d","type":"function","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"Decrease Power to Decrease Exports","func":"var curpower = msg.payload.power;\n\nvar invertermax = 5000;\n\nvar CurWMaxLimPct = msg.payload.WMaxLimPct;\nvar CurWMaxLim_Ena = msg.payload.WMaxLim_Ena;\n\nvar NewWMaxLimPct;\nvar NewWMaxLim_Ena;\n\nif (curpower < 0){\n \n curpower = curpower * -1;\n\n if( curpower > invertermax ){\n\n NewWMaxLimPct = 100;\n NewWMaxLim_Ena = 0;\n\n } else {\n\n var trim = curpower / invertermax * 10000;\n\n NewWMaxLimPct = CurWMaxLimPct - trim;\n\n if (NewWMaxLimPct < 100){\n\n NewWMaxLimPct = 100;\n NewWMaxLim_Ena = 0;\n\n } else {\n \n NewWMaxLim_Ena = 1;\n\n }\n \n }\n\n msg.payload.WMaxLimPct = NewWMaxLimPct;\n msg.payload.WMaxLim_Ena = NewWMaxLim_Ena;\n\n if (NewWMaxLimPct == CurWMaxLimPct){\n msg.newstate = \"donothing\";\n } else {\n msg.newstate = \"change\";\n }\n\n}\n\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1610,"y":1400,"wires":[["e848c661cc6a1c9d","aaa39d4ab978700b"]]},{"id":"6e0841d7f1b17b23","type":"function","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"InWRte","func":"var values = [msg.payload.WMaxLimPct, (0), (0), (0), msg.payload.WMaxLim_Ena]\n\nmsg.payload = { \n 'value': values,\n 'fc': 16,\n 'unitid': 1,\n 'address': 40242,\n 'quantity': 5\n} \n\nmsg.newstate = msg.WMaxLimPct\n\nreturn msg","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":2000,"y":1320,"wires":[["87edb8670d5a32bb"]]},{"id":"a84ab0e422e01311","type":"function","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"Increase Power to Reduce Imports","func":"var importpower = msg.payload.power;\n\nvar invertermax = 5000;\n\nvar CurWMaxLimPct = msg.payload.WMaxLimPct;\nvar CurWMaxLim_Ena = msg.payload.WMaxLim_Ena;\n\nvar NewWMaxLimPct;\nvar NewWMaxLim_Ena;\n\nif (importpower > 0){\n\n NewWMaxLim_Ena = 1; \n\n if( importpower > invertermax ){\n\n NewWMaxLimPct = 10000;\n\n } else {\n\n var add = importpower / invertermax * 10000;\n\n NewWMaxLimPct = add + CurWMaxLimPct;\n\n if (NewWMaxLimPct > 10000){\n\n NewWMaxLimPct = 10000;\n\n } \n }\n\n msg.payload.WMaxLimPct = NewWMaxLimPct;\n msg.payload.WMaxLim_Ena = NewWMaxLim_Ena; \n\n if (CurWMaxLimPct == NewWMaxLimPct){\n msg.newstate = \"donothing\";\n } else {\n msg.newstate = \"change\";\n }\n}\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1600,"y":1480,"wires":[["e848c661cc6a1c9d","6e2437edceb64e40"]]},{"id":"54a89747c60a891d","type":"switch","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"500w limit","property":"payload.power","propertyType":"msg","rules":[{"t":"lte","v":"-500","vt":"num"},{"t":"btwn","v":"-500","vt":"num","v2":"500","v2t":"num"},{"t":"gte","v":"500","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":1360,"y":1440,"wires":[["95a5082971e6020d"],["8ee37061c0cb1243"],["a84ab0e422e01311"]]},{"id":"f795ea8883d2a275","type":"api-current-state","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"Export Power Check","server":"61d027bd.371248","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.ac_meter_watts","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"newstate","propertyType":"msg","value":"","valueType":"str"},{"property":"topic","propertyType":"msg","value":"power","valueType":"str"}],"for":"30","forType":"num","forUnits":"seconds","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":780,"y":1440,"wires":[["6fae0df315e7a4d1"]]},{"id":"8ee37061c0cb1243","type":"debug","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"SECONDARY: Within 500W","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1600,"y":1440,"wires":[]},{"id":"605792a73279325e","type":"api-current-state","z":"2460b7dd22fc0358","g":"8a8194d59417d91d","name":"AmberPrice","server":"61d027bd.371248","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.amber_feed_in_price","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":170,"y":880,"wires":[["320786e1166ef1dc"]]},{"id":"320786e1166ef1dc","type":"switch","z":"2460b7dd22fc0358","g":"8a8194d59417d91d","name":"Above 0, or Less Equal to 0","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"},{"t":"lte","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":240,"y":940,"wires":[["19d4852685542b32"],["49aecce2493817e0"]]},{"id":"2ed29017e4d3c228","type":"cronplus","z":"2460b7dd22fc0358","g":"8a8194d59417d91d","name":"1 Min Interval","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"topic1","payloadType":"default","payload":"","expressionType":"cron","expression":"30 * 5-20 * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":140,"y":800,"wires":[["605792a73279325e"]]},{"id":"e848c661cc6a1c9d","type":"switch","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"","property":"newstate","propertyType":"msg","rules":[{"t":"eq","v":"change","vt":"str"},{"t":"eq","v":"donothing","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1850,"y":1440,"wires":[["6e0841d7f1b17b23"],["a7562a9309c05f96"]]},{"id":"bf24288cf494992c","type":"modbus-getter","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"Read_WMaxLimPct","showStatusActivities":false,"showErrors":false,"showWarnings":false,"logIOActivities":false,"unitid":"1","dataType":"HoldingRegister","adr":"40242","quantity":"1","server":"ecd41b68db8d4254","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":true,"delayOnStart":false,"startDelayTime":"","x":780,"y":1380,"wires":[["a6e826a02ccbc499"],[]]},{"id":"a6e826a02ccbc499","type":"function","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"function 20","func":" \nvar data = msg.payload;\n\nvar limit = data[0];\n\nmsg.payload = limit;\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":1380,"wires":[["27bf33342ce1e2dc"]]},{"id":"a7562a9309c05f96","type":"debug","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"SECONDARY: Do nothing","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1970,"y":1500,"wires":[]},{"id":"27bf33342ce1e2dc","type":"change","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"WMaxLimPct","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":1380,"wires":[["6fae0df315e7a4d1"]]},{"id":"6fae0df315e7a4d1","type":"join","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"5","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1230,"y":1440,"wires":[["54a89747c60a891d"]]},{"id":"f92ca82c5955f83c","type":"inject","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":720,"y":1560,"wires":[["4c7a4b52a6607dac"]]},{"id":"26222171c54a8ba8","type":"api-current-state","z":"2460b7dd22fc0358","g":"07080c7a21ef1938","name":"BatteryDischarge","server":"61d027bd.371248","version":3,"outputs":2,"halt_if":"500","halt_if_type":"num","halt_if_compare":"gt","entity_id":"sensor.kw10_mppt_module_3_dc_power","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"discharge","valueType":"str"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":130,"y":1180,"wires":[["52109d151076b72c"],["becb5d2ee3e31bc3"]]},{"id":"4d6165e9a0c55a3c","type":"inject","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"","props":[{"p":"payload"},{"p":"complete","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1100,"y":1320,"wires":[["6fae0df315e7a4d1"]]},{"id":"9e079b793920b391","type":"modbus-getter","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"Read_WMaxLimEna","showStatusActivities":false,"showErrors":false,"showWarnings":false,"logIOActivities":false,"unitid":"1","dataType":"HoldingRegister","adr":"40246","quantity":"1","server":"ecd41b68db8d4254","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":true,"delayOnStart":false,"startDelayTime":"","x":780,"y":1500,"wires":[["5acdfe004850534e"],[]]},{"id":"5acdfe004850534e","type":"function","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"function 31","func":" \nvar data = msg.payload;\n\nvar limit = data[0];\n\nmsg.payload = limit;\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":1500,"wires":[["9da8d43e08d423c1"]]},{"id":"9da8d43e08d423c1","type":"change","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"WMaxLim_Ena","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":1500,"wires":[["6fae0df315e7a4d1"]]},{"id":"78921d383f9b79ea","type":"comment","z":"2460b7dd22fc0358","g":"3e13df5b7039c004","name":"When Positive Feed In - Max Output","info":"","x":1380,"y":1080,"wires":[]},{"id":"1224a2a8f51a13d6","type":"comment","z":"2460b7dd22fc0358","g":"3e13df5b7039c004","name":"If WMaxLimPct is less than 10000, set it to 10000, if already 10000, then do nothing","info":"","x":910,"y":1080,"wires":[]},{"id":"9262736b24c3dcf6","type":"inject","z":"2460b7dd22fc0358","g":"f7570cd12838d1bc","name":"ExportLimitOFF","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"str","x":1340,"y":1140,"wires":[["b26b238368b5fa83"]]},{"id":"b26b238368b5fa83","type":"function","z":"2460b7dd22fc0358","g":"f7570cd12838d1bc","name":"100% Max Power","func":"var values = [(10000),(0),(0),(0),(1)];\n\nmsg.payload = { \n 'value': values,\n 'fc': 16,\n 'unitid': 1,\n 'address': 40242,\n 'quantity': 5\n} \n\nmsg.newstate = \"max\";\n\nreturn msg","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1490,"y":1220,"wires":[["911998946c7fe805","5eff2d6200c379b7"]]},{"id":"911998946c7fe805","type":"debug","z":"2460b7dd22fc0358","g":"f7570cd12838d1bc","name":"SECONDARY: MAX POWA SET","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1670,"y":1140,"wires":[]},{"id":"52109d151076b72c","type":"modbus-getter","z":"2460b7dd22fc0358","g":"8022a2d03c6d4139","name":"Read_WMaxLimPct","showStatusActivities":false,"showErrors":false,"showWarnings":false,"logIOActivities":false,"unitid":"1","dataType":"HoldingRegister","adr":"40242","quantity":"1","server":"ecd41b68db8d4254","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":true,"delayOnStart":false,"startDelayTime":"","x":760,"y":1160,"wires":[["72ea2cd944293cf4"],[]]},{"id":"72ea2cd944293cf4","type":"switch","z":"2460b7dd22fc0358","g":"8022a2d03c6d4139","name":"","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"10000","vt":"num"},{"t":"eq","v":"10000","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":970,"y":1160,"wires":[["620bc736d07d3a2a"],["1afdb5a6e1052829"]]},{"id":"1afdb5a6e1052829","type":"debug","z":"2460b7dd22fc0358","g":"8022a2d03c6d4139","name":"SECONDARY: Already Max","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1040,"y":1220,"wires":[]},{"id":"aaa39d4ab978700b","type":"debug","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"SECONDARY: Decrease Power?","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1740,"y":1340,"wires":[]},{"id":"6e2437edceb64e40","type":"debug","z":"2460b7dd22fc0358","g":"c2afb15cb81777b8","name":"SECONDARY: Increase Power?","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1710,"y":1540,"wires":[]},{"id":"becb5d2ee3e31bc3","type":"api-current-state","z":"2460b7dd22fc0358","g":"07080c7a21ef1938","name":"Battery Charge Rate Less Than 4500","server":"61d027bd.371248","version":3,"outputs":2,"halt_if":"4500","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.kw10_mppt_module_2_dc_power","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":190,"y":1260,"wires":[["2835bc346487d09c"],["4c7a4b52a6607dac"]]},{"id":"2835bc346487d09c","type":"api-current-state","z":"2460b7dd22fc0358","g":"07080c7a21ef1938","name":"Battery Not Full","server":"61d027bd.371248","version":3,"outputs":2,"halt_if":"100","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.kw10_storage_chastate","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":420,"y":1200,"wires":[["52109d151076b72c"],["4c7a4b52a6607dac"]]},{"id":"bcc4229c.180ac","type":"modbus-client","name":"Fronius 10kw","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":true,"queueLogEnabled":false,"failureLogEnabled":true,"tcpHost":"192.168.0.179","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true},{"id":"ecd41b68db8d4254","type":"modbus-client","name":"fronius5kw","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":true,"queueLogEnabled":false,"failureLogEnabled":true,"tcpHost":"192.168.0.173","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true,"showWarnings":true,"showLogs":true},{"id":"61d027bd.371248","type":"server","name":"Home Assistant HOME","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
You can read through my process here:
How To Control and Automate Your Export Limit Your Fronius Gen24 Inverter(s) on Amber Electric with NodeRed and HomeAssistant!