Rob_Clark
(Rob Clark)
March 22, 2021, 6:22am
1
Platform information:
Issue of the topic: please be detailed explaining your issue
Looking for advice on how to do the following
I have a Basic UI page showing the temp from a temp sensor
I have created a login with role:user
that can see that page. (Note when that user is logged in - he is NOT an admin)
I want to have a persistent number ("TempLimit’) that can be tested in a rule/script (ie. if (Temp > TempLimit) do something
)
I want TempLimit value to be a run-time variable; Not hardcoded in a script
Not sure where to save this TempLimit.
my 1st idea is to create a channel (that has no MQTT updates).
also note that there is a runtime [vars] array that could be useful …but not sure if these values are persistent - or are reset on openHAB restart.
??? other places?
I want the user to be able to edit TempLimit from the Basic UI page
Any advice appreciated.
opus
(Jürgen Baginski)
March 22, 2021, 7:02am
2
Store the value in an item (which is not linked to any channel), persist it with your desired persistence service and display it using a setpoint.
Rob_Clark
(Rob Clark)
March 22, 2021, 8:36am
3
@opus
Thanks. That helped.
I have added two cells to my BasicUI
Slider Cell
Nothing displays in the Cell. Is that normal?
Click on the cell and get a vertical Slider … but no text (values) shown unless mouse is changing value. No scale shown ether. Normal?
Seems to be a bug in the HTML when setting the VERTICAL boolean???
<input name="vertical" type="number" step="0.01" data-validate="true" data-validate-on-blur="true" class="input-with-value">
component: oh-slider-cell
config:
item: SetPoint
min: 10
max: 30
scale: true
header: Freezer 1 - Set point
label: true
unit: C
scaleSteps: 5
scaleSubSteps: 1
icon: oh:heating
color: blue
vertical: 0.63
Knob Cell
Nothing displays in the Cell. Is that normal?
Click on Cell and get a blank popup ???
component: oh-knob-cell
config:
header: Freezer 1 - Set point
item: SetPoint
max: 30
responsive: true
icon: oh:heating
min: 10
primaryColor: "#cccccc"
secondaryColor: "#ffffff"
textColor: "#888888"
slots: null
Not sure if I am fighting bugs or my own ignorance.
Rob_Clark
(Rob Clark)
March 22, 2021, 9:34am
5
Got it all working
The trick was to use Widgets (not cells)
opus
(Jürgen Baginski)
March 22, 2021, 11:36am
6
Glad you got it working!
A sidenote: BasicUI does show sitempas created by a .sitemap file or created as a sitemap from within MainUI-Pages.
Widgets are displayed via MainUI.