Hi all.
After maybe too many years I’ve decided to give the “new” semantic model a try. After a few hours things actually look quite nice. I have one aesthetic problem though that I don’t know what to do about.
In some part of my house the only automation I have is light switches. That means in those parts I get lots of equipments that only have one point each, which I don’t think go well with the interface in the location tab. Either I go with the default and let all my points be named “switch”, which mean a long list where every other row just says “switch”. Or I name my points after what lamp they control, but it isn’t much better, see attached image.
Is there any other way to visualize those equipments with only one point? Or any other way to do this look nicer?
Because it offers benefits elsewhere (Items page, Blockly rules, Links, Developer Sidebar all promenatly show the Item lable over the Item name or place in the semantic model) I always label my Items to include what they control.
Some of your options to manage this include:
put all the lights in one location into one Equipment instead of many
get rid of the Equipment entirely and make the lights direct members of the Location
there are a few properties you can set on how the the equipment are displayed; go to the Overview page and click the pencil icon in the upper right corner and see if any of those options work for you.
The primary use of the semantic model is to control how these Overview tabs get populated. So dont’ be afraid to exeriment with different hierarchies, visibility, and default list Item metadata to get you to what you want. For example, you could create one parent Equipment and hide all but one of the switches and create one widget with all the lights on one row. Just be careful to not go over one row in size. It mostly works but there is a bug (which I’ve reported) that makes the close and analyse buttons not work when the list Item widget is too tall. I still use them though.
That one widget shows nine Items. I put this widget as the default list Item widget for one fo the Items and set the visibility in the default list Item widget for the remaining eight Items to false.
Probably a better example would be
which is all one line but shows and lets one control the deadbolt as well as showing the door sensor.
Yep, this is absolutely the nicest and easiest way to go for me here. Just a single “lights” equipment and then put all the points beneath that. Thanks!
Hi
A little off topic (nothing to do with one-point equipments), but I’ll continue this thread with another semantic-newbie question. My model is getting really nice. I added most of my stuff by marking the right location and then “Create Equipment from Thing” and clicking which channels I want to include as points. I discovered now though that this has created duplicates of all the included items, so now it looks like this in my items list:
Just wondering if this is needed or if I did it wrong? Simply deleting them and instead set the relevant semantic properties on my original item seems to do just fine, just checking so that I don’t shoot my own foot by doing so…
When you “create equipment from thing” the intent there is to create the Items. Unfortunately if you already have the Items you’ll need to do all that stuff manually.
So you are not necessarily doing it wrong but if you want to keep your old Items you probably need a different work flow.
The way I would do it is:
navigate to the Thing
choose “unlink and remove items” which will delete all the already existing Items linked to the Thing.
then choose “create equipment from thing” and be sure to go through all the fields shown for each channel you chose to include. This is where you define all the properties for the new Items so here is where you set the Item names, Item labels, category, unit, type, etc. By default the Item naming scheme will be something like EquipmentName_ChannelName and the label will be the Channel Name with the underscores replaced with spaces.
At this stage I usually add more meaning to the Item labels so I don’t have a bunch of Items just labeled “Temperature”. It’s important to double check the semantic tags and unit as well. Unfortunately, if you’ve other metadata to apply to the Item (e.g. default X widget, expire, etc.) you’ll need to navigate to each newly created Item and readd those manually (maybe, it used to be the case that the metadata didn’t get deleted when you delete the Item and that may still be the case so if you keep the same Item name the metadata will still be there). If you keep the same Item name, all your persistence will still be there.
The alternative is to do it all manually. Create the Eqipment Group, add your existing Items to the Group (thankfully you cand do that from the Group now and don’t need to navigate to each Item individually to add them to the Group one-by-one). Then you need to go to each Point Item and set the semantic tags as desired.
I have hopes that some of this might become easier to do from the Model page (e.g. drag and drop to move Items into Groups) but until that happens, I personally find it easier to just delete and recreate the Items anew, though now that you can add memers to a Group from the Group’s page it’s a whole lot easier to retrofit your existing Items than it used to be.
I went for the route of just deleting all the newly created Items and setting a semantic class and equipment group on my old ones instead, seems to work fine. When I created the new ones the way I did they got names based on the Things (like the “Z03_Hank_HKZWSO05_vaxthuset_Switch” above) which I really don’t like, I want the names of my Items to be indepentent of the hardware used. So now I’m back to the Items I named myself
Starting to get the hang of this stuff. It’s not as magical as I thought, just a couple of attributes that control how things are visualized in the user interface. But I’m starting to get a really beautiful app now
When you use create equipment from thing,
openHAB has no other information than the thing name, unless you tell it.
You can give the equipment a custom name and your items will get this as a prefix and the channel ad a suffix.
Some widgets use this naming scheme in oh-repeater components to reduce config effort.
A follow-up question… Those newly created Items which I deleted seem to still lurk around somehow. I just noticed a whole lot of rows like this in my log:
2024-08-30 07:36:40.058 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn’t exist: Z03_Hank_HKZWSO05_vaxthuset_Switch
I think there is one of these rows for each of the deleted Items, all within the same second. Nothing else was happening in the system at the time according to the logs, no other Item changes or so. Any idea what this might be? The new health check thingy doesn’t seem to detect anything weird.
Ah! Not entirely, but I think you pointed me in the right direction. Around this time I started the OH app on the family iPad and it showed me old outdated stuff, I had to kill the app and restart it to get the new page. I guess the cached GUI in the app simply had pointers to those deleted Items, seems like a small bug in the iOS app then, not refreshing correctly. Thanks!