<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>RaspiWatt: discover power consumption using a Kill-A-Watt &amp;amp; Pi</title><link>/products/raspberry-pi/b/blog/posts/raspiwatt-discover-power-consumption-using-a-kill-a-watt-pi</link><description>Want to build this project? View Parts Say you want to know how much electricity an appliance like an air purifier is consuming? You can hook it up to the nifty Kill-A-Watt power meter (aka KaW). The KaW will keep track of and display the k...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: RaspiWatt: discover power consumption using a Kill-A-Watt &amp;amp; Pi</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspiwatt-discover-power-consumption-using-a-kill-a-watt-pi</link><pubDate>Tue, 20 Jun 2017 17:33:39 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:30914613-99aa-4955-984a-25a5153a49de</guid><dc:creator>ejsbrown</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Drew -&lt;br /&gt;I know this post is a few years old but I am just getting into power sensing as a hobby. You mention future posts - did those ever happen or are these comments the rest of the detail I need? Thanks!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=15256&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: RaspiWatt: discover power consumption using a Kill-A-Watt &amp;amp; Pi</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspiwatt-discover-power-consumption-using-a-kill-a-watt-pi</link><pubDate>Sun, 30 Jun 2013 01:55:17 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:30914613-99aa-4955-984a-25a5153a49de</guid><dc:creator>chrisjx</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Just wanted to add some of my notes and code to this subject.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I started using wifi routers flashed with OpenWRT, hacked with an XBee radio, and running python scripts.&amp;nbsp; That was the upgrade from using a full PC with Adafruit&amp;#39;s Tweet-a-watt approach.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;What I have running now is a raspberry pi with an xbee mounted on a GPIO card.&amp;nbsp; The code started with wattcher.py but has been extended to allow you to track any kind of data from an xbee radio.&amp;nbsp; I&amp;#39;ve got temp, light, gas, power sensors attached to xbees around my house; sending the data to xively/cosm, thingspaek, open.se, etc.&amp;nbsp; There are methods for sending the data to different data logger APIs.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="https://github.com/TinajaLabs/gateway_raspi/blob/master/allsensors.py" rel="nofollow ugc noopener" target="_blank"&gt;https://github.com/TinajaLabs/gateway_raspi/blob/master/allsensors.py&lt;/a&gt; &lt;/p&gt;&lt;p&gt;(also see supporting files etc)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here are my rough notes on setting up the Raspi, the CISECO GPIO board, python libraries, starting the python script automatically, etc.&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://tinajalabs.wordpress.com/2012/09/02/raspberry-pi-as-an-xbee-wireless-sensor-network-gateway/" rel="nofollow ugc noopener" target="_blank"&gt;http://tinajalabs.wordpress.com/2012/09/02/raspberry-pi-as-an-xbee-wireless-sensor-network-gateway/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I plan to extend the code further so I can setup all the sensor definitions into an xml or json file (as opposed to the hard coded variables).&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Hope it helps or adds to our collective knowledge.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=15256&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: RaspiWatt: discover power consumption using a Kill-A-Watt &amp;amp; Pi</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspiwatt-discover-power-consumption-using-a-kill-a-watt-pi</link><pubDate>Sat, 11 May 2013 19:04:05 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:30914613-99aa-4955-984a-25a5153a49de</guid><dc:creator>Former Member</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;You shouldn&amp;#39;t need three different files.&amp;nbsp; The sensorhistories object stores the sensoryhistory objects for each sensor.&amp;nbsp; In this loop we iterate through them and add up wattsused and whused for each sensor that happens to be present.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="https://gist.github.com/misterbonnie/5560939" rel="nofollow ugc noopener" target="_blank"&gt;https://gist.github.com/misterbonnie/5560939&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre&gt;&lt;p class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wattsused = 0&lt;/p&gt;&lt;p class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; whused = 0&lt;/p&gt;&lt;p class="line"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for history in sensorhistories.sensorhistories:&lt;/p&gt;&lt;p class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wattsused += history.avgwattover5min()&lt;/p&gt;&lt;p class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; whused += history.dayswatthr&lt;/p&gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Instead of adding up values to get totals for all sensors, we can store the whused and wattused for each individual sensor in a dictionary, or collection of key/value pairs.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Each SensorHistory object has a &amp;quot;sensornum&amp;quot; value, so we can use this number as the &amp;quot;key&amp;quot;.&amp;nbsp; The code would look something like this:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="https://gist.github.com/misterbonnie/5560947" rel="nofollow ugc noopener" target="_blank"&gt;https://gist.github.com/misterbonnie/5560947&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre&gt;&lt;p class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wattsused = {}&lt;/p&gt;&lt;p class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; whused = {}&lt;/p&gt;&lt;p class="line"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for history in sensorhistories.sensorhistories:&lt;/p&gt;&lt;p class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wattsused[history.sensornum] = history.avgwattover5min()&lt;/p&gt;&lt;p class="line"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; whused[history.sensornum] = history.dayswatthr&lt;/p&gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;For each history, get avgwattover5min() and dayswatthr and store each in a key/value pair where the key is the sensornum.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;After this loop is complete, we have a dictionary that looks something like this (let&amp;#39;s say this one is &amp;#39;wattsused&amp;#39;):&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;{1: 108.71603821046972, 2: 20.233332145332, ... }&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;To access the wattsused for sensor 1, for example:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre&gt;&lt;p&gt;&amp;gt;&amp;gt;&amp;gt; print wattsused[1]&lt;/p&gt;&lt;p&gt;108.71603821046972&lt;/p&gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you want to store the cost for each individual sensor, you would need to store it in a similar dictionary.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Good luck!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=15256&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: RaspiWatt: discover power consumption using a Kill-A-Watt &amp;amp; Pi</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspiwatt-discover-power-consumption-using-a-kill-a-watt-pi</link><pubDate>Fri, 10 May 2013 14:25:16 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:30914613-99aa-4955-984a-25a5153a49de</guid><dc:creator>felixemman</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hye guys in my case the XBEE didn&amp;#39;t work because it was drawing too much power from the KillAWatt and causing the screen to flicker and turn off. I created my own version of the Tweet A Watt using a Moteino that talks to my RaspberryPi and posts the data to EmonCMS - you could alternatively post to Cosm or Twitter etc, tutorial and schematics here: &lt;a class="jive-link-external-small" href="http://lowpowerlab.com/blog/2012/12/28/wattmote-moteino-based-wireless-killawatt/" rel="nofollow ugc noopener" target="_blank"&gt;http://lowpowerlab.com/blog/2012/12/28/wattmote-moteino-based-wireless-killawatt/&lt;/a&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=15256&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: RaspiWatt: discover power consumption using a Kill-A-Watt &amp;amp; Pi</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspiwatt-discover-power-consumption-using-a-kill-a-watt-pi</link><pubDate>Wed, 24 Apr 2013 17:05:13 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:30914613-99aa-4955-984a-25a5153a49de</guid><dc:creator>Former Member</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I&amp;#39;ve been trying to configure the transmitter radios with a sparkfun USB Xbee shield, but they never seem to come out of sleep mode and have to be reset. Can configuration only be done with the Adafruit shields?&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=15256&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: RaspiWatt: discover power consumption using a Kill-A-Watt &amp;amp; Pi</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspiwatt-discover-power-consumption-using-a-kill-a-watt-pi</link><pubDate>Tue, 16 Apr 2013 17:21:24 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:30914613-99aa-4955-984a-25a5153a49de</guid><dc:creator>Former Member</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Excellent info Drew. Thank you again. One more request/suggestion: it would be great to a have link that showed the parts needed to add additional monitors. Is it just the Xbee and Kill-a-watt devices, or is that tweet-a-watt starter pack required for each additional monitor or set of monitors? If the latter, could 1 starter pack plus two kill-a-watts be used for adding two more transmitting monitors? I&amp;#39;ve been wanting to build something like this for my house for a while. I&amp;#39;m looking forward to getting a better idea of where all my energy usage is going.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=15256&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: RaspiWatt: discover power consumption using a Kill-A-Watt &amp;amp; Pi</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspiwatt-discover-power-consumption-using-a-kill-a-watt-pi</link><pubDate>Tue, 16 Apr 2013 00:33:26 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:30914613-99aa-4955-984a-25a5153a49de</guid><dc:creator>fustini</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;The following instructions to install the RaspiWatt software on the Raspberry Pi are based on these references:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align:-webkit-auto;"&gt;&lt;strong&gt;Send Raspberry Pi Data to COSM: Necessary Packages&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align:-webkit-auto;"&gt;&lt;a class="jive-link-external-small" href="http://learn.adafruit.com/send-raspberry-pi-data-to-cosm/necessary-packages" rel="nofollow ugc noopener" target="_blank"&gt;http://learn.adafruit.com/send-raspberry-pi-data-to-cosm/necessary-packages&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align:-webkit-auto;"&gt;&lt;strong&gt;Adafruit 16x2 Character LCD + Keypad for Raspberry Pi: Usage&lt;/strong&gt;&lt;/p&gt;&lt;div&gt;&lt;a class="jive-link-external-small" href="http://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-raspberry-pi/usage" rel="nofollow ugc noopener" target="_blank"&gt;http://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-raspberry-pi/usage&lt;/a&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;p style="text-align:-webkit-auto;"&gt;&lt;strong&gt;Tweet-a-Watt software:&lt;/strong&gt;&lt;/p&gt;&lt;p style="text-align:-webkit-auto;"&gt;&lt;a class="jive-link-external-small" href="http://www.ladyada.net/make/tweetawatt/software.html" rel="nofollow ugc noopener" target="_blank"&gt;http://www.ladyada.net/make/tweetawatt/software.html&lt;/a&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=15256&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: RaspiWatt: discover power consumption using a Kill-A-Watt &amp;amp; Pi</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspiwatt-discover-power-consumption-using-a-kill-a-watt-pi</link><pubDate>Mon, 15 Apr 2013 23:11:30 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:30914613-99aa-4955-984a-25a5153a49de</guid><dc:creator>Former Member</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Awesome project. I&amp;#39;m interested in building this one. I already have a Pi and a Kill-a-Watt meter so I partway there. One question: is the Pi taking the place of the computer in Ladyada&amp;#39;s schematic and able to receive info from multiple meters?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks for posting this. I&amp;#39;m looking forward to the more detailed how-to posts.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=15256&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: RaspiWatt: discover power consumption using a Kill-A-Watt &amp;amp; Pi</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/raspiwatt-discover-power-consumption-using-a-kill-a-watt-pi</link><pubDate>Fri, 05 Apr 2013 19:12:16 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:30914613-99aa-4955-984a-25a5153a49de</guid><dc:creator>Former Member</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Drew,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks for posting this. Is it possible to connect the KaW directly to the RPi, bypassing the XBee&amp;#39;s? Would it put the RPi in harms way by hardwiring them?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Kai&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=15256&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>