I have a value from 1 to 8 that I want to show on the dashboard as arrows. All I can do are simple arrows: ↑↓→←. Is there a way to do this using unicode or extended ASCII where I can also get arrows like these?
Those are HTML codes. How do you put them into the dashboard?
Use the dashboard template node for testing.
I don't see how a template could put a unicode symbol on the dashboard.
Right now, I am using a change node to take, for example, a payload of "4", and change it to an ALT-16 character (►).
There are more appropriate arrows in the Unicode world, but the dashboard only shows the standard ASCII set.
What widget you are using in the dashboard to display the arrows ?
Here an example using the template and the ui_text.
[{"id":"fcec496b.4a3828","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"77cd324a.3a3c6c","type":"ui_template","z":"fcec496b.4a3828","group":"6b088045.d465d","name":"Arrows","order":0,"width":"4","height":"6","format":"\n<P>←</p> \n<P>↑</p> \n<p>→</p>\n<p>↓</p>\n\n<p>↖</p> \n<p> ↑</p>\n<p>↘</p>\n<p>↙</p>\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":440,"y":240,"wires":[[]]},{"id":"7f35e5e8.aa809c","type":"inject","z":"fcec496b.4a3828","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":180,"wires":[["3af4c064.dd328"]]},{"id":"3af4c064.dd328","type":"ui_text","z":"fcec496b.4a3828","group":"e6b7a998.6433c8","order":2,"width":"2","height":"1","name":"","label":"<P>←</p>","format":"<P>↑</p>","layout":"row-spread","x":460,"y":180,"wires":[]},{"id":"6b088045.d465d","type":"ui_group","z":"","name":"T1","tab":"aff85644.de7a98","disp":true,"width":"6","collapse":false},{"id":"e6b7a998.6433c8","type":"ui_group","z":"","name":"T2","tab":"aff85644.de7a98","disp":true,"width":"6","collapse":false},{"id":"aff85644.de7a98","type":"ui_tab","z":"","name":"LAB","icon":"dashboard","order":23}]
Thank you professor- I understand my homework assignment.
I am understanding a bit more and can display discrete arrows in the dashboard text node.
My problem is that I want to use one dashboard text node by sending the arrow code to it from a change node. But when I try to put "<P>←</p>"
into msg.payload, I get gibberish in the text node.
Any ideas?
Thanks.
So what settings do you have in the ui-text node? please provide a flow showing the issue from the inject to the ui-text node
Hi, simply sending unicode string should work.
[{"id":"21b42045.65ad3","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"6d1adb8e.557194","type":"ui_text","z":"21b42045.65ad3","group":"6b1cbf30.904d2","order":0,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":610,"y":220,"wires":[]},{"id":"3c8edd5b.5f2932","type":"change","z":"21b42045.65ad3","name":"←","rules":[{"t":"set","p":"payload","pt":"msg","to":"←","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":140,"wires":[["6d1adb8e.557194"]]},{"id":"3986450a.2131aa","type":"change","z":"21b42045.65ad3","name":"↑","rules":[{"t":"set","p":"payload","pt":"msg","to":"↑","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":200,"wires":[["6d1adb8e.557194"]]},{"id":"10e1e202.ae148e","type":"change","z":"21b42045.65ad3","name":"→","rules":[{"t":"set","p":"payload","pt":"msg","to":"→","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":260,"wires":[["6d1adb8e.557194"]]},{"id":"dc27a935.8c2978","type":"change","z":"21b42045.65ad3","name":"↓","rules":[{"t":"set","p":"payload","pt":"msg","to":"↓","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":320,"wires":[["6d1adb8e.557194"]]},{"id":"5adbc5ce.f4cb3c","type":"inject","z":"21b42045.65ad3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":140,"wires":[["3c8edd5b.5f2932"]]},{"id":"6a4e0eee.4ea52","type":"inject","z":"21b42045.65ad3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":200,"wires":[["3986450a.2131aa"]]},{"id":"4aad6473.22409c","type":"inject","z":"21b42045.65ad3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":260,"wires":[["10e1e202.ae148e"]]},{"id":"ee6e6bc.2e37798","type":"inject","z":"21b42045.65ad3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":320,"wires":[["dc27a935.8c2978"]]},{"id":"3ede91ea.05466e","type":"function","z":"21b42045.65ad3","name":"loop","func":"function loop(n) {\n var pos = n % 4;\n var msgs = [];\n for(var i = 0; i < n; i++) {\n msgs.push((i == pos) ? {payload:\"\"} : null);\n }\n node.send(msgs);\n if (n > 0) {\n setTimeout(function() {\n loop(n-1);\n }, 1000);\n }\n}\nloop(10);","outputs":4,"noerr":0,"x":290,"y":400,"wires":[["3c8edd5b.5f2932"],["3986450a.2131aa"],["10e1e202.ae148e"],["dc27a935.8c2978"]]},{"id":"17dfe88c.c2b407","type":"inject","z":"21b42045.65ad3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":400,"wires":[["3ede91ea.05466e"]]},{"id":"6b1cbf30.904d2","type":"ui_group","z":"","name":"Default","tab":"29a51209.1cbfde","disp":true,"width":"6","collapse":false},{"id":"29a51209.1cbfde","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
Thanks, your help is appreciated. Here is my experimental flow.
(Flow text below)
Poll state returns a number (text) from 1 to 7. What I want to do is use the change node to replace the msg.payload with the arrow code, but that doesn't work. (In my experiment I only changed rule 7).
Here is the flow code:
[
{
"id":"e1e30a5d.bf1ae8",
"type":"poll-state",
"z":"eef97088.bad3b",
"name":"",
"server":"cc0d1734.6963a8",
"version":1,
"exposeToHomeAssistant":false,
"haConfig":[
{
"property":"name",
"value":""
},
{
"property":"icon",
"value":""
}
],
"updateinterval":"20",
"updateIntervalUnits":"seconds",
"outputinitially":false,
"outputonchanged":false,
"entity_id":"sensor.cgm_trend",
"state_type":"str",
"halt_if":"",
"halt_if_type":"str",
"halt_if_compare":"is",
"outputs":1,
"x":200,
"y":300,
"wires":[
[
"3219c0ab.0e3cc",
"6ec721fc.76919",
"334975c2.31358a",
"b79f4fec.82d7c"
]
]
},
{
"id":"3219c0ab.0e3cc",
"type":"function",
"z":"eef97088.bad3b",
"name":"Save Trend value to a flow variable.",
"func":"//This saves the trend value to the global variable trend.\nvar v= msg.payload;\nflow.set(\"trend\",v);\n//Return null; if this is the end,\n//Return msg; to trigger a downstream node.\nreturn null;",
"outputs":1,
"noerr":0,
"x":560,
"y":300,
"wires":[
[
]
]
},
{
"id":"6ec721fc.76919",
"type":"ui_text",
"z":"eef97088.bad3b",
"group":"a54feb5a.1d51f8",
"order":2,
"width":0,
"height":0,
"name":"Trend",
"label":"Trend",
"format":"{{msg.payload}}",
"layout":"row-left",
"x":480,
"y":360,
"wires":[
]
},
{
"id":"334975c2.31358a",
"type":"ui_gauge",
"z":"eef97088.bad3b",
"name":"Trend",
"group":"a54feb5a.1d51f8",
"order":3,
"width":0,
"height":0,
"gtype":"gage",
"title":"Trend",
"label":"units",
"format":"{{value}}",
"min":0,
"max":"8",
"colors":[
"#e6e600",
"#00d500",
"#ca3838"
],
"seg1":"",
"seg2":"",
"x":490,
"y":400,
"wires":[
]
},
{
"id":"b79f4fec.82d7c",
"type":"change",
"z":"eef97088.bad3b",
"name":"",
"rules":[
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"0",
"fromt":"str",
"to":"\"0=Unknown\"",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"1",
"fromt":"str",
"to":"▲▲▲",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"2",
"fromt":"str",
"to":"▲▲",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"3",
"fromt":"str",
"to":"▲",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"4",
"fromt":"str",
"to":"---",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"5",
"fromt":"str",
"to":"▼",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"6",
"fromt":"str",
"to":"▼▼",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"7",
"fromt":"str",
"to":"<P>←</p>",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"8",
"fromt":"str",
"to":"\"8=Unknown\"",
"tot":"str"
},
{
"t":"change",
"p":"payload",
"pt":"msg",
"from":"9",
"fromt":"str",
"to":"\"9 = unknown\"",
"tot":"str"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":450,
"y":460,
"wires":[
[
"277d499a.f3f6d6"
]
]
},
{
"id":"277d499a.f3f6d6",
"type":"ui_text",
"z":"eef97088.bad3b",
"group":"a54feb5a.1d51f8",
"order":4,
"width":0,
"height":0,
"name":"",
"label":"Trend",
"format":"{{msg.payload}}",
"layout":"row-left",
"x":640,
"y":460,
"wires":[
]
},
{
"id":"cc0d1734.6963a8",
"type":"server",
"z":"",
"name":"Home Assistant- Raspberry",
"legacy":true,
"hassio":true,
"rejectUnauthorizedCerts":true,
"ha_boolean":"y|yes|true|on|home|open",
"connectionDelay":true,
"cacheJson":true
},
{
"id":"a54feb5a.1d51f8",
"type":"ui_group",
"z":"",
"name":"Default",
"tab":"c3fc345b.45dd38",
"disp":true,
"width":"6",
"collapse":false
},
{
"id":"c3fc345b.45dd38",
"type":"ui_tab",
"z":"",
"name":"Home",
"icon":"dashboard",
"disabled":false,
"hidden":false
}
]
Thanks, nisiyama, but I don't see the unicodes in the change nodes?
I like the loop function, I'll save it for possible future use.
Steve
You don't have to use the unicode itself - when you can cut/paste the actual character you want... so the change node just has the actual arrows in it.
Actually "←" is an unicode string. If you want to use hex code 2190, you can use "\u2190" as a JSONata expression in change node.
[{"id":"21b42045.65ad3","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"6d1adb8e.557194","type":"ui_text","z":"21b42045.65ad3","group":"6b1cbf30.904d2","order":0,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":610,"y":220,"wires":[]},{"id":"3c8edd5b.5f2932","type":"change","z":"21b42045.65ad3","name":"←","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"\\u2190\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":140,"wires":[["6d1adb8e.557194"]]},{"id":"3986450a.2131aa","type":"change","z":"21b42045.65ad3","name":"↑","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"\\u2191\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":200,"wires":[["6d1adb8e.557194"]]},{"id":"10e1e202.ae148e","type":"change","z":"21b42045.65ad3","name":"→","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"\\u2192\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":260,"wires":[["6d1adb8e.557194"]]},{"id":"dc27a935.8c2978","type":"change","z":"21b42045.65ad3","name":"↓","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"\\u2193\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":320,"wires":[["6d1adb8e.557194"]]},{"id":"5adbc5ce.f4cb3c","type":"inject","z":"21b42045.65ad3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":140,"wires":[["3c8edd5b.5f2932"]]},{"id":"6a4e0eee.4ea52","type":"inject","z":"21b42045.65ad3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":200,"wires":[["3986450a.2131aa"]]},{"id":"4aad6473.22409c","type":"inject","z":"21b42045.65ad3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":260,"wires":[["10e1e202.ae148e"]]},{"id":"ee6e6bc.2e37798","type":"inject","z":"21b42045.65ad3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":320,"wires":[["dc27a935.8c2978"]]},{"id":"3ede91ea.05466e","type":"function","z":"21b42045.65ad3","name":"loop","func":"function loop(n) {\n var pos = n % 4;\n var msgs = [];\n for(var i = 0; i < n; i++) {\n msgs.push((i == pos) ? {payload:\"\"} : null);\n }\n node.send(msgs);\n if (n > 0) {\n setTimeout(function() {\n loop(n-1);\n }, 1000);\n }\n}\nloop(10);","outputs":4,"noerr":0,"x":290,"y":400,"wires":[["3c8edd5b.5f2932"],["3986450a.2131aa"],["10e1e202.ae148e"],["dc27a935.8c2978"]]},{"id":"17dfe88c.c2b407","type":"inject","z":"21b42045.65ad3","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":400,"wires":[["3ede91ea.05466e"]]},{"id":"6b1cbf30.904d2","type":"ui_group","z":"","name":"Default","tab":"29a51209.1cbfde","disp":true,"width":"6","collapse":false},{"id":"29a51209.1cbfde","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.