I’ll try to explain my node-red flow (this is for automation of solar-power). Still working on load balancing and debugging.
I have a renault e-tech megane,
Battery level coming in via integration to set the max charging level: input number in home assistant. Extra to 100% charge if sun allows via node-red ‘zonneladen’ input number. (input boolean to allow)
Charging speed via input select in HA to input number ‘basisladen’ 0.2 kW to pauze/stop.
Sum of different kWh input numbers in second flow.
[{"id":"eedcfd7df3194436","type":"tab","label":"Laadpaal","disabled":false,"info":"","env":[]},{"id":"892f8259917c0166","type":"inject","z":"eedcfd7df3194436","name":"Poll every 10 sec","props":[{"p":"payload"}],"repeat":"10","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":400,"wires":[["cb2b8fdee318a7ca","f5cba20a139af5a8"]]},{"id":"36284cdd65b3f97c","type":"trigger-state","z":"eedcfd7df3194436","name":"keuzemenu","server":"777449db.c1d348","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"input_select.laadopties","entityidfiltertype":"exact","debugenabled":false,"constraints":[],"inputs":0,"outputs":7,"customoutputs":[{"messageType":"default","messageValue":"0","messageValueType":"num","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"Alleen zon","comparatorValueDataType":"str"},{"messageType":"default","messageValue":"1.2","messageValueType":"num","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"6A (minimaal)","comparatorValueDataType":"str"},{"messageType":"default","messageValue":"6","messageValueType":"num","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"6Kw (overnight)","comparatorValueDataType":"str"},{"messageType":"default","messageValue":"","messageValueType":"json","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"8Kw","comparatorValueDataType":"str"},{"messageType":"default","messageValue":"","messageValueType":"json","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"11Kw (max)","comparatorValueDataType":"str"}],"outputinitially":false,"state_type":"str","enableInput":false,"x":90,"y":140,"wires":[[],[],["517abe446903208f"],["05039093707c78f8"],["b3e2058b5cc0518a"],["4cb461647a56c987"],["6835eebbf83fa5b4"]]},{"id":"b3e2058b5cc0518a","type":"api-call-service","z":"eedcfd7df3194436","name":"6Kw","server":"777449db.c1d348","version":5,"debugenabled":true,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.basisladen"],"data":"{\"value\":\"6\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":290,"y":180,"wires":[["9e0e0f67c5877696"]]},{"id":"9e0e0f67c5877696","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"f52c678d.eab598","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.basisladen","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":1540,"y":180,"wires":[[]]},{"id":"517abe446903208f","type":"api-call-service","z":"eedcfd7df3194436","name":"Alleen zon","server":"777449db.c1d348","version":5,"debugenabled":true,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.basisladen"],"data":"{\"value\":\"0.2\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":310,"y":100,"wires":[["9e0e0f67c5877696"]]},{"id":"05039093707c78f8","type":"api-call-service","z":"eedcfd7df3194436","name":"6A","server":"777449db.c1d348","version":5,"debugenabled":true,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.basisladen"],"data":"{\"value\":\"1.2\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":290,"y":140,"wires":[["9e0e0f67c5877696"]]},{"id":"4cb461647a56c987","type":"api-call-service","z":"eedcfd7df3194436","name":"8Kw","server":"777449db.c1d348","version":5,"debugenabled":true,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.basisladen"],"data":"{\"value\":\"8\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":290,"y":240,"wires":[["9e0e0f67c5877696"]]},{"id":"6835eebbf83fa5b4","type":"api-call-service","z":"eedcfd7df3194436","name":"11Kw","server":"777449db.c1d348","version":5,"debugenabled":true,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.basisladen"],"data":"{\"value\":\"11\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":290,"y":300,"wires":[["9e0e0f67c5877696"]]},{"id":"cb2b8fdee318a7ca","type":"api-current-state","z":"eedcfd7df3194436","name":"zonneladen Button Active ?","server":"f52c678d.eab598","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.zonneladen","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":180,"y":500,"wires":[["e9e36f7ea984eaa7"]]},{"id":"9df7ee1516292e5b","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"777449db.c1d348","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.power_production","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":960,"y":620,"wires":[["d1f11cfbf9254c5f"]]},{"id":"d1f11cfbf9254c5f","type":"switch","z":"eedcfd7df3194436","name":"Set power level Charger","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0.250","vt":"num"},{"t":"lt","v":"0.75","vt":"num"}],"checkall":"false","repair":false,"outputs":2,"x":990,"y":500,"wires":[["d70c1ce270339a4a"],["c7dd89e910be5f1e"]]},{"id":"8db8862ac129f287","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"f52c678d.eab598","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.zonneladen","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":1960,"y":560,"wires":[[]]},{"id":"e9e36f7ea984eaa7","type":"switch","z":"eedcfd7df3194436","name":"","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":230,"y":700,"wires":[["dee1ce1f38654cdc","184b796f1240b1f4"],["1264f7c08cb64288"]]},{"id":"d70c1ce270339a4a","type":"api-call-service","z":"eedcfd7df3194436","name":"Set zonneladen +0,2","server":"f52c678d.eab598","version":5,"debugenabled":false,"domain":"input_number","service":"increment","areaId":[],"deviceId":[],"entityId":["input_number.zonneladen"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1340,"y":460,"wires":[["d5929416d2315423"]]},{"id":"c7dd89e910be5f1e","type":"api-call-service","z":"eedcfd7df3194436","name":"Set zonneladen -0,2","server":"f52c678d.eab598","version":5,"debugenabled":false,"domain":"input_number","service":"decrement","areaId":[],"deviceId":[],"entityId":["input_number.zonneladen"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1340,"y":540,"wires":[["8db8862ac129f287"]]},{"id":"1264f7c08cb64288","type":"api-call-service","z":"eedcfd7df3194436","name":"Set zonneladen reset","server":"f52c678d.eab598","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.zonneladen"],"data":"{\"value\":\"0\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1320,"y":700,"wires":[["8db8862ac129f287"]]},{"id":"dee1ce1f38654cdc","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"777449db.c1d348","version":3,"outputs":2,"halt_if":"connected","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.chargepoint_status","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"true","valueType":"bool"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":540,"y":600,"wires":[["9df7ee1516292e5b"],[]]},{"id":"184b796f1240b1f4","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"777449db.c1d348","version":3,"outputs":2,"halt_if":"charging","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.chargepoint_status","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"true","valueType":"bool"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":540,"y":660,"wires":[["9df7ee1516292e5b"],[]]},{"id":"f5cba20a139af5a8","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"777449db.c1d348","version":3,"outputs":2,"halt_if":"available","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.chargepoint_status","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"true","valueType":"bool"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":200,"y":800,"wires":[["1264f7c08cb64288"],[]]},{"id":"7c3391234435d84c","type":"server-state-changed","z":"eedcfd7df3194436","name":"","server":"777449db.c1d348","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.zonneladen","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"num","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload3","propertyType":"msg","value":"","valueType":"entityState"}],"x":840,"y":380,"wires":[["f7d98759fc83af78"]]},{"id":"f7d98759fc83af78","type":"api-current-state","z":"eedcfd7df3194436","name":"","server":"777449db.c1d348","version":3,"outputs":2,"halt_if":"payload3","halt_if_type":"msg","halt_if_compare":"gte","entity_id":"sensor.power_production","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload2","propertyType":"msg","value":"true","valueType":"bool"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1260,"y":380,"wires":[["d5929416d2315423"],[]]},{"id":"d5929416d2315423","type":"emerge","z":"eedcfd7df3194436","name":"zonneladen niet hoger","grpRules":[{"ruleProperty":"payload2","rulePropertyType":"msg","ruleOperation":"==","ruleValue":"true","ruleValueType":"bool"}],"ruleProperty":"payload","rulePropertyType":"msg","ruleOperation":"==","ruleValue":"","ruleValueType":"str","rulesTimeout":"20","timeoutAction":"0","x":1600,"y":460,"wires":[["8db8862ac129f287"]]},{"id":"777449db.c1d348","type":"server","name":"Home Assistant","addon":true},{"id":"f52c678d.eab598","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
[{"id":"81c4f1c116bff3ad","type":"tab","label":"Optelling","disabled":false,"info":"","env":[]},{"id":"966e4ec425053022","type":"api-current-state","z":"81c4f1c116bff3ad","name":"","server":"f52c678d.eab598","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.basisladen","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"a","valueType":"str"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":620,"y":200,"wires":[["35110338987a5270"]]},{"id":"8b92b7d9a6d7a7dc","type":"api-current-state","z":"81c4f1c116bff3ad","name":"","server":"f52c678d.eab598","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.car_charger_watt","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":1480,"y":540,"wires":[[]]},{"id":"83d00bc756981ba6","type":"api-current-state","z":"81c4f1c116bff3ad","name":"","server":"f52c678d.eab598","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"input_number.zonneladen","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"b","valueType":"str"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":360,"y":560,"wires":[["7425204d2413fd31"]]},{"id":"3d9c84c82479675b","type":"api-call-service","z":"81c4f1c116bff3ad","name":"","server":"f52c678d.eab598","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.car_charger_watt"],"data":"{\"value\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1090,"y":540,"wires":[["8b92b7d9a6d7a7dc"]]},{"id":"2b1f7419.779bc4","type":"join","z":"81c4f1c116bff3ad","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":770,"y":380,"wires":[["e07f5ac37ee932ea"]]},{"id":"e07f5ac37ee932ea","type":"calculator","z":"81c4f1c116bff3ad","name":"","inputMsgField":"payload","outputMsgField":"payload","operation":"sum","constant":"","round":true,"decimals":"1","x":810,"y":540,"wires":[["3d9c84c82479675b"]]},{"id":"35110338987a5270","type":"template","z":"81c4f1c116bff3ad","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}}","output":"str","x":1020,"y":200,"wires":[["2b1f7419.779bc4"]]},{"id":"8f5d255fa5d91da3","type":"inject","z":"81c4f1c116bff3ad","name":"Poll every sec","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":80,"y":280,"wires":[["83d00bc756981ba6","fe63d51b8fb84655"]]},{"id":"7425204d2413fd31","type":"template","z":"81c4f1c116bff3ad","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{payload}}","output":"str","x":640,"y":560,"wires":[["2b1f7419.779bc4"]]},{"id":"fe63d51b8fb84655","type":"api-current-state","z":"81c4f1c116bff3ad","name":"","server":"777449db.c1d348","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.percentage_opladen","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload3","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":350,"y":100,"wires":[["ad5c1da55b24fa69"]]},{"id":"ad5c1da55b24fa69","type":"api-current-state","z":"81c4f1c116bff3ad","name":"","server":"777449db.c1d348","version":3,"outputs":2,"halt_if":"payload3","halt_if_type":"msg","halt_if_compare":"gt","entity_id":"sensor.battery_level","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload2","propertyType":"msg","value":"true","valueType":"bool"},{"property":"payload4","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":720,"y":100,"wires":[["99d3762a56ea282d"],["0fa7c39e3f8a6fef"]]},{"id":"0fa7c39e3f8a6fef","type":"emerge","z":"81c4f1c116bff3ad","name":"zonneladen niet hoger","grpRules":[{"ruleProperty":"payload2","rulePropertyType":"msg","ruleOperation":"==","ruleValue":"true","ruleValueType":"bool"}],"ruleProperty":"payload","rulePropertyType":"msg","ruleOperation":"==","ruleValue":"","ruleValueType":"str","rulesTimeout":"20","timeoutAction":"0","x":340,"y":200,"wires":[["966e4ec425053022"]]},{"id":"99d3762a56ea282d","type":"change","z":"81c4f1c116bff3ad","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"0.2","tot":"str"},{"t":"set","p":"topic","pt":"msg","to":"a","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1240,"y":140,"wires":[["35110338987a5270"]]},{"id":"92e85f85adfbc48b","type":"server-state-changed","z":"81c4f1c116bff3ad","name":"","server":"777449db.c1d348","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.battery_level","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":620,"y":40,"wires":[[]]},{"id":"f52c678d.eab598","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"777449db.c1d348","type":"server","name":"Home Assistant","addon":true}]