FlowFuse / FlowFuse/node-red-dashboard

use a variable from msg to dynamically set ui-group name in a (subflow's) dashboard node

Open
#1,456 0 comments 0 reactions 0 assignees View on GitHub
needs-triage type:feature
Dominant language
HTML
Stars
355
Forks
82
Avg merge
4d 23h
Merged PRs (30d)
24

Description

### Description

Thx for all the great work on Dashboard!
Would it be possible to have a msg part be the ui-group name of a dashboard node (on deployment)? I have used room names as an example below, but the general idea here is that often you will find that the arrangement of the subscribed topic tree is reflected in a dashboard. So then it would be very handy if (parts of) the topic tree 'automagically' perform ui-group 'placement' in a page.

Imagine a subflow that shows temperutures in a chart and gauge. The subflow is in a flow and is (only) connected to an mqtt_in node. The ui-group name is the room name where the temperatures are measured and the same room name is part of the subscribed topic that the mqtt_in node is subscribed to. The FR is to derive the room name from msg.topic and use that value as the ui-group name in the dashbaord node. That way you only need to create an mqtt_in node with the right topic and connect that to the subflow, to set the ui-group.

For example;
- the subscribed topic in the mqtt_in node is /home/room1/sensors
- in the subflow, a function node derives 'room1' as the room name with something like `msg.topic.split("/")[1];`
- a change node then sets that as a flow context variable something like `$[ROOM_NAME]`
- with that, in the dashboard node (in the subflow), the FR is to make it possible to set the group name to `[page]/$[ROOM_NAME]`

Prerequisite is of course to have the intended ui-group names defined in the dashboard environment beforehand otherwise this will lead to an undefined error or the like.

### Have you provided an initial effort estimate for this issue?

I can not provide an initial effort estimate

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.