What's New with TrendWeight?

It's been a while since I posted any update on TrendWeight and so I want to take a moment at the start of a new year to share the latest...

New Features?

So what new stuff is coming for TrendWeight? The short answer is: not much. More or less, TrendWeight has all of the features that I want it to have (i.e. it's pretty close to "done".) I know many of you have made some great suggestions for ways that it could be enhanced in new directions by collecting new types of information (e.g. calories consumed each day, etc) and correlating that new information with the observed changes in weight, but after some consideration, I have decided to keep TrendWeight simple and focused on just what it does today.

There are still a small handful of minor improvements that I really want to make, but I don't plan to take TrendWeight in any significant new direction. For example, some people are using TrendWeight to track weight gain (they are building muscle, intentionally), but the arrow showing their weight change is red instead of green. Also, right now, TrendWeight has effectively a hard limit on the amount of historical data that it can store due to limitations on the amount of data that the FitBit API allows me to grab at one time. I'd like to address both of those issues sooner than later.

Technical Infrastructure

On the technical side of things, for a long time, I've been sharing with people that I was working on a significant rewrite of TrendWeight. That work has been stalled for a long time and I don't know when, if ever, that it will get moving again. Frankly, there was really no particular reason for the rewrite other than the fact that I thought it would have been fun to use rewriting TrendWeight as an excuse to play with some new technologies. There's nothing really wrong with the current TrendWeight codebase, and as my hobbies have evolved over time, I find myself spending less free time wanting to write code, so I may never get around to a general rewrite.

Never fear...

This post may come off a little bit negative, but I do not want people to get the impression that TrendWeight is going away. I have no intention to stop supporting TrendWeight, to stop fixing any bugs that crop up, or to take the servers down, so you can rest assured that the functionality you are using today isn't going anywhere.

As always, if you have questions or concerns, feel free to email me at

Dealing with Heartbleed

If you have been on the internet for the last couple weeks, you have likely heard of the Heartbleed bug. If not, read about it here. Here's what you need to know about TrendWeight.

FitBit and Withings Connections

FitBit has announced that they were affected (like many other sites) by this bug and they are recommending that FitBit users reauthorize third party applications like TrendWeight. I have not heard anything from Withings, but it doesn't hurt to reauthorize your Withings account just in case as well. Doing this is easy regardless of if you use FitBit or Withings.

  1. Go to your Settings page and scroll to the bottom.
  2. Click the Disconnect Scale button. This will deauthorize TrendWeight from getting at your FitBit or Withings data.
  3. You'll be taken back to a page where you can reconnect to FitBit or Withings. Once you do this, new authentication keys will be generated for you, and your data will be completely redownloaded (you won't lose anything).
  4. You're done. There is no step 4.

TrendWeight Itself

Our SSL provider, CloudFlare, has already fixed their servers, and in fact fixed them before the bug was made public. I have no reason to believe that anyone exploited the bug to attack TrendWeight prior to CloudFlare fixing the bug. That said, better safe than sorry, as they say. If you want to be extra cautious, you may want to consider changing your TrendWeight password here.

Isn't the Internet fun? If you have any questions, feel free to email me at

Fat Mass is Missing for Withings Users [Resolved]

Multiple Withings users have let me know that their Fat Mass data has disappeared from TrendWeight. Apparently something is going on with the Withings API. I don't know what the problem is yet, but I am investigating. Please stay tuned.

3/27 Update: I have confirmed with multiple users that the body fat data is simply missing from the data that the Withings API is giving TrendWeight. At this point, I don't know of anything I can do to change that. I still don't know why it is only happening to some people and not others. I have sent an email to Withings support asking if they know of anything that might have changed, and someone from Withings has already responded and is actively investigating the problem.

3/28 Updated: A developer at Withings emailed me to let me know that they found and fixed the problem. I confirmed that body mass data is once again appearing for several of the people who I know were affected and everything looks good. I automatically did a full resync for all Withings users who updated in the last week (which should catch anyone who might have been affected), so your missing data should now be back. If you notice anything wrong, though, don't hesitate to contact me.

And thanks to the folks at Withings for finding and fixing the problem so quickly.

Bitcoin Mining with 240V

I have two CoinTerra TerraMiner IVs on order, one in the December batch and one in the March batch. As the December batch orders are now shipping, I spent the past week planning for the device's arrival and wanted to share the details for others in the U.S. that may also need to make similar preparation.

Why are preparations necessary? First, let me say that I am in the U.S. and all of the following is specific to U.S. electrical standards. Anyway, it turns out that CoinTerra missed their power utilization goals and these devices use between 1900 and 2100 watts each. That is far too much for a single 110V 15A circuit which is what is typically found in U.S. homes. In theory, you can connect each of these devices to two separate 110V circuits (they presumably have two 1200 watt power supplies that each will be plugged in), but that is a major hassle if you don't have multiple unused circuits in close proximity.

The solution is to use 240V circuits. Electrical devices use less current (amps) when run at higher voltage and so a single 240V circuit can power a CoinTerra miner (instead of multiple 110V circuits). Adding a 240V circuit sounds hard if you don't have any experience with electrical work and I had no idea how to even begin to getting that done. After a little research and a couple conversations with some local electricians, it turned out to not be too bad, after all.

You essentially need two things to make this work:

  1. A 240V circuit with an appropriate receptacle.
  2. Some way to connect a standard computer power supply to that circuit.

Getting Power

Getting a 240V circuit should hopefully be straightforward. In the U.S., home circuits are typically either 110V or 240V, and most home probably already have at least one 240V circuit for things like an air conditioner or an electric range. Adding another one should be straightforward as long as your breaker box has capacity. Just call an electrician and ask them to install an additional 240V circuit. You'll have to let them know what kind of receptacle you want, and how many Amps you want the circuit to be (more on that later).

The only challenge might be finding a location for the receptacle. If you don't want to keep your Bitcoin miners near your breaker box, you might be looking at a larger project as the electrician may need to run wires through walls (i.e. a much larger project). In my case, my Bitcoin miners are all in the unfinished portion of my basement right next to the electrical panel, so getting the additional circuits was painless.

Distributing the Power

Choosing the type of receptacle and the number of amps will depend on your specific power needs and what kind of cable you plan to plug into it.

You probably aren't going to want to plug your miners directly into your 240V receptacle. First you'd need an outlet for each item you wanted to plug in and that is not particularly cost effective for the electrician to install. Second, and more importantly, you aren't going to easily find a cable that can connect a typical computer power supply to typical high amperage 240V receptacles. The answer is to get a Power Distribution Unit (or PDU). These are essentially specialized power strips for computer hardware. They are typically used in data centers, but can also be used in your home without any significant problems.

After some tips from some folks on, I settled on these two PDUs as good choices:

The first one is a horizontal PDU that uses a NEMA L6-20P plug and needs a 20 amp circuit with an L6-20P receptacle. The second one is a vertical PDU that uses a NEMA L6-30P plug (similar but not identical) and needs a 30 amp circuit with a L6-30P receptacle.

For my own project, I decided to get one of each and to have the electrician install two circuits: a 20A L6-20P receptacle and a 30A L6-30P receptacle. I decided to get both because I wanted to convert all my existing mining hardware over to 240V as part of this project because it is slightly more efficient. I will use the 30A circuit for my CoinTerra miners (at 240V, 2200 watts = 9.2 amps), and I am using the 20A circuit for all the rest of my hardware.

The 20A version can just sit on a shelf easily enough. I mounted the 30A version to the wall next to my shelves, but had to get creative with the mounting hardware since this is designed to be mounted to a rack in a data center and not to a basement wall :)

To calculate what kind of capacity you'll need, remember that Amps = Watts / Volts.


Ok, so now you have a PDU, but you'll also need cables to connect the mining power supplies to the PDU. I bought several of these cables. They have a C13/C14 connectors that will plug into your PDU on one end and directly into your computer power supply on the other.


Both PDUs are up and running, and I switched all my existing miners over to 240V. Now I just need to wait for the first TerraMiner to arrive. Here are a couple photos (click to view larger)...

Mystery Solved: FitBit Rounding Error

A long-standing mystery has finally been solved...

Short Version:

If your TrendWeight account is connected to Fitbit, and you don't use the metric system (kilograms), you may have noticed that the actual weights shown on TrendWeight were often different from the weights show on by 0.1 - 0.2 pounds. This doesn't happen anymore.

Long Version:

Sometimes Trendweight shows my actual scale weight as 0.1 lb higher or lower than what I remember the scale actually showing. I've noticed it on and off for a while, and I have gotten quite a few emails about it. I had looked into it in the past several times and confirmed that I am displaying exactly what Fitbit tells me in their API. So, I chalked it up to an idiosyncrasy on the Fitbit side. Who cares about 0.1 lb anyway?

Well, after yet another email today, I started looking into it again. After some research (aka Google searches), I found a couple other cases where people were having similar problems and in those reports was the nudge I needed to finally understand the problem. The problem is a rounding error when converting between Metric and English weight units. Here's what happens:

  1. You step on the scale and it displays your weight in pounds and sends it to the database.
  2. TrendWeight makes an API request and returns your recent weight readings in kilograms and rounded to 1 decimal place.
  3. TrendWeight converts your recent weight readings back into pounds.

The problem is the highlighted part of step #2. When your weight gets converted to kilograms and rounded to 1 decimal place and then converted back into pounds, the 0.1 - 0.2 lbs error gets introduced.

If only there was a way to tell the Fitbit API that I want the results in pounds (for users who are using pounds) so that I don't have to convert them myself, then this problem would go away... Oh wait. There is. Doh!

By asking Fitbit for weights directly in pounds, TrendWeight now gets actual scale weights that exactly match what was displayed on your scale and what you see on I should have realized this a long time ago, and so I feel a little foolish. Sorry.

TrendWeight's logic has been updated, and the next time you visit your dashboard, your weight readings for the past 21 days will automatically be re-downloaded and "fixed". That will result in an accurate current 'trend weight' (because that trend weight is based, essentially, on the past 20 days of weight readings).

If you really want to retroactively fix all your historical scale readings, you can do so by going into your settings and clicking the 'Resync All Data' button at the bottom of the page. However, do not click this if you have more than 3or 4 years of historical data in TrendWeight or you will risk running into the other Fitbit limitation that prevents TrendWeight from loading lots of historical data. If you have that much old data, you'll want to wait until that other limitation has been addressed.

Side Note

I also want to mention that I am actively working on a new version of the TrendWeight backend that addresses that Fitbit API limitation and also opens up the doors for addressing some of the long requested enhancements you all have made. I still have a bunch of work left to finish before it is ready, but at least the work is in progress...

As always, email me at if you have any questions or concerns.

Erv Walter I'm Erv Walter, a software developer, a computer geek, and a board game addict living in Sun Prairie, Wisconsin. My interests include Azure, ASP.NET, Node.js, ReactJS, AngularJS, and web development in general. And I'm a sucker for any kind of gadget.

@ErvWalterGitHubEmail Me