scruss / Powermon433

ATmega (Arduino) decoding of EM100B and PowerCost Monitor
MIT License
6 stars 6 forks source link

Uninitialized values output 0 rather than “NaN” or something more appropriate #4

Open scruss opened 10 years ago

scruss commented 10 years ago

On startup, energy and temperature fields are not initialized, as the packets are sent asynchronously. For example, three initial records might look like:

[ 87369] Energy:     0 Wh, Power: 576 W, Temp:  0 F
[119189] Energy:     0 Wh, Power: 604 W, Temp: 47 F
[151017] Energy: 17792 Wh, Power: 607 W, Temp: 47 F

In the first line, neither temperature nor energy is initialized. In the second, energy alone isn't.

These should really be something non-numeric, but easy to parse. NaN may not be ideal.