Three initial starter templates & improved copy-asset UX#2268
Conversation
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>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
|
Waiting for #2269 so this CI will work again. |
Flix6x
left a comment
There was a problem hiding this comment.
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." |
There was a problem hiding this comment.
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"}, |
There was a problem hiding this comment.
Is the template role removed, too, when copied?
| ) | ||
| ev_charger.flex_model = { | ||
| "soc-max": "60 kWh", | ||
| "soc-min": "12 kWh", |
There was a problem hiding this comment.
| "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.
| def _template_metadata(template_key: str) -> dict: | ||
| return { | ||
| "template": { | ||
| "key": template_key, | ||
| "kind": "single-asset", | ||
| "has_scenarios": False, | ||
| } | ||
| } |
| asset_types = add_default_asset_types(db) | ||
|
|
||
| # Battery | ||
| battery = _ensure_public_root_asset( |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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>
Documentation build overview
5 files changed ·
|
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
documentation/changelog.rstLook & Feel
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.