Item for input text or numbers

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

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

Thomas

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.

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

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>
2 Likes

I really like your widget, but can you explain to me, how to select an item that will be updated with the entered value?

I’m sorry, this widget has a hardcoded item connected, no selection possible.

Can you explain to me how I can change that for my use case? I just need to set that for my item once. I have no experience with creating widgets.

Can you help me understand, how to hardcode one of my items into the widget? I don’t need it to have a selection after setting up. I just need to connect (hardcode) my own items into it and don’t know how.

If you replace

SayCommand

with your item-name …

1 Like