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:10] – wikimaster | wiki:projekte:shellypro3em:uebersicht [2025/11/08 16:28] (aktuell) – wikimaster | ||
|---|---|---|---|
| Zeile 630: | Zeile 630: | ||
| 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< | ||
| + | break | ||
| + | } | ||
| + | |||
| + | ; 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 | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ;1,1-0 | ||
| + | ;1 | ||
| + | ; | ||
| + | ;# | ||
| + | |||
| + | >M 1 | ||
| + | +1, | ||
| + | ; | ||
| + | 1, | ||
| + | ; | ||
| + | 1, | ||
| + | ; | ||
| + | 1, | ||
| + | 1, | ||
| + | 1, | ||
| + | 1, | ||
| + | 1, | ||
| + | 1, | ||
| + | 1, | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| # | # | ||
| </ | </ | ||
wiki/projekte/shellypro3em/uebersicht.txt · Zuletzt geändert: von wikimaster
