Streaming Solar Energy Production Data

5 min


This week we launched the specification for weighted values. This spec allows you to model data using weights. The spec is great for creating data distributions such as a bell curve. To illustrate this feature, we use a simplified example of a solar panel that emits energy production data hourly.

The graph below is live! It is connected to a stream generator that outputs data every second (every hour would make it a boring chart!).

Use Case

Assume we are an energy IoT company. We want to generate data to test our energy monitoring mobile application. Here are a few questions we want to address:

  1. How should our application display incoming solar energy data?
  2. How do we analyze these data to provide suggestions to our users?
  3. How will our system handle streams from many devices?

We can prototype, validate and demo all of these features using Overseed. Ultimately, we will design the data and connect to a stream that generates real-time data based on that design.

Overseed at work

First, we define the attributes along with the product, engineering, and data science teams.

  1. Device ID: Each message has a UUID that uniquely identifies the device.
  2. Timestamp: Each message provides a timestamp marking the hour.
  3. kWh: Each message contains a decimal field with the measurement of energy production in Kilowatts.

Second, we list the behavior of the data we want:

  1. Solar energy production is 0 from 6 PM to 7 AM.
  2. Solar energy production follows a bell curve shape starting at 7 AM and ending at 5 PM.
  3. Solar energy production is usually highest at noon.
  4. We need variability in our bell curve to model daily changes in the amount of solar energy produced.

Third, we can build the first version of our schema!

let HourlyWeights = {
	"6": [1, 2]
	"7": [2, 3]
	"8": [3, 4]
	"9": [4, 6]
	"10": 5
	"11": [5, 6]
	"12": [7, 10]
	"13": [6, 10]
	"14": [5, 7]
	"15": [4, 6]
	"16": [2, 4]
	"17": 2
	"18": [1, 2]

device_id: "string"
record_ts: "date"
kwatt_hrs: "float"

RandoSpecs: [
	#RandoSpec & {
		name: "device_id"
		values: ["d321eaa6-a378-44b5-8bad-bb739d973c6e"]
	#RandoSpec & {
		name: "record_ts"
		values: ["2021-08-24T00:00:00.000Z"]
		step: { h: 1}
	#RandoSpec & {
		name: "kwatt_hrs"
		timeSample: HourlyWeights
		clock: "record_ts"
		scalar: 30

In the above schema we defined weights for the applicable hours. For example, "12": [7, 10] indicates to use a weight between 7 and 10 when our timestamp is at noon. Subsequently the value for kwatt_hours will be equal to that weight multiplied by the scalar value of 30 we defined under the kwatt_hrs spec or 240 kWh.

You can learn more about this specification in the doc.

Lastly, we create a generator using our schema to produce records at a chosen rate (in the graph example, we set it to 1 second). Then we connect the application to our Overseed data generator using WebSockets.

We can now test our display with extreme values, check the suggested user actions we provide and connect many streams to stress test the application. Further, the data science team can use the schema to download a large batch of data to prototype learning features.


Using Overseed's weighted values specification, we simulated a device that outputs solar energy production and used it to prototype, validate and test our application. In Addition, we can update the schema as we add more features or find new edge-cases.

We look forward to how you use this feature and any feedback you have!

Sign-up here.

The code for the embedded chart can be found in this GitHub repository.