April 28, 2015

Tellstick DUO firmware with support for the WPC

Yesterday I sent a pull request to Telldus asking to include my code that adds native support for the Wireless Pulse Counter for the Tellstick DUO.
The update contains two parts, The patched firmware for the Tellstick DUO, and the patched telldus-core that runs on the computer where the Tellstick DUO is connected. The Firmware I provide compiled and it is ready for download, whereas the telldus-core software you need to compile yourself.

Of course, despite this code update, you will still need to do at least some calculations on the receiving side.

Firmware

The firmware adds support for the RFXCOM-protocol that is used by the WPC (Protocol description...kind of).
The effect of using this firmware is that the WPC will no longer show up as a thermometer but instead as a RFXmeter device which is made for presenting number of pulses, and not temperature, humidity, wind speed etc. The earlier calculations below will no longer be needed,

 if ( !signbit(temperature) ) {
  i_counts = humidity*4096 + (int)(10.0*temperature);
 } else {
  i_counts = humidity*4096 - (int)(10.0*temperature) + 2048;
 }

The maximum number of counts is also increased from 413,696 to 2^24 (16,777,216).

NOTE! I have only tested this firmware on my own Tellstick DUO.
The same code have been provided to Telldus so that they can include it in the next release of the firmware.
It is also likely to be released in the Tellstick NET firmware as well since the same code can be used. Link to the Telldus ticket.

The already compiled firmware can be downloaded here,
UPDATED: 2015-04-30: I added another check to make sure it is a RFXCOM package and also fixed so that the checksum is kept through the Tellstick.

Software

The telldus-core software also need to be updated. This is the software that interpret the new raw data that comes from the Tellstick DUO when it receives data from a WPC. The Pull request for this can be downloaded here, telldus-core patch.

Calculations

First get to know your energy meter recalculation factor. Find the [imp/kWh] marking on your energy meter. Then divide 1,000 with the number you find.

  Example 1. If it is marked with 10,000imp/kWh the recalculation factor is 1,000/10,000 = 1/10
  Example 2. If it is marked with 500imp/kWh the recalculation factor is 1,000/500 = 2

Once you have the recalculation factor you can use that to calculate the consumed Energy and present Power usage.

Energy [kWh], multiply your received number with the recalculation factor for your energy meter. You will likely want it in [kWh], thus the dividend 1,000.

          Energy = count • (recalculation factor) / 1,000

Power usage [kW] you need to divide the difference in detected pulses with the elapsed time [s].

          Power = ∆ count • (recalculation factor) • 60 • 60 / ∆ t / 1,000

∆ t is given in seconds [s]. Usually the WPC transmit approximately every 60 second, but if one transmission is lost, the ∆ t will be around 120 seconds etc.
The dividend 1,000 is there to get the result in [kW]



No comments:

Post a Comment