Ui-level node without min/max values?

grafik

@hotNipi, (how) can I disable the min and max values?
I want to use ui_level for the current position of my roller shutter and do not need these values.

You cant.
But as it is not too complicated thing to do from scratch, maybe you'll get much more flexibility that way.

[{"id":"cadf9b85060d9334","type":"ui_button","z":"9141c3fbcc7d9e2b","name":"","group":"f6124e036e2d2ffb","order":2,"width":1,"height":1,"passthru":false,"label":"▲","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"-5","payloadType":"num","topic":"topic","topicType":"msg","x":350,"y":1060,"wires":[["a462cbe137de5aef"]]},{"id":"dca7c216a33cc29f","type":"ui_button","z":"9141c3fbcc7d9e2b","name":"","group":"f6124e036e2d2ffb","order":4,"width":1,"height":1,"passthru":false,"label":"▼","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"5","payloadType":"num","topic":"topic","topicType":"msg","x":350,"y":1120,"wires":[["a462cbe137de5aef"]]},{"id":"f42d9612c0296acf","type":"ui_template","z":"9141c3fbcc7d9e2b","group":"f6124e036e2d2ffb","name":"DIY level","order":3,"width":1,"height":1,"format":"<style>\n.level-vert{\n  position:absolute;\n  inset:0; \n  bottom:0;\n  width:100%;  \n  background:repeating-linear-gradient( 0deg, green, green 2px, transparent 2px, transparent 4px);\n  height:calc(1% * var(--size));\n  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n</style>\n<div id=\"{{'level_'+$id}}\" class=\"level-vert\"></div>\n\n\n<script>\n    (function(scope) {\n      const min = 0\n      const max = 100\n  scope.$watch('msg', function(msg) {\n    if (msg) {\n      console.log(msg)\n      // Do something when msg arrives\n      const v = Math.floor(((msg.payload - min) / (max - min)) * 100);\n      const t = Math.floor(((msg.top - min) / (max - min)) * 100);\n      document.getElementById('level_'+scope.$id).style.setProperty('--size', v);\n    }\n  });\n})(scope);\n</script>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":640,"y":1080,"wires":[[]]},{"id":"a462cbe137de5aef","type":"function","z":"9141c3fbcc7d9e2b","name":"","func":"let p = context.get(\"p\") || 100;\np = parseInt(msg.payload + p);\nif(p > 100){\n    p = 100\n}\nif (p < 0){\n    p = 0\n}\ncontext.set(\"p\",p);\nmsg.payload = p\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":1080,"wires":[["f42d9612c0296acf"]]},{"id":"f6124e036e2d2ffb","type":"ui_group","name":"Default","tab":"34ab7d39f3e308fc","order":1,"disp":true,"width":"5","collapse":false,"className":""},{"id":"34ab7d39f3e308fc","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

OMG! Thank you! I just had to exchange min and max and it worked!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.