Ui template with ui controls for rooms

Hi there!

I wrote a function node which generates a JSON object reporting the temperature and other things for a room:
{
"T": 23.4,
"RH": 55,
"AH": 13.9
}

Is it possilbe to create an ui template which contains some gauges and charts from the ui section, so that a have a single node for each room? Currently I have lots of gauges and charts on my flow, and for every node I have to configure the group individually.

Kind regards

Stefan

Hi - sorry - no. At present there is no concept of groups of widgets that can be reused. There is some thinking along these lines in the future but we are not there yet.

Here is my flow for Room:

[{"id":"854f9b31.2744d8","type":"tab","label":"Livingroom"},{"id":"ee1ad9a3.957658","type":"switch","z":"854f9b31.2744d8","name":"Livingroom","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"uptime","vt":"str"},{"t":"cont","v":"rssi","vt":"str"},{"t":"cont","v":"ram","vt":"str"},{"t":"cont","v":"load","vt":"str"},{"t":"cont","v":"temprature","vt":"str"},{"t":"cont","v":"humidity","vt":"str"},{"t":"cont","v":"pressure","vt":"str"},{"t":"cont","v":"lux","vt":"str"},{"t":"cont","v":"breach","vt":"str"},{"t":"cont","v":"oled","vt":"str"},{"t":"cont","v":"pin","vt":"str"},{"t":"cont","v":"dimvalue","vt":"str"}],"checkall":"true","repair":false,"outputs":12,"x":190,"y":200,"wires":[["8c311eaf.4ce74"],["bfb73323.04709"],["eda821aa.582da"],["c43ecf9b.ce04"],["b608012c.18697"],["c9dd3730.e6e088"],["e13b0c9f.786a2"],["cb412e35.9e1bd"],["a8218250.77d9b"],["6537a39e.aa901c"],["69566c83.4531c4"],["16ef607c.305ad","40b927e7.bc8e48"]]},{"id":"8c311eaf.4ce74","type":"ui_text","z":"854f9b31.2744d8","group":"fb689c95.7c861","order":5,"width":"1","height":"1","name":"","label":"Uptime","format":"","layout":"col-center","x":380,"y":100,"wires":[]},{"id":"c43ecf9b.ce04","type":"ui_text","z":"854f9b31.2744d8","group":"fb689c95.7c861","order":7,"width":"1","height":"1","name":"","label":"Load","format":"","layout":"col-center","x":376,"y":217,"wires":[]},{"id":"eda821aa.582da","type":"ui_text","z":"854f9b31.2744d8","group":"fb689c95.7c861","order":6,"width":"1","height":"1","name":"","label":"RAM","format":"","layout":"col-center","x":375,"y":177,"wires":[]},{"id":"bfb73323.04709","type":"ui_text","z":"854f9b31.2744d8","group":"fb689c95.7c861","order":8,"width":"1","height":"1","name":"","label":"RSSI","format":"","layout":"col-center","x":371,"y":137,"wires":[]},{"id":"16ef607c.305ad","type":"ui_switch","z":"854f9b31.2744d8","name":"","label":"On/Off","tooltip":"Turn Fan On/Off","group":"fb689c95.7c861","order":3,"width":"2","height":"1","passthru":false,"decouple":"false","topic":"Livingroom/dimmer/dimvalue/set","style":"","onvalue":"128","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":370,"y":300,"wires":[["88b175a3.a21b88","8f8948da.e58458"]]},{"id":"40b927e7.bc8e48","type":"ui_slider","z":"854f9b31.2744d8","name":"","label":"Fan Speed","tooltip":"Adjust Fan Speed","group":"fb689c95.7c861","order":4,"width":"4","height":"1","passthru":false,"outs":"end","topic":"Livingroom/dimmer/dimvalue/set","min":0,"max":"128","step":1,"x":350,"y":340,"wires":[["88b175a3.a21b88","8f8948da.e58458"]]},{"id":"69566c83.4531c4","type":"ui_numeric","z":"854f9b31.2744d8","name":"","label":"Fan","tooltip":"Select Fan","group":"fb689c95.7c861","order":2,"width":"2","height":"1","passthru":false,"topic":"Livingroom/dimmer/pin/set","format":"","min":"6","max":"9","step":1,"x":370,"y":260,"wires":[["88b175a3.a21b88","8f8948da.e58458"]]},{"id":"c9dd3730.e6e088","type":"ui_gauge","z":"854f9b31.2744d8","name":"Humidity","group":"fb689c95.7c861","order":10,"width":"1","height":"1","gtype":"gage","title":"Humidity","label":"","format":" %","min":"40","max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":540,"y":140,"wires":[]},{"id":"b608012c.18697","type":"ui_gauge","z":"854f9b31.2744d8","name":"Temperature","group":"fb689c95.7c861","order":9,"width":"1","height":"1","gtype":"gage","title":"Temperature","label":"","format":" F","min":"45","max":"90","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":550,"y":100,"wires":[]},{"id":"cb412e35.9e1bd","type":"ui_gauge","z":"854f9b31.2744d8","name":"Luminocity","group":"fb689c95.7c861","order":12,"width":"1","height":"1","gtype":"gage","title":"Luminocity","label":"","format":" Lux","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":550,"y":220,"wires":[]},{"id":"e13b0c9f.786a2","type":"ui_gauge","z":"854f9b31.2744d8","name":"Pressure","group":"fb689c95.7c861","order":11,"width":"1","height":"1","gtype":"gage","title":"Pressure","label":"","format":" Kpa","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":540,"y":180,"wires":[]},{"id":"ef9931ca.83c2d","type":"ui_switch","z":"854f9b31.2744d8","name":"Alarm","label":"On/Off","tooltip":"Turn Alarm On/Off","group":"fb689c95.7c861","order":14,"width":"2","height":"1","passthru":true,"decouple":"false","topic":"Livingroom/alarm/set","style":"","onvalue":"On","onvalueType":"str","onicon":"","oncolor":"","offvalue":"Off","offvalueType":"str","officon":"","offcolor":"","x":350,"y":420,"wires":[["aa13ba8d.ec9de8","9c1c2950.5502e8"]]},{"id":"a8218250.77d9b","type":"ui_text_input","z":"854f9b31.2744d8","name":"Security","label":"Security","tooltip":"Watch for Security breach","group":"fb689c95.7c861","order":13,"width":"2","height":"1","passthru":true,"mode":"text","delay":300,"topic":"Livingroom/breach/set","x":340,"y":380,"wires":[["88b175a3.a21b88"]]},{"id":"88b175a3.a21b88","type":"join","z":"854f9b31.2744d8","name":"Announce","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"5","count":"1","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":705,"y":342,"wires":[[]]},{"id":"aa13ba8d.ec9de8","type":"mqtt out","z":"854f9b31.2744d8","name":"","topic":"","qos":"","retain":"","broker":"","x":546,"y":383,"wires":[]},{"id":"8f8948da.e58458","type":"batch","z":"854f9b31.2744d8","name":"2 Together","mode":"count","count":"2","overlap":0,"interval":10,"allowEmptySequence":false,"topics":[],"x":560,"y":280,"wires":[["aa13ba8d.ec9de8"]]},{"id":"6d375129.897e8","type":"ping","z":"854f9b31.2744d8","name":"Ken","host":"10.1.10.27","timer":"20","x":70,"y":320,"wires":[["c5fa4ee5.8bc6f"]]},{"id":"c5fa4ee5.8bc6f","type":"switch","z":"854f9b31.2744d8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"false"}],"checkall":"true","repair":false,"outputs":1,"x":190,"y":320,"wires":[["f75f1cb8.23196"]]},{"id":"e8e81e8.5251ee","type":"rbe","z":"854f9b31.2744d8","name":"Block ","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":683,"y":435,"wires":[["88b175a3.a21b88"]]},{"id":"9c1c2950.5502e8","type":"change","z":"854f9b31.2744d8","name":"Alarm Status","rules":[{"t":"change","p":"payload","pt":"msg","from":"On","fromt":"str","to":"Alarm is set to On","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"Off","fromt":"str","to":"Alarm is set to Off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":535,"y":435,"wires":[["e8e81e8.5251ee"]]},{"id":"f75f1cb8.23196","type":"change","z":"854f9b31.2744d8","name":"Alarm On","rules":[{"t":"change","p":"payload","pt":"msg","from":"false","fromt":"bool","to":"On","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":160,"y":420,"wires":[["ef9931ca.83c2d"]]},{"id":"22fe929d.a7065e","type":"debug","z":"854f9b31.2744d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":370,"y":520,"wires":[]},{"id":"6537a39e.aa901c","type":"ui_text_input","z":"854f9b31.2744d8","name":"Oled","label":"Messages","tooltip":"","group":"fb689c95.7c861","order":15,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":350,"y":460,"wires":[[]]},{"id":"452f66ff.2d6008","type":"saveflow","z":"854f9b31.2744d8","name":"Save Flow","path":"/home/pi/rpieasy/flows/","enabled":false,"exporttype":"addflow","x":288,"y":48,"wires":[["e7bfb52a.0b17e8"]]},{"id":"366981ad.005d5e","type":"inject","z":"854f9b31.2744d8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":105,"y":48,"wires":[["452f66ff.2d6008"]]},{"id":"e7bfb52a.0b17e8","type":"debug","z":"854f9b31.2744d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":479.5,"y":47,"wires":[]},{"id":"fb689c95.7c861","type":"ui_group","z":"","name":"Livingroom","tab":"d5c21250.33001","disp":true,"width":"6","collapse":true},{"id":"d5c21250.33001","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

I found something about ui templates here:

<div>
   <md-datepicker ng-model="myDate" md-placeholder="Enter date" ng-change="send({payload: myDate})"></md-datepicker>
</div>

So I thought I could do this also with gauges, charts, ...

@happytm, thank you for your example, but this is what I would like to avoid, because I'd have lots of nodes for each room