Property for Switch in Semantic Model

As I better understand how the semantic model works and how it can benefit me, I find myself a little confused about how to handle a device (an Equipment Group Item and Thing) that is a switch (be it a wall switch or a powerplug switch. Looking at the Semantic Model, I see that a switch can have a location, be a Control Point and have an Equipment type (Wallswitch, Poweroutlet). But there is no Property that fits (something like ON/OFF State). Perhaps it is unnecessary, as by definition that is what a switch is/does. But I have a nagging feeling that I’m losing some functionality in the UI automatically generate cards by not having a property.

I hope someone can enlighten me.

There aren’t any hard and fast rules - whatever you like, really.

I have some switches which turn a bulb on and off, so use the property Light. This means that the Light card in the Properties tab of the MainUI holds all my light switches (plus other light related items tagged with Light). Though I don’t really use this feature much, to be honest.

I model my stuff as follows:

  • Everything has an equipment. So a switch that controls a light would be a member of an Group tagged with the 'LightBulb` tag.

  • The Switch is tagged with ‘Switch’ and ‘Light’ for the property.

I use this approach because the end users don’t care if the actual device at the end of that Switch Item is a wall switch, a smart outlet or what ever. All they care is they want to control the lights. So that’s how I model it. Always consider the model based on the end users and how they perceive and interact with the house.

The key is to be consistent so the same sort of thing appears the same way everywhere. For example, all light switches should be a member of an equipment or none of them should be.

Also, just because there are tags that more closely match the devices, it doesn’t always make sense to use them. For example, I’ve a number of Google Home Minis and Google Home Hubs. I could model the minis with a “smartspeaker” tag and the hubs with a “smartassistant” tag (going from memory here, I may have the exact tags wrong) but as far as OH is concerned they are all interacted with the same way (not surprising since they all are integrated into OH using the Chromecast binding) so they all get the same equipment tag.

1 Like

Hi, I created a Semantic model with my house, rooms, equipment and points. In this model i have switches for different lamps in different rooms. Is it now possible to control all lamps with one commend?
How to create now a simple task like “switch off all lights” in my house (without configure a virtual switch and add all light-switches to this switch).

The way to do that is in fact to create a Group:Switch Item, add all the lights to that one Group and send the on/off command to that Group.

This is unrelated to the semantic model.