Semantic classes and when to use

Hi!

I know that this topic has been discussed for a numerous times, but I really find it hard to understand when to use the different “semantic classes”. For instance, let us say that I want to control a lightbulb. It supports to be dimmed or to be switched on/off. Below is my current OpenHAB configuration.

Light Dimmer

Type: Dimmer
Category: Light
Semantic Class: Control
Semantic Property: Light

Light Switch (on/off)

Type: Switch
Category: Light
Semantic Class: Point
Semantic Property: Light

Here I am using “control” for the dimmer and “point” for the switch. I assume that I could have used “switch” instead of “point”, but what about “Control” or maybe even “status”? When would you use the different semantic classes?

It depends on what you want out of your semantic model and how you want your Items to be grouped and displayed on the Locations, Equipment, and Properties tabs. Experiment with different tags and see how they change how the Item is displayed/controlled from those three tabs.

For now, a combination of the Item type and the point/property tags are used to choose what type of widget is used by default. But you always have the option to override the default by setting “default list Item widget” metadata on the Item.

As a personal preference, I’d probably use Switch for the class for your light switch which should result in a toggle widget. I also like to not have too many tiny variations. For example, I use Door for equipment because if I use FrontDoor, BackDoor, InteriorDoor, and GarageDoor I’ll end up with a separate card for every door on my Equipment tab which in excessive.

1 Like

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