Edit: Updated to version 0.9 Beta (Version 0.5 is in Automagicallys latest update)
This is the first BETA release of the Wireless Energy Meter Plugin for Automagically.
Copy the file (wem.py) to your plugin directory and turn on your Wireless Energy Meter from http://foogadgets.tictail.com.
When you have turned on your Wireless Energy Meter, you need to look into the signal trace to find the ID of the Primary and Secondary channel.
It will look something like this:
Code: Select all
tellstick,raw:class:sensor;protocol:fineoffset;id:69;model:temperaturehumidity;humidity:6;temp:0.1;
tellstick,sensor,protocol:fineoffset,id:69,Temperature,value:0.1
tellstick,sensor,protocol:fineoffset,id:69,Humidity,value:6
tellstick,raw:class:sensor;protocol:fineoffset;id:68;model:temperaturehumidity;humidity:7;temp:0.1;
tellstick,sensor,protocol:fineoffset,id:68,Temperature,value:0.1
tellstick,sensor,protocol:fineoffset,id:68,Humidity,value:7
The temperaturehumidity 'sensor' with the lowest number of humidity will be your secondary device, in the above trace id:69.
The Wireless Energy Meter Plugin must then be configured (/admin/settings/settingsvalue/) with the above identified primary and secondary device.
The Wireless Energy Meter Plugin takes the following configurations:
- Enabled - Set to True to enable the plugin
- ManualMode - Do not touch, for debugging only. Disables the timeout functionality for packet loss detection. To perform a 'manual' timeout, send: wem,action:timeout
- primaryId - The ID of the primary channel
- secondaryId - The ID of the secondary channel
- blinksPerWatt - Number of blinks per kW, typically 1000 or 10000 blinks per kW in major brands.
The plugin will recover from lost packages by having implemented (a sort of) interleaving function provided by the Wireless Energy Meter's protocol.
Code: Select all
wem,data;status:NN;datetime:NN;seq:NN;energy:NN;packetloss:NN;
- status = OK or TO_MANY_LOST_PACKAGES
- datetime = Time the signal was received in Automagically
- seq = The received sequence number
- energy = The energy measured since last report
- packetloss = Indication if there was packet-loss
Code: Select all
wem,data;status:OK;datetime:2014-02-26T21:33:52.274328;seq:18;energy:319;packetloss:0;
wem,data;status:TO_MANY_LOST_PACKAGES
Code: Select all
wem,data;status:%s;datetime:%s;seq:%d;energy:%d;packetloss:%d;
- $1 - status
- $2 - datetime
- $3 - seq
- $4 - energy
- $5 - packetloss
Pattern to match: wem,data;status:%s;datetime:%s;seq:%d;energy:%d;packetloss:%d;
Send the following signal(s) on match: xively,report:Energi:$4:W;
For info in Xively plugin, see http://automagically.wikia.com/wiki/Usi ... ely_plugin
The plugin has been tested in live and simulated environment.
In simulated environment, the following tests has been successfully performed:
- Dropping a package on primary channel
- Dropping a package on secondary channel
- Dropping a package on both primary and secondary at the same time
- Dropping two primary packages and one secondary package
- Dropping one primary packages and two secondary package
- Dropping two primary packages and two secondary package
- Wrapping of sequence numbers (99->0)
- The total Energy consumption can be calculated by summing up the incoming data (Etotal = Etotal + temp*10/1000)
- The Power usage can also be calculated (Pmom = temp*10/1000*60*60/(Time_now - Time_previous))
Please suggest...
Simulator
Attached is also as simulator that behaves as a Wireless Energy Meter, if you want to test things without actually having one.
It has been described in this post earlier: http://www.telldus.com/forum/viewtopic. ... 002#p24995
To make it easier to work with the build a remote that uses a few different Send signal devicees.
It can look something like this:
/Marcus