SaveAWattHour For Developers

For Developers

REST API – daily energy savings recommendations

In 2014, while working as a postdoc researcher at University of Southern California, part of the Smart Grid Regional Demonstration Project in Los Angeles, I designed and published a Google app for providing advices to the general public on simple actions they could take to reduce their energy consumption. Recently, while working on an update I decided to provide a public API to enable developers to integrate these advises in their own applications. I admit the idea also came while teaching my undergrad students Azure fundamentals. As a result, I implemented by using Azure Functions the following API that everyone can try out.

The API is still in beta phase.

REST API: https://saveawatthour.azurewebsites.net/api/recommendactions

The API accepts the following parameters:

  • q – the location name as a string or the GPS coordinates as latitude,longitude pair in decimal values
  • tz – location time zone as an integer
  • appliances – one or more appliances as a comma separated list: AC, ELECTRIC_HEATER, LIGHTS, REFRIGERATOR, ELECTRIC_STOVE, MICROWAVE, DISH_WASHER, WASHING_MACHINE

Two parameters are mandatory: q and tz.

The call returns a JSON with a list of actions containing

  • action – action name as a string
  • startDateTime – start date and time of the action. Time is UTC
  • endDateTime – end date and time of the action. time is UTC
  • heatIndex – the calculated temperature in Celsius degrees taking into account the humidity. Integer value
  • text – a call for action text as a string

Example:

Call: https://saveawatthour.azurewebsites.net/api/recommendactions?q=Nottingham&tz=0&appliances=REFRIGERATOR,LIGHTS,AC,ELECTRIC_HEATER

Response:

{

    "actions":[
        {
            "startDateTime":"Fri Dec 03 18:00:00 UTC 2021",
            "heatIndex":4,
            "action":"DECREASE_SET_POINT",
            "text":"It's chilly outside! Get a warm sweater and save by lowering the thermostat setpoint!",
            "endDateTime":"Fri Dec 03 22:00:00 UTC 2021"
        },
        {
            "startDateTime":"Sat Dec 04 06:00:00 UTC 2021",
            "heatIndex":5,
            "action":"DECREASE_SET_POINT",
            "text":"It's chilly outside! Get a warm sweater and save by lowering the thermostat setpoint!",
            "endDateTime":"Sat Dec 04 15:00:00 UTC 2021"
        },
        {
            "startDateTime":"Fri Dec 03 23:00:00 UTC 2021",
            "heatIndex":3,
            "action":"DECREASE_SET_POINT_NIGHT",
            "text":"Sleep time! Save by decreasing the thermostat setpoint by a few degrees!",
            "endDateTime":"Sat Dec 04 05:00:00 UTC 2021"
        },
        {
            "startDateTime":"Fri Dec 03 18:00:00 UTC 2021",
            "heatIndex":4,
            "action":"USE_ANY_KITCHEN_AND_LAUNDRY_SERIALIZED",
            "text":"Low billing hours! Save and reduce grid stress by not using appliances simultaneously!",
            "endDateTime":"Fri Dec 03 22:00:00 UTC 2021"
        },
        {
            "startDateTime":"Sat Dec 04 07:00:00 UTC 2021",
            "heatIndex":5,
            "action":"USE_ANY_KITCHEN_AND_LAUNDRY_SERIALIZED",
            "text":"Low billing hours! Save and reduce grid stress by not using appliances simultaneously!",
            "endDateTime":"Sat Dec 04 15:00:00 UTC 2021"
        }
    ]

}