Hallo Community,
I have a small PV system on my balcony, and I am looking for a smart, automated solution to turn the switch ON when there is excess energy and OFF when the energy level is low for a certain time period. The main idea is to create three power levels for charging, depending on the battery level.
The battery’s first level is called “Fast charging for battery level.” When the battery level is below this threshold, the charging relay should turn ON when the PV energy level is above the set “charge low-level battery threshold power charging start.” Since power levels tend to oscillate, I have planned to use delays.
For example: When the variables are:
- “Fast charging for battery level” = 20%
- “Charge low-level battery threshold power charging start” = 200W
- “Actual battery level” = 0%
Then, the charging should start after a delay of 30 seconds if the power level remains above 200W during this time. Once charging has started, if the excess power drops below 200W, the charging should stop after a delay of 15 minutes.
This behavior should change when the battery level exceeds the “Fast charging for battery level” threshold. When the battery level is above this value, the PV energy required to start charging should be higher. In my example, this threshold is now: “Charge normal-level battery threshold power charging start” = 300W.
After reaching the third level of battery the power level also raises higher.
Here is the Visu page:
I have managed to set up everything and distinguish the different settings. However, I am now facing a problem that I cannot solve. The delay nodes do not behave as I initially expected. When one of these conditions is true, the delay node turns ON and OFF at the same time.
I have read about implementing a reset with the delays, but I do not know how to do it.
Hopefully somene can help me solving my problem. I am pretty new at this stuff, so a a more detailed explanation for beginners would be greate!
Thank in advance!
Here are the nodes which i have planed to use.
[{"id":"c140ee9d9cbde4a4","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"39a28766783f674e","type":"api-current-state","z":"c140ee9d9cbde4a4","name":"Charge Faster level","server":"2744c3c.e3faf3c","version":3,"outputs":2,"halt_if":"$entities('input_number.faster_charging_at_battery_percent').state","halt_if_type":"jsonata","halt_if_compare":"lte","entity_id":"sensor.audi_a3_sportback_tfsi_e_state_of_charge","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":670,"y":380,"wires":[["91202e344b14c5d7"],["8830f424062ff79e"]]},{"id":"aa158d1cb1c86797","type":"api-current-state","z":"c140ee9d9cbde4a4","name":"Stop charging level","server":"2744c3c.e3faf3c","version":3,"outputs":2,"halt_if":"$entities('input_number.stop_charging_at_battery_percent').state","halt_if_type":"jsonata","halt_if_compare":"gt","entity_id":"sensor.audi_a3_sportback_tfsi_e_state_of_charge","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":610,"y":620,"wires":[["59a960987079bed5"],[]]},{"id":"02b8abc08ad6542f","type":"inject","z":"c140ee9d9cbde4a4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":150,"y":480,"wires":[["95250916e2016547"]]},{"id":"8830f424062ff79e","type":"api-current-state","z":"c140ee9d9cbde4a4","name":"Under stop charging level","server":"2744c3c.e3faf3c","version":3,"outputs":2,"halt_if":"$entities('input_number.stop_charging_at_battery_percent').state","halt_if_type":"jsonata","halt_if_compare":"lte","entity_id":"sensor.audi_a3_sportback_tfsi_e_state_of_charge","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":710,"y":520,"wires":[["6f49e7f99927c37d"],[]]},{"id":"a8f2c947871b0910","type":"delay","z":"c140ee9d9cbde4a4","name":"","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1350,"y":360,"wires":[["9903f0ace90191e8"]]},{"id":"569156d3da776fe3","type":"delay","z":"c140ee9d9cbde4a4","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1350,"y":440,"wires":[["850c48a116bb537f"]]},{"id":"5c5b3c9cb54b76ee","type":"delay","z":"c140ee9d9cbde4a4","name":"","pauseType":"delay","timeout":"7","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1340,"y":580,"wires":[["850c48a116bb537f"]]},{"id":"8211c0a0bfe1395e","type":"delay","z":"c140ee9d9cbde4a4","name":"","pauseType":"delay","timeout":"45","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1350,"y":520,"wires":[["9903f0ace90191e8"]]},{"id":"95250916e2016547","type":"api-current-state","z":"c140ee9d9cbde4a4","name":"Select Charging Mode","server":"2744c3c.e3faf3c","version":3,"outputs":2,"halt_if":"Smartes Sonnen laden","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_select.charging_mode","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":400,"y":480,"wires":[["39a28766783f674e","aa158d1cb1c86797"],["2352f2df04899093"]]},{"id":"2352f2df04899093","type":"api-call-service","z":"c140ee9d9cbde4a4","name":"Turn ON charging switch","server":"2744c3c.e3faf3c","version":5,"debugenabled":true,"domain":"input_boolean","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.tst_dev_out"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":590,"y":720,"wires":[[]]},{"id":"91202e344b14c5d7","type":"api-current-state","z":"c140ee9d9cbde4a4","name":"Power solar available for charge low level","server":"2744c3c.e3faf3c","version":3,"outputs":2,"halt_if":"$entities('input_number.fast_charg_min_p_for_start').state\t","halt_if_type":"jsonata","halt_if_compare":"gte","entity_id":"sensor.solarpower_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":980,"y":360,"wires":[["a8f2c947871b0910"],["569156d3da776fe3"]]},{"id":"6f49e7f99927c37d","type":"api-current-state","z":"c140ee9d9cbde4a4","name":"Power solar available for charge mid level","server":"2744c3c.e3faf3c","version":3,"outputs":2,"halt_if":"$entities('input_number.normal_charg_min_p_for_start').state","halt_if_type":"jsonata","halt_if_compare":"gte","entity_id":"sensor.solarpower_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":1020,"y":520,"wires":[["8211c0a0bfe1395e"],["5c5b3c9cb54b76ee"]]},{"id":"59a960987079bed5","type":"api-current-state","z":"c140ee9d9cbde4a4","name":"Power solar available for charge ultra high level","server":"2744c3c.e3faf3c","version":3,"outputs":2,"halt_if":"$entities('input_number.charg_high_min_p_for_start').state","halt_if_type":"jsonata","halt_if_compare":"gte","entity_id":"input_number.dummy_power","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","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":920,"y":700,"wires":[["3c40a0e08f6c6048"],["be10bf4738af3d9e"]]},{"id":"9903f0ace90191e8","type":"api-call-service","z":"c140ee9d9cbde4a4","name":"Turn ON charging devPort","server":"2744c3c.e3faf3c","version":5,"debugenabled":true,"domain":"input_boolean","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.tst_dev_out"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1730,"y":400,"wires":[[]]},{"id":"850c48a116bb537f","type":"api-call-service","z":"c140ee9d9cbde4a4","name":"Turn OFF charging switch devPort","server":"2744c3c.e3faf3c","version":5,"debugenabled":true,"domain":"input_boolean","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.tst_dev_out"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1700,"y":680,"wires":[[]]},{"id":"3c40a0e08f6c6048","type":"delay","z":"c140ee9d9cbde4a4","name":"","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1350,"y":680,"wires":[["9903f0ace90191e8"]]},{"id":"be10bf4738af3d9e","type":"delay","z":"c140ee9d9cbde4a4","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1340,"y":740,"wires":[["850c48a116bb537f"]]},{"id":"2744c3c.e3faf3c","type":"server","name":"Home Assistant","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","statusSeparator":"","enableGlobalContextStore":false}]