datenschuft / SMA-EM

SMA Energymeter measurement
GNU General Public License v2.0
92 stars 38 forks source link

Decimals ? #3

Closed jhagberg closed 8 years ago

jhagberg commented 8 years ago

Hej In the emview app there is watt with decimals and counters with decimals. for example 3700,1 W

But in this app there is only integers with no decimals. Is this by design or can we improve this?

I am working on an daemon that can push data to a Emoncms installation. Got sort of a working one that push imported power as a feed called house_power.

Then I notice that it is only integers.

jhagberg commented 8 years ago

Aha easy fix Just ad decimals to the division pregard=hex2dec(smainfoasci[64:72])/10.0 pregardcounter=hex2dec(smainfoasci[80:96])/3600000.0

I can fix a pull req later

datenschuft commented 8 years ago

there are decimals ----sum---- P: regard:565.3W 5427.3048kWh surplus:0.0W 2389.1479kWh S: regard:627.6VA 6218.2883kVAh surplus:0.0VA 2548.6371VAh Q: cap 0.0var 239.0873kvarh ind 272.5var 2449.6721kvarh cos phi:0.901°

there is also a daemon (now in the master branch) writing 2 values (examples) to /run/shm. a php script puts the values on a webpage.. powermeter