Skip to content

Three initial starter templates & improved copy-asset UX#2268

Open
nhoening wants to merge 6 commits into
mainfrom
feat/asset-templating-wizardry
Open

Three initial starter templates & improved copy-asset UX#2268
nhoening wants to merge 6 commits into
mainfrom
feat/asset-templating-wizardry

Conversation

@nhoening

@nhoening nhoening commented Jul 6, 2026

Copy link
Copy Markdown
Member

Description

Create initial templates that users can use. single-asset, e.g. battery, charge point, heat pump. Make the UX for starting users better around this.

Closes #2165

  • Make sure three initial single-asset templates exist
  • Improve UX on copy-asset dialogue
  • mention the idea of templating in docs
  • Added changelog item in documentation/changelog.rst

Look & Feel

Screenshot from 2026-07-06 13-01-39

The dialogue pre-selects templates. A toast explains this and that users can search for anything.

How to test

Use the UI to create a new asset.

Further Improvements

We have follow-up ideas about template sites, where multiple assets incl. prices lead to a wholesome tutorial incl. a quick schedule.

nhoening added 3 commits July 3, 2026 00:47
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…in settings)

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening nhoening self-assigned this Jul 6, 2026
@nhoening nhoening added the UI label Jul 6, 2026
@nhoening nhoening added this to the 1.0.0 milestone Jul 6, 2026
@nhoening nhoening changed the title Feat/asset templating wizardry Three initial starter templates & improved copy-asset UX Jul 6, 2026
@nhoening nhoening mentioned this pull request Jul 6, 2026
nhoening added 2 commits July 6, 2026 13:59
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening

nhoening commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

Waiting for #2269 so this CI will work again.

@nhoening nhoening requested a review from Flix6x July 8, 2026 12:47

@Flix6x Flix6x left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice to see this arrive.

asset_type=asset_types["battery"],
description=(
"Single battery asset with example power and state-of-charge sensors, "
"plus a basic storage flex-model. Copy this to start modeling a battery."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The part about the copying is removed upon copying, which is nice. I advise having the logic that removes the string, and the description here, both import the string identifier from the same place, so the logic is better safeguarded against future revisions.

name="electricity-power",
unit="kW",
event_resolution=timedelta(minutes=15),
attributes={"consumption_is_positive": True, "template_role": "power"},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the template role removed, too, when copied?

)
ev_charger.flex_model = {
"soc-max": "60 kWh",
"soc-min": "12 kWh",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"soc-min": "12 kWh",
"soc-min": "0 kWh",

Otherwise schedules starting with a SoC below 12 kWh would be infeasible.

Maybe you could set a soc-minima to 12 kWh next to the soc-min, for a soft constraint.

Comment on lines +218 to +225
def _template_metadata(template_key: str) -> dict:
return {
"template": {
"key": template_key,
"kind": "single-asset",
"has_scenarios": False,
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use a docstring.

asset_types = add_default_asset_types(db)

# Battery
battery = _ensure_public_root_asset(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider placing the templates under a Templates root asset? For structure? Similar to a data lake asset.


If ``True``, FlexMeasures provisions a small set of public starter templates,
such as ``Battery Template``, ``EV Charger Template`` and ``Heat Pump Template``,
if they do not exist yet. Together with the asset copy workflow, new users will

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So they get recreated if the host deletes them without setting this config setting to false?

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 flexmeasures | 🛠️ Build #33504616 | 📁 Comparing 262fb66 against latest (3a3a313)

  🔍 Preview build  

5 files changed · ± 5 modified

± Modified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create three initial template assets

2 participants