Fotowoltaika i sterowanie oświetleniem w akwarium

Witajcie, kombinuję już na kilka sposobów ale ze względu na jeszcze małą wiedzę odnośnie NR, napisze w czym problem. Mam panele fotowoltaiczne które produkują energię. Chce zrobić FLOW które na fazie L2 jeśli mam energię ujemną (czyli oddaję energię do sieci Tauron) to aby włączał oświetlenie LED w akwarium. w Akwarium są 4 listwy LED regulowane jasnością w zakresie 0-255 czyli chce zrobić tak że jeśli produkcja energii jest np. -100W to włącza oświetlenie LED (mogą się włączać wszystkie 4 ledy na brightness=10) jesli po zwiekszeniu wartość na L2 bedzie nadal ujemna to niech podniesie znów o 10 itd.
Zamysł jest taki aby nie oddawać energii tylko wykorzystać obecną produkcję z paneli, a jeśli słóńce zajdzie za chmurę i L2 bedzie dodatnie to odniża jasność aby dążyć do wartości -10W, nie daję do 0W (taka histereza) Pod to oczywiście można potem podłączyć grzałkę w akwarium 300W, zawór reduktora Co2 które także pobierają energię.

urządzenia:

  • licznik energii który mierzy energię pobieraną i oddawaną (zrobiłem to na MEW-01 przez MQTT)
  • 4 listwy LED sterowane przez PWM w zakresie 1-255, 0-wyłaczony LED
  • grzałka
  • zawory
  • sensory mierzące PH itd, ale głównie na początek sterowanie oświetleniem.

Musisz reagować na każdą zmianę wartości czyli triger procesu powinien być powiązany z mew-01 (pewnie event state). no i dajesz odpowiednie warunki i tyle :slight_smile:

Jako sugestię mogę Ci podać mój nieco podobny projekt, który w zależności od poboru prądu w gniazdku “zgaduje” czy jest używany telewizor i włącza jego podświetlenie, jeżeli jest już po zachodzie słońca:

Kluczowe nody:

obraz

obraz

Ty musiałbyś w nodzie switch ustawić pewnie więcej warunków.

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":""}]

bartik22 - możesz podać nazwę/symbol urządzenia/regulatora którym sterujesz grzałką?

znalazłem taki na allegro: https://allegro.pl/oferta/przelacznik-sciemniacza-wifi-foxnsk-10655938071

Tutaj masz cala historie: