In the Plugwise protocol unleashed series, I will describe the plugwise protocol. As far as I have been able to re-engineer it. I did this re-engineering work because there is no Linux/OSX software available to control your plugwise devices. All information in these series are based on the 2.0 firmware version!
DISCLAIMER: use of the information in these articles is at your own risk.
This information is not supported by Plugwise B.V. in any way.
So what is plugwise anyway?
Plugwise is a smart way of measuring power usage using a device called the Circle.
It’s basically a plug between your device and the power socket.
The device can be used to keep track of the following:
– Current power usage;
– historic power usage, using buffers in the device itself;
– you can also use it to power on/power off a device;
– you can also use it as standby killer (using a schema).
For more information visit: http://www.plugwise.com
Before we can dive deep into the plugwise protocol, we are first going through some basics of the protocol in part one of this series.
Plugwise uses the zigbee protocol to communicatie over the air.
Once all of your devices have been setup using Plugwise source (the default Plugwise software) you can control your devices using the plugwise stick (this is a little USB stick)
Image 1: the plugwise stick
To send commands to the Plugwise stick, plugwise uses a serial communication protocol.
Actually the Plugwise stick has a FTDI FT232 UART aboard. The following information shows up when plugged into a Linux machine:
Bus 006 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
The serial communication takes place with the following settings:
- Baud rate: 115200
- Data bits: 8
- Stop bits: 1
- Parity: none
Plugwise data packet
The Plugwise data packet looks like this:
Image 2: the Plugwise protocol frame.
The start frame must be sent before sending any other data, the hexadecimal presentation of the start frame looks like this:
The data formats varies, an example might look like this:
This actually is an example of the power change command (switch a device on or off, in this case a device on command)
0017 is the command,
00D6F0000236XXX the mac address and 01 the power code (power on)
Followed by the data, is the CRC checksum.
The used CRC checksum by Plugwise is a CRC16 checksum (often reffered to as ymodem or zmodem), it has the following properties:
- Polynomial: 0x11021
- Seed value: 0x00000
- Xor mask: 0x00000
- Width: 16
The checksum is generated over the data piece of the packet.
Last part of the packet is the end frame, this is basically a control feed followed by a linefeed. Which looks the following way, in hexadecimal:
This concludes the first part of the Plugwise protocol unleashed series. If you have any specific protocol questions, please leave them in the comments so I can talk about it in the next part of this serie.