Right now, our plots can only consist of sensors. Our dashboard model, asset.sensors_to_show, has no ability to include static values.
I see two ways we might want to support:
- Static values could be entered in the Graphs dialogue freely. We'd only allow a label and a float.
- The values can be taken from flex-context and flex-model. The latter can actually have both fixed values or sensors, so it would be nice to simply link to a combination of asset and flex-context/model field, and the backend figures out if that includes a fixed value or a sensor. The label is the context/model field name. The dialogue could simply
Work items:
- The
sensors_to_show schema would be adapted to allow three new types of entries:
{"title": "my plot", "value": 15} (adding the "value" option)
{"title": "my plot", "asset": ASSETID, "flex-model": "max-soc"}
- as above, but for flex-context
- The UI dialogue needs extension (as I wrote, context/model fields might simply come from a list - or we only make selectable the keys that actually exist on the asset context/dialogue, assets also need to come from a dropdown list, which is the lit of accessible assets)
- Update the code to generate charts, so it understand these new options. I would make sure it is robust against failure. Error messages (e.g. the field
max-soc is not set on the asset) could even be shown in the console or even a Toast.
- Update the toy tutorial, showing the battery's power capacity on its dashboard (power flow graph), and the site power capacity in the dashboard of the building.
I would rule out model fields which are more complex than fixed value or sensor (e.g. target SoCs, commitments). But they should be added later, same as annotations.