As long as you know the OFF value for your item you would just test for that with a simple comparison as you did in the first case. If you are not sure what values you should expect from the item then use the api explorer to look at what the gets returned for that item from api calls because that is what the mainUI uses.
In this case it is reasonable to expect that "0" is the returned state when the dimmer is off (note however that this "0" is a string and not an number value). Since this is the only OFF case you would just use:
The quotes around the zero mean that the comparison is looking for the string. If you just used 0 then that condition would always be false because the state is, as noted above, a string and "0" does not equal 0. If you needed, for some reason to compare the 0 numerically then you would have to parse the state into a number. For example you could test if the state is greater than 0 (i.e., the dimmer is on) with:
I think i’d be able to create a new / different widget for my dimmer lights (OFF = 0), but could this be done in one widget for simple toggles lights (on/off) and the dimmer? basically i’d need to check if items[props.item].state == “OFF” OR “0”.
Another option would be to put 2 versions of the components you want to be different for the switch and dimmer items and then use a new parameter to identify which type of item you are using. You can then add the visible: config parameter to each of the components you want to be different.
Hi, very nice interface you made. One question, how did you removed the ‘Overview’ title on the upper left corner of the Overview screen and included in the upper menu bar? Attached picture. Thank you very much.
can u tell me how u get the “Overview” Page filled with items or informations? In my openHAB it looks like a “big black hole”. I find nothing to change this page or fill with items. I have the three “standard” cards: Locations, Equipment and Properties. I dont know what i need to do to fill the “Overview” Page.
The Overview tab is a Layout Page. That page shows how to configure it so the page is responsive (i.e. changes it’s layout based on the size of the screen). Further information can be found in Building Pages.
The wdigets you put on a Layout Page are usually going to be Custom Widgets or they will be widgets installed from the Marketplace.
I have been looking for a way to do this too…
Working with you option to call my widget from an oh-cell, but it pops up a blank popup instead of my widget.
Will keep trying to figure it out though
@Oliver2 The screenshot in your post #4 in this thread looks like you were able to merge the old Habpanel design with the Main UI environment. Is this correct and if so how did you accomplish this?
At that early stage there was no “Fixed Grid” layout available so that I wrote one widget which contained several items.
You can see it here:
However, life is now much easier. Thanks to “hubsif” who made the Fixed Grid layout available. Start with this and you can rebuild your habpanel layout.
I also ended up with a Fixed Grid layout (what you see above was a workaround when only Responsive layouts were available.
If you like I can post my layout and widget yaml codes
Maybe open a seperate thread for this if there are further questions
Thanks for the reply - I have already started to convert Habpanel to the Fixed Grid Layout from hubsif but somewhat liked the design from the Habpanel a bit better than the new one. But anyway - Don´t want to live in two worlds so will continue to dig deeper into F7.