mam dokładnie taką logikę do grzałki do bojlera,
włacza się i jak jeszcze jest zapas to podnosi napięcie, jak jestesmy za blisko zera to obniża itd…
Wyciąłem istotny fragment… przeanalizuj sobie i cos sklecisz na swoje potrzeby,
Tam jest też nod “smooth” czyli patrzy na najwyższą wartość z ostatnich kilku odczytów, żeby nie wrzucać za dużego poboru jak co chwila chmury nachodzą.
[{"id":"875af5e8ae433a9a","type":"delay","z":"25c072f65d3b9f4b","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"15","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"x":440,"y":380,"wires":[["d9a331f9796e3fa1"]]},{"id":"003fd5df63a89ba3","type":"smooth","z":"25c072f65d3b9f4b","name":"","property":"payload","action":"max","count":"6","round":"0","mult":"single","reduce":false,"x":260,"y":380,"wires":[["875af5e8ae433a9a"]]},{"id":"74f76ea5c9a5a76a","type":"switch","z":"25c072f65d3b9f4b","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"-300","vt":"num"},{"t":"lt","v":"-200","vt":"num"},{"t":"lt","v":"-100","vt":"num"},{"t":"gte","v":"-100","vt":"num"}],"checkall":"false","repair":false,"outputs":4,"x":850,"y":380,"wires":[["5d5a7c4cc3dd931e"],[],["09e92d41d5c090d6"],["9684349782865b18"]]},{"id":"5d5a7c4cc3dd931e","type":"function","z":"25c072f65d3b9f4b","name":"","func":"msg.payload = msg.poziom_grzalki + 1;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1020,"y":340,"wires":[["803fe870b4d19226"]]},{"id":"09e92d41d5c090d6","type":"function","z":"25c072f65d3b9f4b","name":"","func":"msg.payload = msg.poziom_grzalki - 2;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1020,"y":380,"wires":[["803fe870b4d19226"]]},{"id":"9684349782865b18","type":"change","z":"25c072f65d3b9f4b","name":"340","rules":[{"t":"set","p":"payload","pt":"msg","to":"20","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":420,"wires":[["43576be8aecd33ce"]]},{"id":"43576be8aecd33ce","type":"mqtt out","z":"25c072f65d3b9f4b","name":"Ustaw dimmer","topic":"regulator/dimmer","qos":"1","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"2871dfb9.e5e5d","x":1340,"y":440,"wires":[]},{"id":"803fe870b4d19226","type":"switch","z":"25c072f65d3b9f4b","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"34","vt":"num"},{"t":"lt","v":"19","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":3,"x":1230,"y":380,"wires":[[],[],["43576be8aecd33ce"]]},{"id":"d9a331f9796e3fa1","type":"change","z":"25c072f65d3b9f4b","name":"","rules":[{"t":"set","p":"poziom_grzalki","pt":"msg","to":"poziom_grzalki","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":380,"wires":[["74f76ea5c9a5a76a"]]},{"id":"2b1a5bb0c1473a99","type":"mqtt in","z":"25c072f65d3b9f4b","name":"","topic":"regulator","qos":"2","datatype":"json","broker":"2871dfb9.e5e5d","nl":false,"rap":true,"rh":0,"x":320,"y":200,"wires":[["5cfc614c8bb8119f"]]},{"id":"5cfc614c8bb8119f","type":"switch","z":"25c072f65d3b9f4b","name":"","property":"payload.POWER","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":690,"y":200,"wires":[["27881a43a47193f4","970aa68c6b3fd5cb"],["9826db80e647b7c7","970aa68c6b3fd5cb"],["970aa68c6b3fd5cb"]]},{"id":"27881a43a47193f4","type":"change","z":"25c072f65d3b9f4b","name":"","rules":[{"t":"set","p":"regulator_grzalki_power","pt":"global","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":180,"wires":[[]]},{"id":"9826db80e647b7c7","type":"change","z":"25c072f65d3b9f4b","name":"","rules":[{"t":"set","p":"regulator_grzalki_power","pt":"global","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":220,"wires":[[]]},{"id":"970aa68c6b3fd5cb","type":"change","z":"25c072f65d3b9f4b","name":"","rules":[{"t":"set","p":"poziom_grzalki","pt":"global","to":"payload.Dimmer","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":120,"wires":[[]]},{"id":"80bae52173c3eb3d","type":"mqtt in","z":"25c072f65d3b9f4b","name":"faza 2","topic":"channels/0/state/phases/2/power_active","qos":"2","datatype":"json","broker":"2871dfb9.e5e5d","nl":false,"rap":true,"rh":0,"x":110,"y":380,"wires":[["003fd5df63a89ba3"]]},{"id":"2871dfb9.e5e5d","type":"mqtt-broker","name":"MQTT xpenology","broker":"192.168.5.102","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]