Item for input text or numbers

items
Tags: #<Tag:0x00007f0e8fabe4e8>

(Harry) #1

Is it possible to define items for input text or numbers e.g. a code/password?


(Thomas Bail) #2

Unfortunately there is no input widget. To enter numbers there is somewhere a topic how to create a keypad

Thomas


(Anders Alfredsson) #3

If you want it on your sitemap you can make a simple web page with some JavaScript that posts to the REST API, and show it in a webview.

Edit: if it’s just text or a number you might not even need JavaScript, you could just make a html-form that posts to the right path in the rest API. I’m not able to test at the moment, but I think it should work.


(Harry) #4

(Stuart Hanlon) #5

There is a widget for HabPanel

Universal Keypad for HABPanel

And a alarm panel / password widget and rules in the library too, simply called Keypad


(Jürgen Baginski) #6

I’m using the following code on a HABPanel widget to show a “Textbox” (empty space taking the text) followed by a button that hands the text to a string item (SayCommand).

  <div class="form-group">
    <input type="text" class="form-control" no-snap-drag="true"
           ng-model="myvalue" ng-value="itemValue('SayCommand')"></input>
    <button type="button" class="btn btn-primary"
           ng-click="sendCmd('SayCommand', myvalue)">Sag es!</button>
  </div>

Publish manual added text from openhab UI