wiki:projekte:shellypro3em:uebersicht
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | |||
| wiki:projekte:shellypro3em:uebersicht [2025/11/08 16:28] – wikimaster | wiki:projekte:shellypro3em:uebersicht [2026/01/14 20:02] (aktuell) – wikimaster | ||
|---|---|---|---|
| Zeile 91: | Zeile 91: | ||
| >B | >B | ||
| - | => | ||
| ; if you modify this section you must restart tasmota | ; if you modify this section you must restart tasmota | ||
| + | => | ||
| + | ; set tele period to 1 second | ||
| + | tper=1 | ||
| + | PowerDelta 110 | ||
| >ah | >ah | ||
| Zeile 204: | Zeile 207: | ||
| >S | >S | ||
| - | if year< | + | if upsecs> |
| - | break | + | then |
| - | } | + | smlj|=1 |
| - | ; adapt this to your meter | ||
| - | ; update every 3 seconds | ||
| - | if upsecs%3==0 { | ||
| - | cpwr=sml[3] | ||
| - | c1p=sml[4] | ||
| - | c2p=sml[5] | ||
| - | c3p=sml[6] | ||
| - | } | ||
| - | |||
| - | ; use this if you only have only one phase meter values | ||
| - | ;c1p=cpwr/3 | ||
| - | ;c2p=cpwr/3 | ||
| - | ;c3p=cpwr/3 | ||
| - | |||
| - | ; calculate phase currents | ||
| - | c1c=c1p/230 | ||
| - | c2c=c2p/230 | ||
| - | c3c=c3p/230 | ||
| - | |||
| - | if once==0 { | ||
| - | ; start mdns for Shelly second parameter " | ||
| - | res=mdns(" | ||
| - | ; start udp rpc handler on port 1010 or on port 2220 (for b2500) | ||
| - | res=udp(0 1010) | ||
| - | ;res=udp(0 2220) | ||
| - | once=1 | ||
| - | } | ||
| - | |||
| - | ; evaluate udp input | ||
| - | str=udp(1) | ||
| - | if str!="" | ||
| - | ;print udp rpc payload=%str% | ||
| - | res=ins(str " | ||
| - | if res>=0 { | ||
| - | =#getsrc | ||
| - | =#getstat | ||
| - | udp(2 header mstr1 mstr2) | ||
| - | ;print >> %header% | ||
| - | ;print >> %mstr1% | ||
| - | ;print >> %mstr2% | ||
| - | break | ||
| - | } | ||
| - | |||
| - | res=ins(str " | ||
| - | if res>=0 { | ||
| - | =#getsrc | ||
| - | =#getdefi | ||
| - | udp(2 header mstr1 mstr2) | ||
| - | ;print >> 1 %mstr1% | ||
| - | ;print >> 2 %mstr2% | ||
| - | break | ||
| - | } | ||
| - | |||
| - | res=ins(str " | ||
| - | if res>=0 { | ||
| - | =#getsrc | ||
| - | =#getcfg | ||
| - | udp(2 header mstr1) | ||
| - | ;print >> 1 %mstr1% | ||
| - | break | ||
| - | } | ||
| - | |||
| - | res=ins(str " | ||
| - | if res>=0 { | ||
| - | =#getsrc | ||
| - | =#egetstat | ||
| - | udp(2 header mstr1) | ||
| - | ;print >> 1 %mstr1% | ||
| - | break | ||
| - | } | ||
| - | } | ||
| - | |||
| - | ; adapt your own meter descriptor here | ||
| - | ;>M 1 | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | |||
| - | ;>M 1 | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ;1,=h---- | ||
| - | ; | ||
| - | |||
| - | >M 1 | ||
| - | +1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | # | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | >D 250 | ||
| - | M:p:sday=0 288 | ||
| - | M:p:dcon=0 31 | ||
| - | M:p:dprod=0 31 | ||
| - | M:p:mcon=0 24 | ||
| - | M:s4h=0 481 | ||
| - | p:mval=0 | ||
| - | p:dval=0 | ||
| - | p:mval2=0 | ||
| - | p:dval2=0 | ||
| - | p:yval=0 | ||
| - | p:yval2=0 | ||
| - | p:da=1 | ||
| - | t:t1=3 | ||
| - | t:t2=30 | ||
| - | t:t3=60 | ||
| - | tmp=0 | ||
| - | m5=0 | ||
| - | cstr=" | ||
| - | cstr2=" | ||
| - | utm=" | ||
| - | avgv=0 | ||
| - | avgv2=0 | ||
| - | avgvc=0 | ||
| - | avgvc2=0 | ||
| - | hr=0 | ||
| - | swesp=0 | ||
| - | swespflg=0 | ||
| - | power2=0 | ||
| - | save=0 | ||
| - | res=0 | ||
| - | c1p=0 | ||
| - | c2p=0 | ||
| - | c3p=0 | ||
| - | c1c=0 | ||
| - | c2c=0 | ||
| - | c3c=0 | ||
| - | cpwr=0 | ||
| - | str="" | ||
| - | tstr="" | ||
| - | mstr1="" | ||
| - | mstr2="" | ||
| - | header="" | ||
| - | once=0 | ||
| - | throttle=1 | ||
| - | >B | ||
| - | => | ||
| - | tmp=is(0 " | ||
| - | smlj=0 | ||
| - | header=" | ||
| - | #init | ||
| - | dval=sml[2] | ||
| - | dval2=sml[3] | ||
| - | for tmp 1 dcon[-1] 1 | ||
| - | dcon[tmp]=0 | ||
| - | dprod[tmp]=0 | ||
| - | next | ||
| - | mval=sml[2] | ||
| - | mval2=sml[3] | ||
| - | for tmp 1 mcon[-1] 1 | ||
| - | mcon[tmp]=0 | ||
| - | next | ||
| - | yval=sml[2] | ||
| - | yval2=sml[3] | ||
| - | for tmp 1 sday[-1] 1 | ||
| - | sday[tmp]=0 | ||
| - | next | ||
| - | -> | ||
| - | -> | ||
| - | svars | ||
| - | #daysub | ||
| - | if wm>0 { | ||
| - | wcs <div id=" | ||
| - | wcs <script language=" | ||
| - | wcs var cssc={' | ||
| - | wcs var data=google.visualization.arrayToDataTable([[' | ||
| - | for tmp 1 dcon[-1] 1 | ||
| - | if (tmp==day) { | ||
| - | wcs [%tmp%, | ||
| - | } | ||
| - | if (tmp< | ||
| - | wcs [%tmp%, | ||
| - | } | ||
| - | if (tmp> | ||
| - | wcs [%tmp%, | ||
| - | } | ||
| - | next | ||
| - | wcs ]); | ||
| - | wcs var options={chartArea: | ||
| - | wcs var chart=new google.visualization.ColumnChart(document.getElementById(' | ||
| - | wcs chart.draw(data, | ||
| - | } | ||
| - | #dayprod | ||
| - | if wm>0 { | ||
| - | wcs <div id=" | ||
| - | wcs <script language=" | ||
| - | wcs var cssc={' | ||
| - | wcs var data=google.visualization.arrayToDataTable([[' | ||
| - | for tmp 1 dprod[-1] 1 | ||
| - | if (tmp==day) { | ||
| - | wcs [%tmp%, | ||
| - | } | ||
| - | if (tmp< | ||
| - | wcs [%tmp%, | ||
| - | } | ||
| - | if (tmp> | ||
| - | wcs [%tmp%, | ||
| - | } | ||
| - | next | ||
| - | wcs ]); | ||
| - | wcs var options={chartArea: | ||
| - | wcs var chart=new google.visualization.ColumnChart(document.getElementById(' | ||
| - | wcs chart.draw(data, | ||
| - | } | ||
| - | #monthsub | ||
| - | if wm>0 { | ||
| - | wcs <div id=" | ||
| - | wcs <script language=" | ||
| - | wcs var cssc={' | ||
| - | wcs var data=google.visualization.arrayToDataTable([[' | ||
| - | for tmp 1 12 1 | ||
| - | if (tmp< | ||
| - | wcs [' | ||
| - | } | ||
| - | if (tmp==month) { | ||
| - | wcs [' | ||
| - | } | ||
| - | if (tmp> | ||
| - | wcs [' | ||
| - | } | ||
| - | next | ||
| - | wcs ]); | ||
| - | wcs var options={series: | ||
| - | wcs var chart=new google.visualization.ColumnChart(document.getElementById(' | ||
| - | wcs chart.draw(data, | ||
| - | } | ||
| - | #getstat | ||
| - | mstr1=" | ||
| - | mstr1+=" | ||
| - | mstr2=" | ||
| - | mstr2+=" | ||
| - | >S | ||
| - | if (save==1) { | ||
| - | save=0 | ||
| - | svars | ||
| - | } | ||
| - | if ((year< | ||
| - | print auf NTP/Zähler warten | ||
| - | break | ||
| - | } | ||
| - | smlj=1 | ||
| - | if (t1==0) { | ||
| - | t1=3 | ||
| - | avgv+=sml[1] | ||
| - | avgv2+=sml[1] | ||
| - | avgvc+=1 | ||
| - | avgvc2+=1 | ||
| - | power2=(0.9*power2)+((1-0.9)*sml[1]) | ||
| - | if (swesp==1) { | ||
| - | if ((power2< | ||
| - | swespflg=1 | ||
| - | } | ||
| - | if ((power2> | ||
| - | swespflg=0 | ||
| - | } | ||
| - | } | ||
| - | } | ||
| - | if (t2==0) { | ||
| - | t2=30 | ||
| - | s4h=avgv/ | ||
| - | avgv=0 | ||
| - | avgvc=0 | ||
| - | cstr2=" | ||
| - | } | ||
| - | if (t3==0) { | ||
| - | t3=60 | ||
| - | hr=hours | ||
| - | utm=s(2.0(int(uptime/ | ||
| - | dcon[day]=sml[2]-dval | ||
| - | mcon[month]=sml[2]-mval | ||
| - | dprod[day]=sml[3]-dval2 | ||
| - | mcon[month+12]=sml[3]-mval2 | ||
| - | m5=int((((hours*60)+mins)/ | ||
| - | sday[0]=m5 | ||
| - | if (chg[m5]> | ||
| - | sday[m5]=int(avgv2/ | ||
| - | avgv2=0 | ||
| - | avgvc2=0 | ||
| - | } | ||
| - | cstr=" | ||
| - | if ((chg[hr]> | ||
| - | if (day>1) { | ||
| - | da=day | ||
| - | } else { | ||
| - | for tmp (da+1) 31 1 | ||
| - | dprod[tmp]=0 | ||
| - | dcon[tmp]=0 | ||
| - | next | ||
| - | mval=sml[2] | ||
| - | mval2=sml[3] | ||
| - | } | ||
| - | if (day*month==1) { | ||
| - | yval=sml[2] | ||
| - | yval2=sml[3] | ||
| - | } | ||
| - | dval=sml[2] | ||
| - | dval2=sml[3] | ||
| - | svars | ||
| - | } | ||
| - | } | ||
| - | if (once==0) { | ||
| - | res=mdns(" | ||
| - | res=udp(0 2220) | ||
| - | once=1 | ||
| - | } | ||
| - | if (upsecs%throttle!=0) { | ||
| - | break; | ||
| - | } | ||
| - | tmp=sml[1]-cpwr | ||
| - | if (tmp> | ||
| - | cpwr=sml[1]-(tmp/ | ||
| - | } else { | ||
| - | cpwr=sml[1] | ||
| - | } | ||
| - | c1p=cpwr | ||
| - | c1c=c1p/230 | ||
| - | str=udp(1) | ||
| - | if (str!="" | ||
| - | res=ins(str " | ||
| - | if (res>=0) { | ||
| - | =#getstat | ||
| - | udp(2 header mstr1 mstr2) | ||
| - | break | ||
| - | } | ||
| - | } else { | ||
| - | ;=#getstat | ||
| - | ;udp(2 header mstr1 mstr2) | ||
| - | } | ||
| - | >W | ||
| - | bu(save " | ||
| - | Leistung (gefiltert){m}%0power2% W | ||
| - | Leistung (an Marstek Akku){m}%0cpwr% W | ||
| - | Tagesverbrauch{m}%2(sml[2]-dval)% kWh | ||
| - | Monatsverbrauch{m}%2(sml[2]-mval)% kWh | ||
| - | Jahresverbrauch{m}%2(sml[2]-yval)% kWh | ||
| - | Tageseinspeisung{m}%2(sml[3]-dval2)% kWh | ||
| - | Monatseinspeisung{m}%2(sml[3]-mval2)% kWh | ||
| - | Jahreseinspeisung{m}%2(sml[3]-yval2)% kWh | ||
| - | Datum{m}%s(2.0day)%.%s(2.0month)%.%s(2.0year)% - %s(2.0hours)%: | ||
| - | Uptime{m}%utm% | ||
| - | $<div style=" | ||
| - | $<div id=" | ||
| - | $gc(lt s4h " | ||
| - | $var options = { | ||
| - | $chartArea: | ||
| - | $legend:' | ||
| - | $vAxis: | ||
| - | $hAxis: | ||
| - | $explorer: | ||
| - | $series: {0: {type: ' | ||
| - | $title:' | ||
| - | $}; | ||
| - | $gc(e) | ||
| - | $<div id=" | ||
| - | $gc(lt sday " | ||
| - | $var options = { | ||
| - | $chartArea: | ||
| - | $legend:' | ||
| - | $vAxis: | ||
| - | $hAxis: | ||
| - | $explorer: | ||
| - | $series: {0: {type: ' | ||
| - | $title:' | ||
| - | $}; | ||
| - | $gc(e) | ||
| - | %=#daysub | ||
| - | %=#dayprod | ||
| - | %=#monthsub | ||
| - | $< | ||
| - | $Version 02.10.2025 (PV+ShellyEmu) by ottelo.jimdo.de< | ||
| - | $Credits to gemu2015 (Tasmota Script Dev)< | ||
| - | $Hinweis: Die Daten (ohne 4h Chart) werden um Mitternacht gespeichert!< | ||
| - | $Der Restart Button speichert ebenfalls die Daten.< | ||
| - | $</ | ||
| - | ;>M 1 | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ; | ||
| - | ;# | ||
| - | |||
| - | >M 1 | ||
| - | +1, | ||
| - | 1, | ||
| - | ;; | ||
| - | 1, | ||
| - | ; | ||
| - | 1, | ||
| - | ;; | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | 1, | ||
| - | # | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | >D 250 | ||
| - | ; this script emulates a shelly pro, with small modifications may also emulate an ecotracker | ||
| - | ; proven to work an marstek Venus, Jupiter and B2500 | ||
| - | res=0 | ||
| - | c1p=0 | ||
| - | c2p=0 | ||
| - | c3p=0 | ||
| - | c1c=0 | ||
| - | c2c=0 | ||
| - | c3c=0 | ||
| - | cpwr=0 | ||
| - | str="" | ||
| - | tstr="" | ||
| - | cstr="" | ||
| - | mstr1="" | ||
| - | mstr2="" | ||
| - | mstr3="" | ||
| - | header="" | ||
| - | once=0 | ||
| - | |||
| - | >B | ||
| - | => | ||
| - | ; if you modify this section you must restart tasmota | ||
| - | |||
| - | >ah | ||
| - | ; http rpc handler | ||
| - | res=won(1 "/ | ||
| - | ; http status | ||
| - | res=won(2 "/ | ||
| - | ; http ecotacker status | ||
| - | res=won(3 "/ | ||
| - | |||
| - | >on1 | ||
| - | ;print here comes http rpc request | ||
| - | str=warg | ||
| - | res=ins(str " | ||
| - | if res>=0 { | ||
| - | wcs so(4) | ||
| - | =#htph | ||
| - | wcs %mstr1% | ||
| - | =#getsrc | ||
| - | wcs %header% | ||
| - | =#getstat | ||
| - | wcs %mstr1% | ||
| - | wcs %mstr2% | ||
| - | wcf | ||
| - | break | ||
| - | } | ||
| - | res=ins(str " | ||
| - | if res>=0 { | ||
| - | wcs so(4) | ||
| - | =#htph | ||
| - | wcs %mstr1% | ||
| - | =#getsrc | ||
| - | =#getdefi | ||
| - | wcs %header% | ||
| - | wcs %mstr1% | ||
| - | wcs %mstr2% | ||
| - | wcf | ||
| - | break | ||
| - | } | ||
| - | res=ins(str " | ||
| - | if res>=0 { | ||
| - | wcs so(4) | ||
| - | =#htph | ||
| - | wcs %mstr1% | ||
| - | =#getsrc | ||
| - | =#getcfg | ||
| - | wcs %header% | ||
| - | wcs %mstr1% | ||
| - | wcf | ||
| - | break | ||
| - | } | ||
| - | res=ins(str " | ||
| - | if res>=0 { | ||
| - | wcs so(4) | ||
| - | =#htph | ||
| - | wcs %mstr1% | ||
| - | =#getsrc | ||
| - | =#egetstat | ||
| - | wcs %header% | ||
| - | wcs %mstr1% | ||
| - | wcf | ||
| - | break | ||
| - | } | ||
| - | |||
| - | print unknown http equest: %str% | ||
| - | |||
| - | >on2 | ||
| - | ;print here comes the status request | ||
| - | wcs so(4) | ||
| - | =#htph | ||
| - | wcs %mstr1% | ||
| - | dp(0 2) | ||
| - | wcs {" | ||
| - | wcf | ||
| - | |||
| - | >on3 | ||
| - | ;print here comes the v1/json for ecotracker | ||
| - | wcs so(4) | ||
| - | =#htph | ||
| - | wcs %mstr1% | ||
| - | dp(0 2) | ||
| - | wcs {" | ||
| - | wcs " | ||
| - | wcf | ||
| - | |||
| - | #htph | ||
| - | mstr1=" | ||
| - | |||
| - | #getcfg | ||
| - | mstr1=" | ||
| - | |||
| - | #getdefi | ||
| - | mstr1=" | ||
| - | mstr2=" | ||
| - | mstr2+=" | ||
| - | |||
| - | #getstat | ||
| - | dp(0 2) | ||
| - | mstr1=" | ||
| - | mstr1+=" | ||
| - | mstr2=" | ||
| - | mstr2+=" | ||
| - | |||
| - | #egetstat | ||
| - | dp(0 2) | ||
| - | mstr1=" | ||
| - | |||
| - | #getsrc | ||
| - | tstr=" | ||
| - | header=" | ||
| - | |||
| - | >S | ||
| if year< | if year< | ||
| break | break | ||
| Zeile 861: | Zeile 304: | ||
| >M 1 | >M 1 | ||
| +1, | +1, | ||
| + | ;< | ||
| + | ; < | ||
| + | ; Otherwise it is transmitted on TelePeriod only. | ||
| ; | ; | ||
| 1, | 1, | ||
wiki/projekte/shellypro3em/uebersicht.txt · Zuletzt geändert: von wikimaster
