Ich bin dann jetzt im Praxistest
Habe jetzt einen 600W Heizstab im Warmwasserspeicher den ich mit meiner D1 mini Regelung (siehe oben) ansteuere.
Ansteuerung mit berechneten %Werten habe ich aufgegeben, da der Heizstab, je nach Wärme des Wassers unterschiedlich reagiert. Daher steuere ich jetzt rein nach Überschuss ja/nein.
Als erstes wird bei Überschuss der Strom für den Stab eingeschaltet, sonst ausgeschaltet.
Dann bei Überschuss starte ich mit 68%, das sind ca. 10W am Heizstab.
Bei weiterem Überschuss gehts in 1% Schritten hoch. Wenn der Überschuss unter 10W geht, gehts wieder in 1% Schritten runter. Dann gibts noch eine Rückstellung mit Timer.
Hier mal meinen momentanen Node-Red Flow:
[{"id":"042c687b1ea6f620","type":"tab","label":"PWM-Regelung","disabled":false,"info":"","env":[]},{"id":"5499612ba2554971","type":"switch","z":"042c687b1ea6f620","name":"Über/Unter -10W","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"-10","vt":"num"},{"t":"lt","v":"-11","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":440,"wires":[["05fccfcc4a0aed1d"],["d0f2b30e96a3e5e0"]]},{"id":"6e353bfef4b0a236","type":"server-state-changed","z":"042c687b1ea6f620","name":"Aktueller Stromverbrauch","server":"631d6d7c.35ae94","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.power_total","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"","halt_if_type":"str","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":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":110,"y":440,"wires":[["b5cac9600266de39"]]},{"id":"272944538ff35453","type":"api-call-service","z":"042c687b1ea6f620","name":"Sollwert in %","server":"631d6d7c.35ae94","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.sollwert"],"data":"{ \"value\":payload}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":150,"y":180,"wires":[["fbfbb4f6ab9d13ff"]]},{"id":"fbfbb4f6ab9d13ff","type":"api-call-service","z":"042c687b1ea6f620","name":"Steuert PWM mit Sollwert","server":"631d6d7c.35ae94","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":["aa283c52700db0287e7537a24a7f22ec"],"entityId":[],"data":"{\"brightness_pct\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":370,"y":140,"wires":[[]]},{"id":"a7a0fc0bdba18abb","type":"server-state-changed","z":"042c687b1ea6f620","name":"Sollwert von Direkteingabe","server":"631d6d7c.35ae94","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.sollwert","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"","halt_if_type":"str","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":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":110,"y":100,"wires":[["fbfbb4f6ab9d13ff"]]},{"id":"f7e65b3b705d2a71","type":"api-call-service","z":"042c687b1ea6f620","name":"Sollwert von Steuerung","server":"631d6d7c.35ae94","version":5,"debugenabled":false,"domain":"input_number","service":"set_value","areaId":[],"deviceId":[],"entityId":["input_number.sollwert"],"data":"{ \"value\":payload}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1030,"y":440,"wires":[[]]},{"id":"41d1bf43f90cdc3e","type":"api-call-service","z":"042c687b1ea6f620","name":"Ausschalten","server":"631d6d7c.35ae94","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.stecker157"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":550,"y":300,"wires":[["ca7e904181e0915d"]]},{"id":"f9c5ce94fc8471f7","type":"api-call-service","z":"042c687b1ea6f620","name":"Einschalten","server":"631d6d7c.35ae94","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.stecker157"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":540,"wires":[[]]},{"id":"b11f2796861e861c","type":"inject","z":"042c687b1ea6f620","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"23","payloadType":"num","x":70,"y":560,"wires":[["b5cac9600266de39"]]},{"id":"695951fbad191dfc","type":"inject","z":"042c687b1ea6f620","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-25","payloadType":"num","x":70,"y":600,"wires":[["b5cac9600266de39"]]},{"id":"ca7e904181e0915d","type":"stoptimer","z":"042c687b1ea6f620","duration":"5","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":780,"y":280,"wires":[[],["f7e65b3b705d2a71","0812b46064414d7b"]]},{"id":"b5cac9600266de39","type":"switch","z":"042c687b1ea6f620","name":"Über/Unter 0W","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"0","vt":"str"},{"t":"gt","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":340,"y":440,"wires":[["5499612ba2554971","cfd5053548cfc83e"],["fd3ff764a8d2214e"]]},{"id":"fd3ff764a8d2214e","type":"api-current-state","z":"042c687b1ea6f620","name":"Ist Schalter aus?","server":"631d6d7c.35ae94","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.stecker157","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":330,"y":360,"wires":[["41d1bf43f90cdc3e"],[]]},{"id":"4331245f329fa1bd","type":"inject","z":"042c687b1ea6f620","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-9","payloadType":"num","x":70,"y":640,"wires":[["b5cac9600266de39"]]},{"id":"f85742a468644602","type":"inject","z":"042c687b1ea6f620","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":70,"y":520,"wires":[["b5cac9600266de39"]]},{"id":"cfd5053548cfc83e","type":"api-current-state","z":"042c687b1ea6f620","name":"Ist Schalter ein?","server":"631d6d7c.35ae94","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.stecker157","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":560,"y":540,"wires":[["f9c5ce94fc8471f7"],[]]},{"id":"d0f2b30e96a3e5e0","type":"function","z":"042c687b1ea6f620","name":"Var Sollwert +1","func":"var sollwert = flow.get('sollwert') || 68;\nsollwert = sollwert +1;\nflow.set('sollwert', sollwert);\nmsg.payload = sollwert;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":480,"wires":[["f7e65b3b705d2a71"]]},{"id":"05fccfcc4a0aed1d","type":"function","z":"042c687b1ea6f620","name":"Var Sollwert -1","func":"var sollwert = flow.get('sollwert') || 68;\nsollwert = sollwert -1;\nflow.set('sollwert', sollwert);\nmsg.payload = sollwert;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":780,"y":420,"wires":[["f7e65b3b705d2a71"]]},{"id":"0812b46064414d7b","type":"function","z":"042c687b1ea6f620","name":"Var Sollwert zurückstellen","func":"var sollwert = flow.get('sollwert') || 68;\nsollwert = 68;\nflow.set('sollwert', sollwert);\nmsg.payload = sollwert;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":360,"wires":[[]]},{"id":"631d6d7c.35ae94","type":"server","name":"Home Assistant","addon":true}]
Ich hoffe das heute mal ein bisschen Sonne raus kommt, zum testen. Bisher konnte ich das nur über die Injekt-Nodes probieren.
Für Verbesserungsvorschläge bin ich immer offen