MQTT-Wasserzähler

>D
p:m1=0
p:g1=0
p:g2=0
p:month1=0
p:month2=0
p:month3=0
p:gesamt=0
c1=0
s1=0
h1=0
hgp=0
g1gp=0
g2gp=0
m1gp=0
m2gp=0
m3gp=0
gsgp=0
hr=0
dy=0
wp=1.81
wtotal=0

>B
=>sensor53 l255


>S
h1=s1-m1
hgp=(h1*wp)
g1gp=(g1*wp)
g2gp=(g2*wp)
m1gp=(month1*wp)
m2gp=(month2*wp)
m3gp=(month3*wp)
gsgp=(gesamt*wp)

hr=hours
dy=day
if chg[hr]>0
 and hr==0
  then
   m1=s1
   g2=g1
   g1=h1
   month1=month1+h1
   gesamt=gesamt+h1
   if chg[dy]<2
    and dy==1
     then
      month3=month2
      month2=month1
      month1=0
   endif
   svars
endif



if upsecs%tper==0{
=>Publish tasmota/%topic%/main/td_m3 %2h1%
=>Publish tele/%topic%/main/yd_m3 %2g1%
=>Publish tele/%topic%/main/dbyd_m3 %2g2%
=>Publish tele/%topic%/main/value %2s1%
=>Publish tele/%topic%/main/wtotal %2wtotal%
=>Publish tele/%topic%/json {"wtotal": "%2wtotal%", "value": "%2s1%", "today_m3": "%2h1%", "yesterday_m3": "%2g1%", "db_yesterday_m3": "%2g2%"}
}

>T
s1=Counter#C1/100
c1=Counter#C1
wtotal=(c1/100)

>W
Zählerstand: {m} %wtotal% m³
============
Wasserpreis: {m} %wp% €/m³
============
Verbrauch:
---------------------
Heute: {m} %2h1% m³
Kosten: {m} %2hgp% €
---------------------
Gestern: {m} %2g1% m³
Kosten: {m} %2g1gp% €
---------------------
Vorgestern: {m} %2g2% m³
Kosten: {m} %2g2gp% €
---------------------
Aktueller Monat: {m} %2month1% m³ | %2m1gp% €
Letzter Monat: {m} %2month2% m³ | %2m2gp% €
Vorletzter Monat: {m} %2month3% m³ | %2m3gp% €
Gesamt: {m} %2gesamt% m³ | %2gsgp% €

#

Navigation
Eigene Werkzeuge