[OH3] Model - Equipment vs Properites

Thanks @rich and @hafniumzinc,

This thread has helped improve my understanding no end - the combination of the text based and UI driven examples for me at least are what I need.

I’ve used the UI exclusively to migrate to OH3 and have found it mostly good - the model has been the biggest barrier to get my head around. I’ll have a think about why - whether it’s the concept, or the UI approach which has contributed (I’m not criticising the UI, I think it’s great and I completely see the benefit in preventing typo’s/simple mistakes which often make up the bulk of the issues in the forum - I find the constant clicking backwards and forwards comparing configs of similar items to make sure they’re consistent while you learn what does what - in a text file, it’s easy to compare two configs).

Thanks again, OH3 has rekindled my interest in HA :stuck_out_tongue:
James

Hi there,

May be, though I seem to have a few:

  • Motion sensors (simple PIR’s connected to a Pokeys57 device)
  • Lights - typically either on/off OR Dimmer
  • Blinds/Curtains - mine are rf remote controlled, so only have UP/DOWN/STOP

I haven’t yet grasped the Model concept fully, but I’m not clear what value in adding an Equipment with a single point is yet.

That said,

This could be what I’m missing - I haven’t even looked at Pages yet, the overview page appears to give me everything I need at the moment. I want to make the best start as changing looks like a lot of work.

Back to the motion sensor - I tried adding an Equipment, and then adding the point to the Equipment. I also have the point in two other groups. Only when I removed it from the other groups would it show up in the model under the Equipment, when I add it to the other groups, it disappears from the Equipment in the model. I’m using the UI here, so not sure what to post to explain the problem. Or How do I force the isPointOf to EnSuiteMotionSensor?

Can a point only be a member of one Group (as Equipment is a Group) ?

Cheers
James

Where and how everything that appears on that overview page comes from how things are tagged in the models and whether or not you’ve overridden and of the default widgets.

A Point can only be the direct member of one semantically tagged Group. The model makes the assumption that a physical device can only be in one location at a time and a Point can only be a part of a single piece of equipment at a time (or if it’s not a part of Equipment) only in on location at a time.

From a real world location base (as opposed to functional based) hierarchy, which the model is supposed to mirror, that makes perfect sense.

  • A Location can only be a member of another location or a member of no Location (i.e. at the root of the model).
  • An Equipment can only be in one location. If you have something that is located in two different locations you might need a zone Location or to move the Equipment up to a higher layer in the model.
  • A Point can be a part of a single Equipment, in which case it inherits the location from the Equipment.
  • Alternatively, a Point can be part of a single Location in which case the Point is free from being a member of any specific Equipment

Why would you have the motion sensor be a member of any other semantically tagged Groups? Note, it can be a member of any number of non-semantically tagged Groups. In this case, gMotionSensors should not be a part of the model. It doesn’t make sense as being in the model anyway. You don’t have a MotionSensors Equipment. You have lots of separate Motion Sensor Equipment. It might be useful to have gMotionSensors to trigger a rule or aggregate the values into one or the like so I’m not saying to remove it nor am I saying to remove the sensors from the Group. What I am saying is to remove the Group from the model by deleting it’s semantic tag.

I’m looking for some help in understanding how to better use and take advantage of the new UI. I’m using text files for all .items and have tagged them as Groups(Locations),Equipment and Points and Properties. No major issues here as I’ve been able to see them in the Model and use them items to create Locations and Equipment in the UI.

My specific issue is that I have a Number: Item that is tagged as [“Setpoint”, “Temperature”] for which I want to create a Stepper or Slider inside of a Location and Equipment Card. Currently the Item value is displayed inside of the location as a Number but cannot be changed, only graphed. I can create an oh-stepper-card or oh-slider-card in the Overview and it works fine, but I am unable to use in side of an oh-equipment-card or oh-location-card.

I have tried all sorts of variants without any success so after beating head against the wall for far too long I realized I need some guidance.

So here is my slider code

component: oh-slider-card
config:
  item: vVenstar_HeatSetPoint
  min: 60
  max: 80
  title: Heat Setpoint
  step: 0.99
  scaleSteps: 1
  unit: °F

that I would to insert into the equipment definition code that is fine and works as expected for what it is.

HVAC:
        - component: oh-equipment-card
          config:
            backgroundImage: /static/files/hvac.jpg
            invertText: false
          slots:
            default:
              - component: oh-slider-card
                config:
                  item: vVenstar_HeatSetPoint
                  min: 60
                  max: 80
            glance:
              - component: oh-link
                config:
                  text: "=items.vVenstarThermostat_Mode.state "
                  color: "=items.vVenstarThermostat_Mode.state==='HEAT' ? 'red': 'blue' "
                  style:
                    font-size: 18px
              - component: oh-link
                config:
                  text: =items.vVenstarThermostat_HeatCoolState.state==='HEAT' ? 'HEATING':'' ||
                    items.vVenstarThermostat_HeatCoolState.state==='COOL' ?
                    'COOLING':'' ||
                    items.vVenstarThermostat_HeatCoolState.state==='OFF' ?
                    'IDLE':''
                  color: "=items.vVenstarThermostat_HeatCoolState.state==='HEAT' ? 'red':'' ||
                    items.vVenstarThermostat_HeatCoolState.state==='COOL' ?
                    'blue':'' ||
                    items.vVenstarThermostat_HeatCoolState.state==='OFF' ?
                    'white':'' "
                  style:
                    font-size: 18px


What is shown in Location/Equipment/Properties card is the “Default List Item Widget” for each item. You can customize this default widget by setting Metadata for it. So just head to the considered item in your model and click “Add Metadata > Default List Item Widget”. Now you can configure the widget via UI or via YAML

1 Like

@rlkoshak,
As always, thanks!

and

Yes, that makes perfect sense, I can only assume when I started trying to understand the model I’d assumed it made sense to tag everything, clearly that makes little sense as the model is driving the UI - something I hadn’t fully appreciated. I’ve got a few more items to migrate, then I’ll start looking more closely at some of the rules and how they can be improved with the model.

Cheers
James

@rlkoshak will the properties be able to be used within .items files? I know a few work (Number:Temperature, for example) but some of them don’t seem to.

Don’t mix properties with item types. I know this can be a little confusing.

This is the type of the item. To be precise it’s a so called QuantityType meaning it’s a Number with an unit that can be used with openhab’s Unit of Measurement features.

What is used to build to semantic Modell used by the new UI to create e.g. the properties tab are just item tags. They are completely independent from the item type and can be set in .items files with square brackets

1 Like

So an equipment must be a group, right?

I ask because I use sometimes
["Measurement", "Temperature"]

and wonder if it would be possible to use:

["Lightbulb","Switch"]
without using an extra group for equipment representation.

It doesn’t have to be a Group. It can just be a single Item. However, you cannot apply a Property tag to Equipment, only to Points. You also can’t use both an Equipment tag and Point tag on the same Item. So you could use ["Lightbulb"] on your Switch Item. But you can’t use ["Lightbulb", "Switch"] because Lightbulb is an Equipment tag and Switch is a Point tag. You can’t mix and match.

  • Locations can only have a Location tag
  • Equipment can only have an Equipment tag
  • Points can only have a Point tag with an optional Properties tag
  • Any semantically tagged Item can only be a direct member of one semantically tagged Group

Alright.
Thank you, Rich.
I really love the new OH3 with all its improvements, but it’s a lot new stuff to learn (beside teaching kids during homeschooling :wink: )

What about this then? :crazy_face:

Group                            gOutdoorCar            "Pulpo XC60"                                                                                       ["Car"]
Group                            gCarLock               "Pulpo XC60 Schloss"                                            (gOutdoorCar)                      ["Lock"]                          {widgetOrder="05"}
Switch                           CarLocked              "Verriegelt [MAP(de.map):%s]"                  <lock>           (G_jdbc,G_Car,gCarLock)            ["Control"]                       {channel="volvooncall:vehicle:pulpo:doors#carLocked", alexa="LockController.lockState"}	// Problematic channel on 2.5.5 VOC binding
Contact                          CarDrFrLeft            "Tür vorne links [MAP(de.map):%s]"             <car_doorf>      (G_jdbc,G_CarDoors,gOutdoorCar)    ["OpenState"]                     {channel="volvooncall:vehicle:pulpo:doors#frontLeft", widgetOrder="06"}

I have my car’s lock (sub-equipment group gCarLock) in my car (equipment without location).
The lock is a Group within the Car group (gOutdoorCar) with a switch as Control.

If I check my Device / Equipment on the overview page, I can see cars → my car, but within there I don’t see a lock - neither as the Group lock, nor the switch lock. (also not as a badge on the Cars Equipment, as I assume it’s available on locations only).

According to this, sub-equipment is possible:

Sub equipment is possible. But the point Items can only be a direct member of one other semantically tagged Group. CarLocked is a member of G_jdbc, G_Car, and gCarLock. gCarLock is semantically tagged. Are G_jdbc or G_Car also semantically tagged? G_Car sounds like it might be.

The way you set up subequipment is:

  • the points are only members of the subequipment group
  • the sub equipment group is only a members of the parent equipment group
  • the parent equipment group is only a member of the location (if there is on).

The Points cannot be direst members of both the subequipment and the parent equipment at the same time. That relationship is represented by the fact that the subequipment is a member of the parent equipment Group.

It’s all much more obvious when working with the model through the UI since it won’t even let you create an Item that is a member of more than one semantically tagged group (unless you go around it and change the Group membership manually through the Items settings). It won’t let you combine tags that are not allowed together (e.g. Equipment and Point).

1 Like

Sorry, I did not mention this.
The only semantically tagged group here is gCarLock
G_jdbc is a group as well, but for persistence purposes only.
G_Car is a group for group handling (in accordance to your DP: Working with groups :slight_smile: ).
I distinguish between both “types” of groups - semantically and non-semantically - by G_ and g… respectively.

Your three bulletpoints applied to my setup are all true:

  • the Switch is only member of the Lock group (gCarLock - see above)
  • the Lock (sub-equipment) is only a member of the Car (parent equipment - gOutdoorCar)
  • the Car (parent eq.) is currently not a member of a location, but I tried with location “outdoor” as well.

I think I understand now, why I did not see what I expected:
I expected that the Lock would be found in the equipment overview (“Car”), but it’s only visible in “Locks”.
Furthermore I expected a lock badge to show up on “outdoor”, but the Lock is not handed over 2 hierarchy levels up, as I learned (one up to car and another up to outdoor).

However, I think - regardless of if it’s a lock, I personally think it should show up under the Car equipment as well.

Maybe that’s a good point to move over from files to mainUI, but I am still a little concerned that importing the items files (developer tools) will not work properly.

Anyway, thank you for your help Rich. Another step forward for me using the semantic model (what I really like - especially the auto generated locations).

That’s not how the Equipment page works.

The Location page shows all your Locations. Opening the card shows all the Equipment and Points at that Location.

The Equipment tab shows all your Equipment types. Opening up an Equipment card will show all the Equipment of that type.

The Properties shows all your Property Types. Opening up a Property card will show all the Point Items with that given property (for example, I have some measurement/humidity and setpoint/humidity tagged Items and both show up under the Humidity card.

The Car card wouldn’t show the Lock because a lock isn’t a Car type equipment.

The only place you would see the lock subequipment under the Car is on the Locations tab.

I believe an issue was already filed for the badge issue where subequipment doesn’t show on the Location’s card. If not you should open one.

It works just fine but frankly it’s easier and less work over all to just recreate the Items using “Create Equipment from Thing” on the Model page. You can recreate dozens of your Items in five minutes using that approach. It’s way less work than trying to build the model in the .items files or trying to reconfigure your imported Items to be a part of the model.

That totally makes sense, after this explanation.

That was my idea in the beginning as well, but it’s not the case.

I can see the lock (Schloss in German) in the model (I just put it back to “outdoors” (Aussen in German):
grafik

But it’s not to be found in the Outdoor Location:

That actually brought me to think it might be found in the car widget.

From you it sounds soo easy, but I am scared :wink:

I will create a disk-image and give it a try the next days.
But I think this will mess up my item naming convention, because OH just doesn’t know about it.
So a lot of manual review of my rules (files based as well) will be possibly more effort.

I’ve not done much with subequipment. I prefer my hierarchy to be as flat as reasonable rather than deep. But when I played with subequipment the equipment was represented in the Location card with a row and > at the end. Clicking on the > opened another card showing the points on the subequipment.

I can’t explain why you are not seeing that here. Maybe it’s past the bottom. Have you tried to scroll on the card? The very bottom of all cards is a “Close” button. If you don’t see that there is more entries off the bottom of the card and you need to scroll to see those. Maybe the subequipment is just off the screen.

You have full control over the Item’s names.

The defaults Item names are pretty reasonable really but if they differ from your current convention you can change them. I do recommend changing the labels so they are unique as well. Otherwise it gets hard to find the right Item in a list as the label is the most prominent way Items are shown, not Item names. So in the above screen shot I’d change the labels to start with “Rich’s Office Home Hub” or something like that so it’s easy to tell what it is in a list.

Notice how you can select which Channels you want and you can set pretty much all of the Item properties except for Item metadata right there for all your Items all at once. Copy and paste for the labels and item names can make applying the naming conventions really easy too.

It doesn’t cost anything but a little bit of time to try it out and see for yourself. If it doesn’t work out it’s easy to delete the Items and use a different way.

Of course I checked the entire page down to the far end:

Unfortunately it’s not there either.
Maybe it’s the Lock’s issue, so I will try to use sub-equipment in another location.
Thanks for your help and the clarification of some points I did not pick up yet.

I totally agree :slight_smile:

EDIT: Just for the record:
I tried to put my Receiver under my remote control (Logitech Harmony).
It’s shown in the model as sub-equipment, but not in the location:
grafik

So, I assume there is a general issue on the sub-equipment.
Unless the combinations / options of valid sub-equipment are limited for specific equipment only.

EDIT II:
Battery as a sub-equipment of sensor - same thing:
visible in Model / invisible in location

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.