Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Who left the lights on?

Who left the lights on?

Slides from a workshop presented by Peter Rukavina on February 27, 2015 at the University of Prince Edward Island, Robertson Library and sponsored by ARMA Prince Edward Island Chapter.

Peter Rukavina

February 27, 2015
Tweet

More Decks by Peter Rukavina

Other Decks in Education

Transcript

  1. “Who left the lights on?”
    Slides from a workshop presented by Peter Rukavina
    on February 27, 2015 at
    the University of Prince Edward Island, Robertson Library and
    sponsored by ARMA Prince Edward Island Chapter
    These slides are released under a Creative Commons license.
    You are encouraged to distribute them as far and as 

    wide as possible under the terms of the license.

    View Slide

  2. View Slide

  3. Thank You
    • Simon Lloyd for the invitation.
    • Mark Demone for the coordination.
    • Melissa Belvadi, Don Moses, Alkarim Bhalesha and
    Jerrad Gilbert at Robertson Library for digital
    logistics here in the lab.

    View Slide

  4. “Who left the lights on?”
    How a government-industry open data partnership
    is driving innovation in the delivery of electricity 

    load and generation data to Islanders
    The Apocalyptic Lightbulb Conspiracy by Daniel Hoherd is licensed under CC BY-NC 2.0

    View Slide

  5. “Is there a situation in
    which it is beneficial to
    Maritime Electric to have
    consumption drop?”
    Jim Lea, Maritime Electric CEO, replies…
    March 27, 2003, Delta Prince Edward
    Clip from audio recording Maritime Electric Public Information Session by Peter Rukavina, March 27, 2003.

    View Slide

  6. Ton Zijlstra from Cognitive Cities Conference is licensed by CC BY-NC-ND 3.0

    View Slide

  7. “Who left the lights on?”
    I want to know 

    how much electricity PEI is using,
    where it comes from,
    and how much of it is renewable
    The Apocalyptic Lightbulb Conspiracy by Daniel Hoherd is licensed under CC BY-NC 2.0

    View Slide

  8. “Who left the lights on?”
    I want to know 

    the load,
    the generation,
    and the generation mix
    The Apocalyptic Lightbulb Conspiracy by Daniel Hoherd is licensed under CC BY-NC 2.0

    View Slide

  9. “Who left the lights on?”
    I want to have a gut feeling for 

    the load,
    the generation,
    and the generation mix
    The Apocalyptic Lightbulb Conspiracy by Daniel Hoherd is licensed under CC BY-NC 2.0

    View Slide

  10. “Who left the lights on?”
    I want everyone to have a gut feeling for 

    the load,
    the generation,
    and the generation mix
    The Apocalyptic Lightbulb Conspiracy by Daniel Hoherd is licensed under CC BY-NC 2.0

    View Slide

  11. Windmill by Stephen Downes is licensed under CC BY-NC 2.0

    View Slide

  12. Tools of an Artist by John is licensed under CC BY-NC-SA 2.0

    View Slide

  13. Bulb by Andrew Enright is licensed under CC BY-NC-SA 2.0

    View Slide

  14. 100 watts
    Bulb by Andrew Enright is licensed under CC BY-NC-SA 2.0

    View Slide

  15. 1000 watts
    Bulb by Andrew Enright is licensed under CC BY-NC-SA 2.0

    View Slide

  16. 1 kilowatt
    Bulb by Andrew Enright is licensed under CC BY-NC-SA 2.0

    View Slide

  17. 1 kilowatt for one hour =
    1 kilowatt hour
    Bulb by Andrew Enright is licensed under CC BY-NC-SA 2.0

    View Slide

  18. 1 kilowatt for one hour =
    1 kWh
    Bulb by Andrew Enright is licensed under CC BY-NC-SA 2.0

    View Slide

  19. Photo by Peter Rukavina.

    View Slide

  20. 1 million watts
    x 10,000
    Bulb by Andrew Enright is licensed under CC BY-NC-SA 2.0

    View Slide

  21. 1 megawatt
    x 10,000
    Bulb by Andrew Enright is licensed under CC BY-NC-SA 2.0

    View Slide

  22. 1 MW
    Bulb by Andrew Enright is licensed under CC BY-NC-SA 2.0
    x 10,000

    View Slide

  23. 50 MW Diesel
    60 MW Oil
    Screen shot from Google Maps “Earth” view taken February 26, 2015. Map data © 2015 Google.

    View Slide

  24. Tools of an Artist by John is licensed under CC BY-NC-SA 2.0

    View Slide

  25. HTML
    • HyperText Markup Language
    • Describes the “contents” of the web
    • The “markup” adds meaning to text, like “make this
    a big title”:


    Who left the lights on?
    • On any page on the web, you can “View Source” to
    see the HTML of the page

    View Slide

  26. https://thimble.webmaker.org/

    View Slide

  27. CSS
    • Cascading Style Sheets
    • Describes the “look” of the web
    • Defines how HTML will appear in the browser
    • Like “make all the big titles” red:


    h1 {

    color: red;

    }

    View Slide

  28. JavaScript
    • The “programming language” of the web
    • Supported by almost all web browsers
    • Allows “interactive stuff” to happen in the browser
    • Simple and easy to learn, like:


    var temp_c = 0;

    var temp_f = temp_c * 1.8 + 32;

    View Slide

  29. View Slide

  30. View Slide

  31. var temp_c = 100;

    var temp_f = temp_c * 1.8 + 32;

    temp_f

    View Slide

  32. http://jsfiddle.net/

    View Slide

  33. Add jQuery

    View Slide

  34. HTML

    View Slide

  35. JavaScript

    View Slide

  36. CSS

    View Slide

  37. http://l.ruk.ca/temp-convert

    View Slide

  38. JSON
    • JavaScript Object Notation
    • A lingua franca for passing data around the web.
    • The “fat-free alternative to XML”
    • Very easily used by JavaScript because it’s a
    subset of the way objects are represented in
    JavaScript.

    View Slide

  39. Some JSON
    {
    firstname: "Peter",
    lastname: "Rukavina",
    telephone: "902-628-8544"
    }

    View Slide

  40. [
    {
    "street_num": 32,
    "street_nm": "RIVERVIEW CR",
    "comm_nm": "VERNON BRIDGE",
    "county": "QUN",
    "latitude": 46.17488,
    "longitude": -62.8834
    },
    {
    "street_num": 11,
    "street_nm": "PEMBROKE CR",
    "comm_nm": "STRATFORD",
    "county": "QUN",

    View Slide

  41. The Web of JSON
    • “Web pages” don’t need to be (only) human-
    readable
    • Open data on the web works best when…
    • it’s simply attached to a URL
    • it’s in an easily-manipulated format
    • it’s easy to understand

    View Slide

  42. http://www.electionspei.ca/
    api/
    provincial/
    districts/
    index.php?
    street_nm=PRINCE&
    street_no=100

    View Slide

  43. {
    "addresses_found": 1,
    "addresses": [
    {
    "district": {
    "name": "Charlottetown - Victoria Park",
    "returningofficer": {
    "firstname": "Amy",
    "lastname": "Doyle",
    "street": "25 Cumberland St.",
    "city": "Charlottetown",
    "phone": "892-0846"
    },
    "number": "12",
    "url": {
    "html": "http:\/\/www.electionspei.ca\/
    provincial\/districts\/district12",
    "xml": "http:\/\/www.electionspei.ca\/
    xml\/provincial\/districts\/district12"
    }

    View Slide

  44. http://l.ruk.ca/json-holland

    View Slide

  45. http://l.ruk.ca/json-holland

    View Slide

  46. View Slide

  47. {
    "type": "FeatureCollection",
    "crs": { "type": "name", "properties":
    { "name": "urn:ogc:def:crs:OGC:
    1.3:CRS84" } },
    "features": [
    { "type": "Feature", "properties": { "LOT":
    "GEORGETOWN", "AREA": 0.001879, "PERIMETER":
    0.297538 }, "geometry": { "type": "Polygon",
    "coordinates": [ [ [ -62.572620405028403,
    46.199679527058578 ], [ -62.580760470484037,
    46.219434133419306 ], [ -62.579024444158172,
    46.219831688011375 ], [ -62.577552427247561,
    46.219943190658306 ], [ -62.576511573647167,
    46.219610925737399 ], [ -62.575648113478202,
    46.218968914354932 ], [ -62.573996965015965,
    46.218782798817166 ], [ -62.573314930094163,

    View Slide

  48. View Slide

  49. View Slide

  50. View Slide

  51. Powered by GeoJSON

    View Slide

  52. View Slide

  53. View Slide

  54. Windmill by Stephen Downes is licensed under CC BY-NC 2.0

    View Slide

  55. I want everyone to have a gut feeling for 

    the load,
    the generation,
    and the generation mix

    View Slide

  56. Richard Brown
    Minister of Environment, Energy and Forestry
    Photo of Richard Brown from Liberal Party of Prince Edward Island

    View Slide

  57. Ron Estabrooks
    Energy Advisor with the PEI Energy Corporation
    Photo of Ron Estabrooks taken at the open house to officially launch the Hermanville/Clearspring wind development from www.gov.pe.ca.

    View Slide

  58. Still from Ton Zijlstra from Cognitive Cities Conference is licensed by CC BY-NC-ND 3.0

    View Slide

  59. Ron Estabrooks
    Energy Advisor with the PEI Energy Corporation
    Photo of Ron Estabrooks taken at the open house to officially launch the Hermanville/Clearspring wind development from www.gov.pe.ca.

    View Slide

  60. I want everyone to have a gut feeling for 

    the load,
    the generation,
    and the generation mix

    View Slide

  61. RTOs and ISOs
    • Regional Transmission Organization or
    Independent System Operator
    • Organizations that manage the electricity network
    • Like the “switchboards” for the electricity network,
    which has been called “most complex machine
    ever devised by man.”
    • For PEI the network is managed by the NBSO: the
    New Brunswick System Operator

    View Slide

  62. View Slide

  63. http://l.ruk.ca/nbso-web

    View Slide

  64. NBSO as HTML

    View Slide

  65. Tools of an Artist by John is licensed under CC BY-NC-SA 2.0

    View Slide

  66. Open, but Not Enough
    • It’s “open” but it’s not “open enough”
    • There’s not enough structure to the data, especially
    if I want to use it with other tools (to archive it, to
    graph it, etc.)
    • Solution: convert the HTML into JSON.

    View Slide

  67. http://l.ruk.ca/nbso-convert

    View Slide

  68. {
    "NB-Load": "2272",
    "NB-Demand": "2353",
    "ISO-NE": "493",
    "NMISA": "31",
    "HYDRO-QUEBEC": "-945",
    "NOVA-SCOTIA": "0",
    "PEI": "165"
    }
    http://l.ruk.ca/nsbo-json

    View Slide

  69. I want everyone to have a gut feeling for 

    the load,
    the generation,
    and the generation mix

    View Slide

  70. Pachube + SoundCloud Mashup by Peter Rukavina licensed under CC BY 3.0

    View Slide

  71. I want everyone to have a gut feeling for 

    the load,
    the generation,
    and the generation mix

    View Slide

  72. Clip of audio from CBC Spark interview with Peter Rukavina by Nora Young, recorded June 19, 2011.

    View Slide

  73. “Closed” Data from
    Charlottetown

    View Slide

  74. “Closed” Data from 

    Cornwall

    View Slide

  75. “Closed” Data from 

    Stratford
    Town of Stratford Building Permit Summary 7/1/2013 to 7/31/2013
    Applicant Estimated Development
    Date PermitID Applicant Name Phone # PID Lot# Address Permit Type Project Value Permit Fee
    JUL-15-2013 DP078-13 Robert Gaudet 902-367-6129 932111 171 6 Carrington Road Accessory Building - New $1,200.00 $30.00
    JUL-25-2013 DP056-13 Stratford Quickstop 1044494 1 Jubilee Drive Accessory Building - New $11,000.00 $100.00
    Sub Totals: $12,200.00 $130.00
    JUL-05-2013 DP072-13 Rosemary Scott 902-569-3021 728188 135 33 Celtic Lane Accessory Structure (Pool, Deck, etc) - $800.00 $30.00
    Addition
    JUL-16-2013 DP077-13 Kent Building Supply - 329375 154 Spinnaker Drive Accessory Structure (Pool, Deck, etc) - $5,000.00 $30.00
    Andrew Sanderson Addition
    Sub Totals: $5,800.00 $60.00
    JUL-26-2013 DP085-13 Richard E. Woodfield 902-367-3637 1010693 7 Picton Beete Cr Accessory Structure (Pool, Deck, etc) - $3,000.00 $30.00
    New
    JUL-12-2013 DP076-13 Jamie Doiron 902-629-0224 486118 14 Towerwood Drive Accessory Structure (Pool, Deck, etc) - $3,000.00 $30.00
    New
    JUL-03-2013 DP039-13 Chris and Jennifer 902-569-2114 471508 10 Aintree Drive Accessory Structure (Pool, Deck, etc) - $6,000.00 $30.00
    Whitlock New
    JUL-30-2013 DP016-13 Craig and Jennifer 902-566-1801 1014638 93 Bonavista Avenue Accessory Structure (Pool, Deck, etc) - $25,000.00 $30.00
    Lawlor New
    JUL-15-2013 DP062-13 Drew and Karen 902-894-3959 1029180 22 Saints Crescent Accessory Structure (Pool, Deck, etc) - $50,000.00 $30.00
    MacIntyre New
    Sub Totals: $87,000.00 $150.00
    JUL-31-2013 DP059-13 Craftsman 940650 11 Galway Court Single Family Dwelling - Addition $18,000.00 $56.80
    Construction
    JUL-05-2013 DP071-13 Roger Johnson 902-569-4882 709154 73 Rankin Drive Single Family Dwelling - Addition $40,000.00 $114.40
    JUL-10-2013 DP070-13 Greenleaf Construction 902-566-3358 603613 1 2 Battery Point Drive Single Family Dwelling - Addition $150,000.00 $43.68
    Sub Totals: $208,000.00 $214.88
    JUL-25-2013 DP081-13 D.C. McCardle 902-367-9200 398586 70 77 Southampton Drive Single Family Dwelling - New $180,000.00 $458.20
    JUL-18-2013 DP079-13 D.C. McCardle Ltd 902-367-9200 398586 72 85 Southampton Dr Single Family Dwelling - New $200,000.00 $469.40
    JUL-30-2013 DP084-13 Barry MacDonald 1045749 13 11 Donegal Lane Single Family Dwelling - New $300,000.00 $1,187.60
    Thursday, August 01, 2013 Town of Stratford Building Permit Summary 7/1/2013 to 7/31/2013 Page 1 of 2

    View Slide

  76. What if I want to…

    View Slide

  77. What if I want to…

    View Slide

  78. Windmill by Stephen Downes is licensed under CC BY-NC 2.0

    View Slide

  79. I want everyone to have a gut feeling for 

    the load,
    the generation,
    and the generation mix

    View Slide

  80. Richard Brown
    Minister of Environment, Energy and Forestry
    Photo of Richard Brown from Liberal Party of Prince Edward Island

    View Slide

  81. Ron Estabrooks
    Energy Advisor with the PEI Energy Corporation
    Photo of Ron Estabrooks taken at the open house to officially launch the Hermanville/Clearspring wind development from www.gov.pe.ca.

    View Slide

  82. View Slide

  83. 60 MW from oil
    50 MW from diesel
    39 MW from diesel
    200 MW
    from cables
    11 MW
    from oil
    12 MW from wind
    30 MW from wind
    30 MW from wind
    99 MW
    from wind
    23 MW
    from wind

    View Slide

  84. Generation Mix
    • 194 MW (maximum) from wind energy
    • 160 MW from local fossil fuel generators
    • 200 MW from submarine cables

    View Slide

  85. Peak Load 220 MW

    View Slide

  86. I want everyone to have a gut feeling for 

    the load,
    the generation,
    and the generation mix

    View Slide

  87. “Can we get real-time
    data on load and
    generation?”

    View Slide

  88. (one year passes)

    View Slide

  89. Yes!

    View Slide

  90. http://l.ruk.ca/pei-wind

    View Slide

  91. Tools of an Artist by John is licensed under CC BY-NC-SA 2.0

    View Slide

  92. View Slide

  93. View Slide

  94. http://l.ruk.ca/pei-json

    View Slide

  95. PEI as JSON
    [
    {
    "data1": 210.15,
    "data2": 139.22,
    "data3": 7.98,
    "data4": 82.02,
    "data5": 57.2,
    "updateDate": 1424875441,
    "error": 0
    }
    ]

    View Slide

  96. http://e.ruk.ca/pei-json

    View Slide

  97. PEI as (Better) JSON
    {
    "on-island-load": 210.15,
    "on-island-wind": 139.22,
    "on-island-fossil": 7.98,
    "wind-local": 82.02,
    "wind-export": 57.2,
    "percentage-wind": "66.25"
    }

    View Slide

  98. http://l.ruk.ca/pei-fiddle

    View Slide

  99. View Slide

  100. http://l.ruk.ca/pei-archive

    View Slide

  101. http://l.ruk.ca/pei-graph

    View Slide

  102. View Slide

  103. View Slide

  104. “I have become slightly obsessed by your
    energy graph and am very grateful that you have
    found a way to record the load and wind power
    generated in PEI. Do you by any chance have a
    spread sheet of these values? I am looking at
    using storage to balance wind fluctuations and
    was hoping to try and using the real load and
    wind data to accomplish that.”

    View Slide

  105. http://pei.consuming.ca/

    View Slide

  106. View Slide

  107. View Slide

  108. I want everyone to have a gut feeling for 

    the load,
    the generation,
    and the generation mix

    View Slide

  109. Windmill by Stephen Downes is licensed under CC BY-NC 2.0

    View Slide

  110. View Slide

  111. I want everyone to have a gut feeling for 

    whether it’s a
    good time to use electricity or not

    View Slide

  112. View Slide

  113. “PEI Energy Thingy”
    • Uses a Raspberry Pi, an inexpensive, web-
    connected, touch-screen computer
    • Uses the JSON version of the PEI load and
    generation data
    • Provides simple feedback:

    red - bad time to use energy (no wind, fossil)

    yellow - average time to use energy

    green - good time to use energy (high wind)

    View Slide

  114. Maritime Electric
    www.gov.pe.ca
    energy.reinvented.net
    SCADA
    (proprietary)
    JSON
    (open)
    JSON
    (more open)
    red,
    yellow or
    green

    View Slide

  115. http://innovis.cpsc.ucalgary.ca/

    View Slide

  116. http://innovis.cpsc.ucalgary.ca/

    View Slide

  117. I want to have a gut feeling for 

    my own load
    “From MW to KW”

    View Slide

  118. Social Consumption Project
    • Can we measure household electricity usage in
    real time?
    • Can we display this usage information to people in
    the house?
    • Can we use social pressures and a feeling of
    competition to motivate a decrease in
    consumption?

    View Slide

  119. Tools of an Artist by John is licensed under CC BY-NC-SA 2.0

    View Slide

  120. View Slide

  121. Meter Type 8
    Itron Brand
    Serial Number
    Current Reading
    (in kWh)

    View Slide

  122. My Electricity Meter
    • Broadcasts its current reading by radio in the

    900 MHz range.
    • This broadcast is in the clear (not encrypted).
    • Anyone in range of the meter can receive the
    readings.

    View Slide

  123. View Slide

  124. My Water Meter
    • Broadcasts its current reading by radio in the

    900 MHz range.
    • This broadcast is in the clear (not encrypted).
    • Anyone in range of the meter can receive the
    readings.

    View Slide

  125. View Slide

  126. Grid Insight AMRUSB-1
    • An inexpensive (< $100) USB stick containing a
    radio receiver capable of reading and decoding
    electricity and water meter readings.
    • The readings can be processed by almost any
    computer, including a Raspberry Pi.

    View Slide

  127. View Slide

  128. Windmill by Stephen Downes is licensed under CC BY-NC 2.0

    View Slide

  129. Social Consumption Project
    • Can we measure household electricity usage in
    real time?
    • Can we display this usage information to people in
    the house?
    • Can we use social pressures and a feeling of
    competition to motivate a decrease in
    consumption?
    and water!
    ^

    View Slide

  130. View Slide

  131. Social Consumption Project
    • Five Charlottetown test households.
    • Equipped with water and electricity meters and
    wireless Internet.
    • Households okay with sharing their consumption
    data with others in the test group and with the
    public.

    View Slide

  132. Web Database

    View Slide

  133. http://l.ruk.ca/scp-table

    View Slide

  134. http://l.ruk.ca/scp-compare

    View Slide

  135. http://l.ruk.ca/scp-peter

    View Slide

  136. http://consuming.ca/

    View Slide

  137. View Slide

  138. Social Consumption Project
    • Can we measure household electricity usage in
    real time?
    • Can we display this usage information to people
    in the house?
    • Can we use social pressures and a feeling of
    competition to motivate a decrease in
    consumption?

    View Slide

  139. Tools of an Artist by John is licensed under CC BY-NC-SA 2.0

    View Slide

  140. Node-RED

    View Slide

  141. What is Node-RED?
    • A visual “drag and drop” way of wiring together
    devices and data.
    • No programming required.
    • Runs locally on your computer, and is accessed
    using a web browser on your computer.
    • The Social Consumption Project Raspberry Pi
    computers use it to read and upload electricity and
    water meter data to the web.

    View Slide

  142. Fire up Node-RED

    View Slide

  143. Fire up Node-RED
    cd /usr/local/nodered/node-red-0.10.3
    node red

    View Slide

  144. Fire up Node-RED
    127.0.0.1:1880

    View Slide

  145. View Slide

  146. Add an inject node

    View Slide

  147. View Slide

  148. Configure it

    View Slide

  149. Add a http request node

    View Slide

  150. View Slide

  151. http://e.ruk.ca/pei-json

    View Slide

  152. Wire the nodes together

    View Slide

  153. Add a debug node

    View Slide

  154. Click Deploy

    View Slide

  155. Click the Inject trigger

    View Slide

  156. See the magic happen…

    View Slide

  157. Add a json node

    View Slide

  158. Add a template node

    View Slide

  159. Add a switch node

    View Slide

  160. Add 2 template nodes

    View Slide

  161. Add 2 template nodes

    View Slide

  162. Add a debug node

    View Slide

  163. The Flow

    View Slide

  164. Click Deploy

    View Slide

  165. Click the Inject trigger

    View Slide

  166. See the magic happen…

    View Slide

  167. Social Consumption Project

    View Slide

  168. View Slide

  169. Windmill by Stephen Downes is licensed under CC BY-NC 2.0

    View Slide

  170. I want everyone to have a gut feeling for 

    the load,
    the generation,
    and the generation mix
    I want everyone to have a gut feeling for 

    whether it’s a
    good time to use electricity or not
    I want to have a gut feeling for 

    my own load



    View Slide

  171. Open Data

    Guiding Principles
    • You can’t anticipate what citizens will use your
    open data for (maybe they will make music from
    electricity).
    • Reduce as many barriers as possible to easy,
    painless access to data: find the right format(s) and
    put the data right on the web, with a URL.
    • “Eat your own dogfood” – develop systems that
    consume you own open data.

    View Slide

  172. Still from Ton Zijlstra from Cognitive Cities Conference is licensed by CC BY-NC-ND 3.0
    Be the one public servant
    in the blue shirt…

    View Slide