>D egyIn=0 egyOut=0 ;Var for Daily egyInDay=0 egyOutDay=0 tiHr=0 ;permanent midnight values p:egyInMidNight=0 p:egyOutMidNight=0 ;permanent Var for month begin p:egyInMonthStrt=0 p:egyOutMonthStrt=0 ;Var for monthly=0 tiMonthDay=0 egyInSumMonth=0 egyOutSumMonth=0 ;permanent Var for year begin p:egyInYearStrt=0 p:egyOutYearStrt=0 p:egyInLastYear=0 p:egyOutLastYear=0 ;Var for year=0 tiYear=0 egyInSumYear=0 egyOutSumYear=0 >B ;restart driver =>sensor53 r ;Set teleperiod to 60sec tper=60 ;meter definition (ISKRA MT681) >M 1 +1,3,s,0,9600,SML_EVU 1,77070100010800ff@1000,Zählerstand_Verbr.,KWh,Total_in,4 1,77070100020800ff@1000,Zählerstand_Einsp.,KWh,Total_out,4 1,=h================== 1,77070100100700ff@1,Aktuelle Leistung,W,Power_curr,0 1,=h ------------------------------- 1,77070100240700ff@1,Leistung P1,W,Power_p1[W],0 1,77070100380700ff@1,Leistung P2,W,Power_p2[W],0 1,770701004c0700ff@1,Leistung P3,W,Power_p3[W],0 1,=h================== 1,77070100000009ff@#,Service ID,,Meter_id,0 1,=h################### # >T ; get total consumption and total feed egyIn=SML_EVU#Total_in egyOut=SML_EVU#Total_out >S ;egyInMonthStrt=4895 ;egyOutMonthStrt=28854.25 ;egyInYearStrt=3820 ;egyOutYearStrt=21321 ;egyInLastYear=0 ;egyOutLastYear=0 ;svars ; at midnight, save meter total values for daily usage tiHr=hours if chg[tiHr]>0 and tiHr==0 then egyInMidNight=egyIn egyOutMidNight=egyOut svars endif ; on teleperiod calculate current daily values from midnight if upsecs%tper==0 then egyInDay=egyIn-egyInMidNight egyOutDay=egyOut-egyOutMidNight endif ;Monthly usage tiMonthDay=day if chg[tiMonthDay]>0 and tiMonthDay==1 then egyInMonthStrt=egyIn egyOutMonthStrt=egyOut svars endif ; on teleperiod calculate current monthly values from midnight if upsecs%tper==0{ egyInSumMonth=egyIn-egyInMonthStrt egyOutSumMonth=egyOut-egyOutMonthStrt } ;Yearly usage tiYear=year if chg[tiYear]>0 and egyIn>0 then egyInLastYear=egyInSumYear egyOutLastYear=egyOutSumYear egyInYearStrt=egyIn egyOutYearStrt=egyOut svars endif ; on teleperiod calculate current yearly values from midnight if upsecs%tper==0{ egyInSumYear=egyIn-egyInYearStrt egyOutSumYear=egyOut-egyOutYearStrt ; show these values on WEB UI >W

=====Info's=============== Tagesverbrauch: {m} %egyInDay% kWh Tageseinspeisung: {m} %egyOutDay% kWh

Monatsverbrauch: {m} %egyInSumMonth% kWh Monatseinspeisung: {m} %egyOutSumMonth% kWh

Jahresverbrauch: {m} %egyInSumYear% kWh Jahreseinspeisung: {m} %egyOutSumYear% kWh

=====Historische Info's======= Vorjahresverbrauch: {m} %egyInLastYear% kWh Vorjahreseinspeisung: {m} %egyOutLastYear% kWh

; transmit these values with MQTT >J ,"daily_consumption[kWh]":%egyInDay%,"daily_production[kWh]":%egyOutDay%,"monthly_consumption[kWh]":%egyInSumMonth%,"monthly_production[kWh]":%egyOutSumMonth%,"yearly_consumption[kWh]":%egyInSumYear%,"yearly_production[kWh]":%egyOutSumYear%