[SOLVED] UserCode Input in sitemap

i need to input some userlevel string as “1234”. According this I will mask some sitemap rows.
How to do it please ?


String usercode  "4 digits user code [%.0f ]"

sitemap seems be wrong, need input some digits via keyboard like “1234” not arrows down/up

Setpoint item=usercode

There is currently no way to enter arbitrary text via sitemap.

People have created keypad type things hough.

Thanks, but it is no nice method.
A user verification is most important, like PIN protection.

I think HabPanel is the better UI for this.
There is also a Custom Widget for this:


Thanks, but i need to protect some setpoint functions in one sitemap from unauthorised manipulation
from all web and mobile apps. I don’t want to use many sitemaps.

HabPanel widged is nice for touch display.

It must not be a string value, numerical 4 digit value is OK, but how put it in sitemap as number not with incremental arrows ?

As already said, there is no such a function in BasicUI od ClassicUI and I am afraid there never will be, as nobody steped up to implement this, cause of other existing alternatives.

You can do it using a Webview element in sitemap and create a html file in your html folder with a java script sending the value on specific triggers, just like in this example:


Hi George.
Thanks for post.
I make some substitution in script:

<script language="JavaScript">
    function getParam(param)
        var qs = (function(a) {
            if (a == "") return {};
            var b = {};
            for (var i = 0; i < a.length; ++i)
                var p=a[i].split('=', 2);
                if (p.length == 1)
                    b[p[0]] = "";
                    b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
            return b;
        return qs[param]
    function checkInput(id)
        var x=document.getElementById(id).value;
        if (isNaN(x)) 
        {   document.getElementById(id).value = ""
            return false;
        {   return true;
    function resetInput(id)
        document.getElementById(id).value = ""
    function httpGetAsync(theUrl)
        var xmlHttp = new XMLHttpRequest();
        xmlHttp.open("GET", theUrl, true); // true for asynchronous 
    function sendValue() {
        if checkInput('Userlevel') 
            url = "" + getParam('item') + "=" + document.getElementById('Userlevel').value
         else {
    <input name="Userlevel" id="Userlevel" type="number" onChange="sendValue()">

They are:
textInput -> Number item=Userlevel
localhost -> RpiIP
type=text -> number (Userlevel is a Number Item)

But transfer to Userelevel item does not work.
What is the problem please ?

If you are using openHAB 2.x the above script will not work (openHAB 2.x is using the REST API). Use the one on post number 6 in the same link I’ve posted previously! It should work.


Thanks George working OK inOH2.
Is it possible to extend the code for only four digit input (PIN number) and delete the input filed after pressing Enter ?
Can be AJAX values supressed, that the last values are not remembered ?