Getting Started with OH3: rewriting the tutorial - 6. Model your home with Items & link Channels

HABot has not really been touched in a long time. I would not be surprised if you are forced to choose which is more important to you, making HABot happy or your Locations cards. In my experience, it just takes some time and experimentation to get to something you can live with.

1 Like

I agree.
Will do. :slight_smile:

Hello,

I’m strugling rewriting my text based config to fit the semantic model.
I’ve been able to add locations, equipments and points (sensors, switches).

The thing I need help with is to find why I’m not able to assign a dimmer switch (control, light) point to an equipment even though a switch item (switch, light) item is already assigned to that one.

In every room I have a sensors and under sensor (equipments) I have numerous points as temp measurement, presens detection, power status etc… I’ve checked my config for errors 10 times now but can not figure out why this point does not have a “IsPointOf” value.

Every part of the config is written text based.

“Group.items” file:

Group gBathroom "Fürdőszoba" <bath> (gIndoor) ["Bathroom"]
Group gBathroomLights "Fürdőszoba világítás" <light> (gRoomLights, gBathroom, gAllLights) ["Lightbulb"]

“All.items” file:

//BATHROOM DIMMER//

Dimmer FurdoDimmerSwitchDimmer "Bathroom light"    <slider>  (gAllLights, gBathroomLights, gRoomLights) [ "Control", "Light" ] {channel="zwave:device:0372d50f:node10:switch_dimmer"}

//BATHROOM MIRROR SWITCH//

Switch   FurdoTukorSwitchSwitchBinary    "Mirror Light"    <light>  (gAllLights, gBathroomLights, gRoomLights) [ "Switch", "Light" ] {channel="zwave:device:0372d50f:node8:switch_binary"}



Not sure why the IsPointOf property is missing from the Dimmer light item, although it is in the same group as the Mirror Switch item…

What am I missing here? :slight_smile:

I recommend against this. It’s just not worth the effort to fight with the model in .items files.

Have you looked at other evidence for proper configuration? Does the Dimmer show up in the Overview Tabs? If you go to gBathroomLight’s page is the Dimmer shown as a member? Does the Dimmer appear somewhere else in the Model? I can’t read the screen shots but it kind of looks like it’s sitting at the bottom of the list in the model. That means that the root of the problem is the Group membership.

About all I can really suggest is to focus on that gBathroomLights Group. Watch the logs for errors. Try different ways to define the Item. Reload the .items files. Maybe even restart OH.

Hello,

The item shows up in my sitemap just fine, and can be toggled/dimmed.
Also it shows up in the properties tab under the lights card.
In the model if I navigate to Bathroomlights equipment and check the properties of that, it shows that direct members are: bathroom light and mirror light.

I’m not sure what happened but now I’ve edited the tagging of the bathroom light item from [“Control”, “Light”] to [“Switch”, “Light”] then back to [“Control”, “Light”] and now it shows up as it should be.

Strange that I’ve done that for like 3 times yesterday and nothing has happened :smiley:
Anyway thanks for taking the time to try to help me, much appreciated!

Hi All

Can someone explain why i cant add further locations under Indoor, that represent rooms?

Thanks!

I can’t see the screen shot very well, but it looks like you created a Location type item not a semantic location. A Location Item is for geolocation data (lat/lon). A semantic location is just a regular Group Item that happens to have the one of the location semantic tags. Because your item is not a group the model page doesn’t recognize it as warranting the further location options of adding other locations or equipment.

Don’r try to create your semantic model locations through the Items page, use the Model page and click on the add location button that appears when no other items are selected in the three. That will give you your root location(s).

Thanks Justin, I’m creating it on the Model page. If you click the screenshot, it will blow up to higher resolution

I believe I’m creating a Semantic location under the model page, not under the Items page

The issue remains that you are somehow creating the wrong type of item. If you look at one of my semantic locations, you see that under the item label is says Group·Location>Building


That means this is a group item with the location semantic tag of building. Beneath that there is the whole suite of options for adding sub-locations, equipment, etc.

For the item you are showing us it says Location·Location>indoor. This is not a group item.

Did you add this location by pressing the Add Location button on the model page?

If you did, did you then change the item Type from Group to ‘Location’? Don’t do that. Leave it as a group.

The overlap in terminology between semantic location (semantic tags) and location item (item type) is regrettable, but once you remember that semantic locations are just another way of organizing (grouping) your items it makes it a little easier to keep track of what’s going on.

1 Like

Thanks Justin for the great explanation! Thats fixed it :slight_smile:

Hi All,

Just wondering what’s the best way to model an Airconditioner, which has 4 zones.

I want to tie the Zone to each room, which is defined as a Switch (ON/OFF) but I would like to use the Climate Control badge on the Location/Room, only displaying if both the Zone is ON, and the Air conditioner Power is ON.

The Zones can either be on/off, and therefore direct air to the room, but its not linked to the power being on or off.

Hopefully that makes sense!

Not entirely but I can give some rules of thumb which might help.

  • Model things the way that they physically appear to your users. The users of the house do not care that the actual relay that controls an outlet exists in a closet somewhere. They don’t care that the switch is Zwave, the relay is KNX and the lamp has a Hue bulb. All they care is when they flip this switch that lamp turns on. So model the lamp and only the lamp. Put the switch into the lamp equipment and don’t put that relay in the closet into the model at all. Put the lamp in the room where it physically exists.

  • Put the equipment into the location where the effect is felt. For example, if you have a light in the kitchen that can be controlled by a switch in the hall, put that switch under the kitchen light equipment in the kitchen). It’s counter intuitive to have to look in the hall card in the UI to turn on the lights in the kitchen.

  • I’ve mentioned it before but want to say it again as it’s own rule. Only put stuff into the model that is relevant to your users. If you must add things to the model your users don’t care about, use the visibility property on the widgets to only show them to admin users and hide them from regular users. Only present to the users of the home those controls that are relevant to them.

  • Be consistent. If you’ve modeled a lamp using an equipment, model all lamps using an equipment, even if it only has the one switch.

2 Likes

That all makes sense rich, but the question is technical. In that, how do you link in the model someone turning on an AC zone (switch item) with the actual AC unit (which is also a switch item) in another room.

If I place in the bedroom, the AC zone switch (to direct air to that room) the AC Unit also needs to be on, so how can that be represented by a single button to turn the AC on in that room

Clearer?

Sounds like a job for a proxy Item and a rule. The model only provides information about what your Items represent and where they may be located. Nothing more and nothing less. What you are after is a behavior and that requires rules or transformations or profiles. The follow profile might be relevant here.

1 Like

Thanks Rich will look into the follow profile!