From the code in the link, I tried to reverse engineer the maths.
This is a test flow which is not quite cutting it.
[{"id":"692eb68e.19b71","type":"function","z":"3caae529.4226aa","name":"","func":"var maxin = parseInt(msg.maxin);\nvar minin = parseInt(msg.minin);\nvar maxout = parseInt(msg.maxout);\nvar minout = parseInt(msg.minout);\nvar x = parseInt(msg.payload);\n\nvar divisor = maxin - minin;\nvar n = ((x - minin) % divisor + divisor) % divisor + minin;\n\nvar value = ((n - minin) / (maxin - minin) * (maxout - minout)) + minout;\n\nmsg.payload = value;\n\n\n\n\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":1530,"wires":[["600b5a5e.b66c14"]]},{"id":"e3295788.2fa6d","type":"change","z":"3caae529.4226aa","name":"Limits","rules":[{"t":"set","p":"maxin","pt":"msg","to":"10","tot":"num"},{"t":"set","p":"minin","pt":"msg","to":"1","tot":"num"},{"t":"set","p":"maxout","pt":"msg","to":"100","tot":"num"},{"t":"set","p":"minout","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":1530,"wires":[["692eb68e.19b71"]]},{"id":"600b5a5e.b66c14","type":"debug","z":"3caae529.4226aa","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":740,"y":1530,"wires":[]},{"id":"fdeff99.4adb008","type":"inject","z":"3caae529.4226aa","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1470,"wires":[["e3295788.2fa6d"]]},{"id":"d2bb109f.59a5f8","type":"inject","z":"3caae529.4226aa","name":"","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1510,"wires":[["e3295788.2fa6d"]]},{"id":"6107f5ed.008bfc","type":"inject","z":"3caae529.4226aa","name":"","topic":"","payload":"3","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1550,"wires":[["e3295788.2fa6d"]]},{"id":"ae397d2f.9cb35","type":"inject","z":"3caae529.4226aa","name":"","topic":"","payload":"7","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":240,"y":1590,"wires":[["e3295788.2fa6d"]]}]
The important stuff is in the function
node - of course.
The rest is just showing how I test it, and to have all cards on the table.
Thanks again in advance.