View code on Github

v0.9.0: CLI == developer power

Computer keyboard, by Florian Krumm
Computer keyboard, by Florian Krumm

Version v0.9.0 of FlexMeasures (see changelog) adds many CLI commands to control FlexMeasures' data from the terminal. We hope this helps with reducing the onboarding time for new accounts!

FlexMeasures will also now convert incoming data, if it has a different source unit than the required sensor unit.

Finally, we added new tutorial on how to get started using FlexMeasures in just a few minutes and we began a new API version (v3) which is more REST-like than v2 and better supports the new data model.   Do let us know if these things help you be more productive with FlexMeasures!

CLI commands

Developers like to work from the terminal. This lets them interact quicker and more direct with a software platform. With the 0.9.0 release, FlexMeasures adds several commands to work with an instance.

To have them available is especially useful when onboarding a new account or new assets (which is the time when the most developer attention is spent in a FlexMeasures project, or any enterprise software project). These commands are also useful to automate tasks like data ingestion or scheduling.

Here is  a list of new commands:

  • Showing data: flexmeasures show accounts, flexmeasures show account, flexmeasures show roles, flexmeasures show asset-types, flexmeasures show asset, flexmeasures show data-sources, and flexmeasures show beliefs
  • Resample sensor data to a different resolution: flexmeasures db-ops resample-data
  • Create a new schedule for a given power sensor: flexmeasures add schedule
  • Edit/add an attribute on an asset or sensor: flexmeasures edit attribute
  • Add a toy account with a battery and a market for trying FlexMeasures out quickly: flexmeasures add toy-account
  • Deleting data: flexmeasures delete unchanged-beliefs, flexmeasures delete nan-beliefs, flexmeasures delete sensorflexmeasures delete asset

You can see all commands in FlexMeasures' CLI documentation.

This work was done in Pull Requests 328, 341, 337 , 339, 343, 360, 368 and 395.

Unit conversion

Units are a crucial topic in time series data. Only if you get them right, will your data also be correct (and you avoid the risk of incorrect data / lengthy debugging periods). Especially if you have to transform data. One example is of course power to energy, e.g. kW to kWh. There is many more examples.

XKCD on unit conversion
The relevant XKCD cartoon

We use the excellent pint library to help us with that. With version 0.9.0,  FlexMeasures will now convert incoming data, if it has a different source unit than the required sensor unit.

For instance, if the incoming data is kWh, and we know the sensor should store kW, and we also know the sensor's time resolution (e.g. it sends data once per 5 minutes), then we can store kWh data correctly as kW data.

Another great example are percentages. We might receive data in percentages, but it should be permille.

This is now done automatically in both the CLI (flexmeasures add beliefs) and the API (POST /sensorData) when adding data.

This work was done in Pull Request 341 and Pull Request 359.

Toy tutorial

We want many organisations to use FlexMeasures and drastically reduce the development time they need to get an energy flexibility app or service up and running. For this, we were missing a tutorial to show from scratch how FlexMeasures can be useful within minutes.

We now have one where you install FlexMeasures and within a couple minutes you are optimizing the charging schedule of a battery. See it in action here.

This work was done in Pull Request 381.