Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrub the semantic tags and add missing tags #4619

Open
rkoshak opened this issue Feb 24, 2025 · 22 comments
Open

Scrub the semantic tags and add missing tags #4619

rkoshak opened this issue Feb 24, 2025 · 22 comments
Labels
enhancement An enhancement or new feature of the Core

Comments

@rkoshak
Copy link

rkoshak commented Feb 24, 2025

The default list of semantic tags are incomplete and inconsistent. Having a way to add custom tags helps some but the default list is the end user's first exposure to the model and it should help them get up to speed on how it works and support the most common use cases with the default list.

At a minimum we should have many more properties, a few more points, and more equipment.

But there are also a bunch of tags that don't make much sense. For example, we probably only need two or three Door tags instead of seven.

I think it makes a lot of sense to come up with some sort of rules for what makes a good tag or not, remove those that don't meet those rules and add any missing ones all in one go rather than fielding a bunch of separate issues to add two tags here and three tags there without any guiding principles.

To deal with removed tags and backwards compatibility, the upgradeTool can search the tags and add any removed ones a user happens to have used as a custom tag.

Your Environment

  • Version used: (e.g., openHAB and add-on versions)
  • Environment name and version (e.g. Chrome 111, Java 17, Node.js 18.15, ...):
  • Operating System and version (desktop or mobile, Windows 11, Raspbian Bullseye, ...):
@rkoshak rkoshak added the enhancement An enhancement or new feature of the Core label Feb 24, 2025
@jimtng
Copy link
Contributor

jimtng commented Feb 25, 2025

My thinking was that we go through the current needs from all the existing bindings, and see what tags are missing/needed, then perhaps we'll have a list of tags to consider. It would then be much easier to see / organise them. I've started this from the linked PR, and that's just from two bindings so far.

Then additionally we get input from users about what other tags they need / would suggest. Add them all to the pile and work from there. Posting this request on the forum would probably get us the most feedback.

@rkoshak
Copy link
Author

rkoshak commented Feb 25, 2025

Looking at the bindings is a good approach.

I can open a forum thread, but I'm not super optimistic how useful that will be in the long run.

I think what I am hoping for is some sort of rules that we can establish and document which describes what makes a good tag compared to a bad tag. For example, is it meaningful to have "Patio", "Porch" and "Terrace" or does it make more sense to have just one of those and use synonyms and the Item label to distinguish between these outdoor areas. Or does it make sense to add "Lenai"?

Do we need "Front Door", "Back Door" and "Side Door" or does it make more sense to have "Exterior Door" and use synonyms and Item label to distinguish between the three?

That's the sort of thing I'm hoping will come out of this issue. Of course, I have my opinions but even if my wishes are not met, I'll be overjoyed if we can have some rules in place to help maintainers decide what makes a good tag and what does not.

I'm worried that if we don't come up with those rules first, a post to the forum will just gather a ton of tags with lots of overlap. Maybe seeing what's missing based on the bindings will help inform that discussion. Maybe no one else thinks this is a big deal like I do.

@jimtng
Copy link
Contributor

jimtng commented Feb 25, 2025

I'm worried that if we don't come up with those rules first, a post to the forum will just gather a ton of tags with lots of overlap.

This is a good point.

How about, in addition to looking at what the existing bindings may need, we could also look at what Google/Alexa/Homekit currently have and draw inspiration from them?

Perhaps once we're staring at a list of possible tags, a rule / guideline may emerge?

@lolodomo wrote some sort of a rule here: openhab/openhab-addons#12262
That could be a place to start, and if anyone knows other written guides / rules let's collate them here.

@rkoshak
Copy link
Author

rkoshak commented Feb 25, 2025

That's a good idea. Though we have to be a little cautious there since their models do not exactly match ours, so the mapping may not be completely straight forward. But it certainly should show us if we have some gaps.

I'll see if I can put them into a table for comparison and post that here to make the comparison easier.

I like the rules that @lolodomo posted but those are more about how the tags are used. I'm hop[ing to come up with some rules to apply when deciding whether or not to add a new tag to the default list which is coming at it from a different angle.

@andrewfg
Copy link
Contributor

andrewfg commented Feb 25, 2025

I was looking that the Hue binding. It has two types of things. These can be "devices" (e.g. push buttons, lamps, dials, motion sensors, temperature sensors, illuminance sensors, security contacts, etc.) and "groups" (whole house, rooms, and zones). I think the current point / property tags would cover "devices" (maybe with some minor additions e.g. for the dial control). But the "groups" things are a bit different -- they do associate to "locations" (e.g. Kitchen) that would not be in the remit of the developers, but at a higher level they also associate to "group meta-type" i.e. is it a group of all lights in a room (aka "room"), or a sub group of lights either within a room or across several rooms (aka "zone"). I think such "group meta-type" would be candidates to add to the list of "equipment" semantic tags.

PS in #4617 I am working to add "equipment" semantic tags to things. And I am using the Hue binding as my test case. Since while the "point" and "property" semantic tags can be hard coded in the ChannelType xml, the "equipment" semantic tags on things will have to be set at run time in the discovery process depending on which things are found "devices" or "groups" and what device type, resp. "group meta-type" is actually found.

@rkoshak
Copy link
Author

rkoshak commented Feb 25, 2025

For viewing you can see my attempt at mapping at https://docs.google.com/spreadsheets/d/1hKb-sLqHuM_FAUtHCWCjVCjjb1mhVUT5jKfUFggERm4/edit?usp=sharing

CSV versions are below. I don't know of a tool to convert it to an MD table but you should be able to copy and import into your spreadsheet of choice.

I tried to show the tag hierarchy using spacing. I ordered the tags alphabetically for OH but then I tried to make the GA, Alexa, and Homekit tags appear on the same lines as the OH equivalent, or inserted them alphabetically.

Hopefully it makes sense but if not let me know.

Locations

Note that I took the GA locations from the Home app. If Homekit or Alexa use Locations I don't know how to find them out.

openHAB,Googel Assistant,Alexa,Homekit
Location,,,
    Indoor,,,
        Apartment,,,
        Building,,,
            Garage,Garage,,
            House,,,
            Shed,Shed,,
            SummerHouse,,,
        Corridor,Hallway,,
        Floor,,,
            Attic,Attic,,
            Basement,,,
            FirstFloor,,,
            GroundFloor																									,,,
            SecondFloor,,,
            ThirdFloor,,,
        Room																									,,,
,Back door,,
            Bathroom,Bathroom,,
            Bedroom,Bedroom,,
            BoilerRoom,,,
            Cellar,,,
,Den,,
            DiningRoom,Dining Room,,
            Entry,Entryway,,
            FamilyRoom,Family Room,,
,Front Door,,
            GuestRoom,,,
            Kitchen,Kitchen,,
            LaundryRoom,,,
            LivingRoom,,,
,Master Bedroom,,
            Office,Office,,
,Side Door,,
            Veranda,,,
    Outdoor,,,
,Backyard,,
        Carport,,,
        Driveway,,,
,Front Yard,,
        Garden,,,
        Patio,,,
        Porch,,,
        Terrace																									,,,

Equipment

I did my best to map but I'm not perfect.

openHAB,Googel Assistant,Alexa,Homekit
,,,AccessoryGroup
,,AirFreshener,
,Awning,Awning,
Equipment,,Other,
    AlarmSystem,,,
    Battery,,,Battery
    Blinds,,,
    Boiler,,,
    Camera,Camera,Camera,
    Car,,Automobile,
,,AutomobileAccessory,
,,ChristmasTree,
,Charger,,
    CleaningRobot,Vacuum,VacuumCleaner,
,Coffee_Maker,CoffeeMaker,
,,Computer,
    Door,Door,Door,Door
        BackDoor,,,
        CellarDoor,,,
        FrontDoor,,,
        GarageDoor,Garage,GarageDoor,
        Gate,Gate,,
        InnerDoor,,,
        SideDoor,,,
    Doorbell,,Doorbell,
    Fan,Fan,Fan,Fan
,,,BasicFan
        CeilingFan,,,
        KitchenHood,Hood,,
,,,Faucet
,AirPurifier,AirPurifier,Filter
,,GameConsole,
,,,GarageDoorOpener
,,Headphones,
,,Hub,
,Fireplace,,
    HVAC,,,HeaterCooler
,,AirConditioner,
    Inverter,,,
,Sprinkler,,IrrigationSystem
,,Laptop,
    LawnMower,,,
    LighttBulb,Light,Light,Lighting
        LightStripe,,,
,SpecialColorLight,,
    Lock,Lock,Lock,Lock
,,,Microphone
    NetworkAppliance,,NetworkHardware,
,,Router,
,Pergola,,
    PowerOutlet,Outlet,Outlet,Outlet
,,Printer,
    Projector,,,
    Pump,,,
    RadiatorControl,Thermostat,Thermostat,Thermostat
    Receiver,,MusicSystem,
    RemoteControl,,Remote,
    Screen,,Screen,
        Television,TV,Television,Television
,,SecurityPanel,
,SecuritySystem,SecuritySystem,SecuritySystem
,,StreamingDevice,
,Scene,,
    Sensor,Sensor,,
,,AirQualityMonitor,AirQualitySensor
,ClimateSensor,,
,HumiditySensor,,
,TemperatureSensor,,
        MotionDetector,,MotionSensor,MotionSensor
,,,OccupancySensor
        SmokeDetector,,,
    Service,,,
    Siren,,,
,,SlowCooker,
    Smartphone,,MobilePhone,
,,Phone,
    Speaker,Speaker,Speaker,Speaker
,,BluetoothSpeaker,
,,,SmartSpeaker
,,,TelevisionSpeaker
,,,StatelessProgrammableSwitch
,,Tablet,
,Switch,,
    Valve,,,Valve
    VoiceAssistant,,,
    WallSwitch,,,
    WebService,,,
        WeatherService,,,
    WhiteGood,,,
        Dishwasher,,Dishwasher,
        Dryer,,Dryer,
        Freezer,,,
,,Microwave,
        Oven,,Oven,
        Refrigerator,,,
        WashingMachine,,Washer,
,,WaterHeater,
,,Wearable,
    Window,,,Window
,Blinds,Blind,WindowCovering
,Curtain,Curtain,
,,Shade,
,Shutter,Shutter,

Points and Properties

Only GA appears to have something that seems to correspond with Points and Properties.

openHAB Points,openHAB Properties
Point,Property
    Alarm,    CO
    BatteryProperty,    CO2
    Control,    ColorTemperature
        Switch,    Current
    Measurement,    Duration
    Setpoint,    Energy
    Status,    Frequency
        LowBattery,    Gas
        OpenLevel,    Humidity
        OpenState,    Level
        Tampered,    Light
        Tilt,    Noise
,    Oil
,    Opening
,    Power
,    Presence
,    Pressure
,    Rain
,    Smoke
,    SoundVolume
,    Temperature
,    Timestamp
,    Ultraviolet
,    Vibration
,    Voltage
,    Water
,    Wind
Attribute,OH Point/Property Mapping
chargerCapacityRemaining,BatteryProperty/Level
chargerCapaciotyUntilFull,BatteryProperty/Level
chargerCharging,Status
chargerPluggedIn,Status
humidityAmbient,Measurement/Humidity
lightBrightness,Control/Light
lightColor,Control/Light
lightColorTemperature,Control/Light
securitySystemArmed,Status
securitySystemArmLevel,Status
securitySystemTrouble,Status
securitySystemTroubleCode,Status
securitySystemZone,
temperatureAmbient,Measurement/Temperature
thermostatTermperatureAmbient,Measurement/Temperature
thermostatTemperatureSetpoint,Setpoint/Temperature
thermostatTemperatureSetpointHigh,Setpoint/Temperature
thermostatTemperatureSetpointLow,Setpoint/Temperature
tvApplication,
tvChannel,
tvInput,
tvMute,Control/Noise
tvPower,Switch/Power
tvTransport,
tvVolume,Control/Noise

@andrewfg
Copy link
Contributor

andrewfg commented Feb 26, 2025

Sorry to be slightly off topic. I am doing some more work on the topic of addons providing semantic tags dynamically for ThingTypes, ChannelTypes and discovery results. And it seems to me that it would be useful if addons could access the predefined tags in the form of public static final string constants in OH core. (Rather than having the addon developer define such strings in the addon code; since that could be a source of errors). => Does anyone have any idea if this is possible?

To give an example, below is my hypothetical discovery code for the Hue thing discovery to define semantic equipment tags dynamically based on the discovered equipment. See the big switch statement in the middle of the method..

    private synchronized void discoverThings() {
        if (thingHandler.getThing().getStatus() == ThingStatus.ONLINE) {
            try {
                ThingUID bridgeUID = thingHandler.getThing().getUID();
                for (Entry<ResourceType, ThingTypeUID> entry : DISCOVERY_TYPES.entrySet()) {
                    for (Resource resource : thingHandler.getResources(new ResourceReference().setType(entry.getKey()))
                            .getResources()) {

                        MetaData metaData = resource.getMetaData();
                        if (Objects.nonNull(metaData) && (metaData.getArchetype() == Archetype.BRIDGE_V2)) {
                            // the bridge device is handled by a bridge thing handler
                            continue;
                        }

                        String resourceId = resource.getId();
                        String idv1 = resource.getIdV1();
                        String resourceType = resource.getType().toString();
                        String resourceName = resource.getName();
                        String thingId = resourceId;
                        String thingLabel = resourceName;
                        String legacyThingUID = null;

                        String semanticEquipmentTag = null;
                        switch (resource.getType()) {
                            case ADD:
                                break;
                            case AUTH_V1:
                                break;
                            case BEHAVIOR_INSTANCE:
                                break;
                            case BEHAVIOR_SCRIPT:
                                break;
                            case BRIDGE:
                                break;
                            case BRIDGE_HOME:
                                break;
                            case BUTTON:
                                break;
                            case CAMERA_MOTION:
                                break;
                            case CONTACT:
                                break;
                            case DELETE:
                                break;
                            case DEVICE:
                                semanticEquipmentTag = "Lightbulb";
                                break;
                            case DEVICE_POWER:
                                break;
                            case ENTERTAINMENT:
                                break;
                            case ENTERTAINMENT_CONFIGURATION:
                                break;
                            case ERROR:
                                break;
                            case GEOFENCE:
                                break;
                            case GEOFENCE_CLIENT:
                                break;
                            case GEOLOCATION:
                                break;
                            case GROUPED_LIGHT:
                                break;
                            case GROUPED_MOTION:
                                break;
                            case HOMEKIT:
                                break;
                            case LIGHT:
                                break;
                            case LIGHT_LEVEL:
                                break;
                            case MOTION:
                                break;
                            case PUBLIC_IMAGE:
                                break;
                            case RELATIVE_ROTARY:
                                break;
                            case ROOM:
                                semanticEquipmentTag = "Room";
                                break;
                            case SCENE:
                                break;
                            case SMART_SCENE:
                                break;
                            case TAMPER:
                                break;
                            case TEMPERATURE:
                                break;
                            case UPDATE:
                                break;
                            case ZGP_CONNECTIVITY:
                                break;
                            case ZIGBEE_CONNECTIVITY:
                                break;
                            case ZONE:
                                semanticEquipmentTag = "Zone";
                                break;
                            default:
                                break;

                        }

                        // special zone 'all lights'
                        if (resource.getType() == ResourceType.BRIDGE_HOME) {
                            thingLabel = thingHandler.getLocalizedText(ALL_LIGHTS_KEY);
                        }

                        Optional<Thing> legacyThingOptional = thingHandler.getLegacyThing(idv1);
                        if (legacyThingOptional.isPresent()) {
                            Thing legacyThing = legacyThingOptional.get();
                            legacyThingUID = legacyThing.getUID().getAsString();
                            String legacyLabel = legacyThing.getLabel();
                            thingLabel = Objects.nonNull(legacyLabel) ? legacyLabel : thingLabel;
                        }

                        DiscoveryResultBuilder builder = DiscoveryResultBuilder
                                .create(new ThingUID(entry.getValue(), bridgeUID, thingId)) //
                                .withBridge(bridgeUID) //
                                .withLabel(thingLabel) //
                                .withProperty(PROPERTY_RESOURCE_ID, resourceId)
                                .withProperty(PROPERTY_RESOURCE_TYPE, resourceType)
                                .withProperty(PROPERTY_RESOURCE_NAME, resourceName)
                                .withRepresentationProperty(PROPERTY_RESOURCE_ID);

                        if (Objects.nonNull(legacyThingUID)) {
                            builder = builder.withProperty(PROPERTY_LEGACY_THING_UID, legacyThingUID);
                        }
                        if (Objects.nonNull(semanticEquipmentTag)) {
                            builder.withSemanticEquipmentTag(semanticEquipmentTag);
                        }
                        thingDiscovered(builder.build());
                    }
                }
            } catch (ApiException | AssetNotLoadedException e) {
                logger.debug("discoverThings() bridge is offline or in a bad state");
            } catch (InterruptedException e) {
            }
        }
        stopScan();
    }

@jimtng
Copy link
Contributor

jimtng commented Feb 26, 2025

Great work, @rkoshak!

First, we need to decide the upper casing. Is it FrontYard, Frontyard? Backyard or BackYard? Bedroom is not BedRoom but LivingRoom is not Livingroom, so this thing is a bit inconsistent it seems.

@jimtng
Copy link
Contributor

jimtng commented Feb 26, 2025

And it seems to me that it would be useful if addons could access the predefined tags in the form of public static final string constants in OH core. (Rather than having the addon developer define such strings in the addon code; since that could be a source of errors)

@andrewfg Is it not possible to define the tag in the thing-type.xml?

@jimtng
Copy link
Contributor

jimtng commented Feb 26, 2025

See #4622, maybe that can come in handy?

@rkoshak
Copy link
Author

rkoshak commented Feb 26, 2025

First, we need to decide the upper casing.

The existing OH tags are pretty consistent with starting with a capital letter and using camel case thereafter. I think it would be best to stick with the convention that's already there.

And it seems to me that it would be useful if addons could access the predefined tags in the form of public static final string constants in OH core. (Rather than having the addon developer define such strings in the addon code; since that could be a source of errors). => Does anyone have any idea if this is possible?

Wouldn't it make sense to pull the tags from the API that already exists backing the REST API tags endpoint? I worry if we have these tags defined in at least three different places it will become unmaintainable.

I found a converter to make the table above easier to read here. Unfortunately the hierarchy doesn't get rendered. but hopefully you can look at the csv above and figure it out. It's pretty straight forward and as one would expect.

openHAB Googel Assistant Alexa Homekit
Location
Indoor
Apartment
Building
Garage Garage
House
Shed Shed
SummerHouse
Corridor Hallway
Floor
Attic Attic
Basement
FirstFloor
GroundFloor
SecondFloor
ThirdFloor
Room
Back door
Bathroom Bathroom
Bedroom Bedroom
BoilerRoom
Cellar
Den
DiningRoom Dining Room
Entry Entryway
FamilyRoom Family Room
Front Door
GuestRoom
Kitchen Kitchen
LaundryRoom
LivingRoom
Master Bedroom
Office Office
Side Door
Veranda
Outdoor
Backyard
Carport
Driveway
Front Yard
Garden
Patio
Porch
Terrace
openHAB Googel Assistant Alexa Homekit
AccessoryGroup
AirFreshener
Awning Awning
Equipment Other
AlarmSystem
Battery Battery
Blinds
Boiler
Camera Camera Camera
Car Automobile
AutomobileAccessory
ChristmasTree
Charger
CleaningRobot Vacuum VacuumCleaner
Coffee_Maker CoffeeMaker
Computer
Door Door Door Door
BackDoor
CellarDoor
FrontDoor
GarageDoor Garage GarageDoor
Gate Gate
InnerDoor
SideDoor
Doorbell Doorbell
Fan Fan Fan Fan
BasicFan
CeilingFan
KitchenHood Hood
Faucet
AirPurifier AirPurifier Filter
GameConsole
GarageDoorOpener
Headphones
Hub
Fireplace
HVAC HeaterCooler
AirConditioner
Inverter
Sprinkler IrrigationSystem
Laptop
LawnMower
LighttBulb Light Light Lighting
LightStripe
SpecialColorLight
Lock Lock Lock Lock
Microphone
NetworkAppliance NetworkHardware
Router
Pergola
PowerOutlet Outlet Outlet Outlet
Printer
Projector
Pump
RadiatorControl Thermostat Thermostat Thermostat
Receiver MusicSystem
RemoteControl Remote
Screen Screen
Television TV Television Television
SecurityPanel
SecuritySystem SecuritySystem SecuritySystem
StreamingDevice
Scene
Sensor Sensor
AirQualityMonitor AirQualitySensor
ClimateSensor
HumiditySensor
TemperatureSensor
MotionDetector MotionSensor MotionSensor
OccupancySensor
SmokeDetector
Service
Siren
SlowCooker
Smartphone MobilePhone
Phone
Speaker Speaker Speaker Speaker
BluetoothSpeaker
SmartSpeaker
TelevisionSpeaker
StatelessProgrammableSwitch
Tablet
Switch
Valve Valve
VoiceAssistant
WallSwitch
WebService
WeatherService
WhiteGood
Dishwasher Dishwasher
Dryer Dryer
Freezer
Microwave
Oven Oven
Refrigerator
WashingMachine Washer
WaterHeater
Wearable
Window Window
Blinds Blind WindowCovering
Curtain Curtain
Shade
Shutter Shutter
openHAB Points openHAB Properties
Point Property
Alarm CO
BatteryProperty CO2
Control ColorTemperature
Switch Current
Measurement Duration
Setpoint Energy
Status Frequency
LowBattery Gas
OpenLevel Humidity
OpenState Level
Tampered Light
Tilt Noise
Oil
Opening
Power
Presence
Pressure
Rain
Smoke
SoundVolume
Temperature
Timestamp
Ultraviolet
Vibration
Voltage
Water
Wind
Attribute OH Point/Property Mapping
chargerCapacityRemaining BatteryProperty/Level
chargerCapaciotyUntilFull BatteryProperty/Level
chargerCharging Status
chargerPluggedIn Status
humidityAmbient Measurement/Humidity
lightBrightness Control/Light
lightColor Control/Light
lightColorTemperature Control/Light
securitySystemArmed Status
securitySystemArmLevel Status
securitySystemTrouble Status
securitySystemTroubleCode Status
securitySystemZone
temperatureAmbient Measurement/Temperature
thermostatTermperatureAmbient Measurement/Temperature
thermostatTemperatureSetpoint Setpoint/Temperature
thermostatTemperatureSetpointHigh Setpoint/Temperature
thermostatTemperatureSetpointLow Setpoint/Temperature
tvApplication
tvChannel
tvInput
tvMute Control/Noise
tvPower Switch/Power
tvTransport
tvVolume Control/Noise

@andrewfg
Copy link
Contributor

Is it not possible to define the tag in the thing-type.xml?

In some cases yes it can be hard coded in the xml. But for example in the Hue binding the discovery process finds generic "device" things. Then the binding queries the "device" via API calls to establish its exact device type .. so in such cases I would return the semantic equipment tags dynamically during the discovery process rather than hard coded in the thing type xml.

@jimtng
Copy link
Contributor

jimtng commented Feb 27, 2025

Thanks for the awesome work, @rkoshak

Proposed Semantic Tag Additions

Any you'd like to remove from here?

Locations

  • Location_Outdoor_FrontYard
  • Location_Outdoor_Backyard
  • Location_Outdoor_BackPorch
  • Location_Pool (could be indoor or outdoor, determined by the semantic group membership?)
  • Location_Indoor_Room_Study
  • Location_Indoor_Room_Studio
  • Location_Indoor_Room_Theater (synonyms: Theatre / HomeTheater / HomeTheatre)
  • Location_Indoor_Closet
  • Location_Indoor_Cupboard
  • Location_Indoor_Kitchen_Pantry

Equipment

  • Equipment_Curtain
  • Equipment_WaterHeater
  • Equipment_Pump_PoolPump
  • Equipment_CoffeeMaker
  • Equipment_AirPurifier
  • Equipment_IrrigationSystem
  • Equipment_Thermostat - (retain RadiatorControl as synonym or add Equipment_Thermostat separately)
  • I think we can improve on Equipment_Lightbulb. Light Strips aren't exactly "light bulbs"
  • What is a "Light Stripe" ? Light with stripes?

For Television/Receiver/Radio

  • Property_Application
  • Property_Channel
  • Property_Mute
  • Property_Input
  • Property_PlayState

For Air conditioners, alarm system

  • Property_Mode
  • Property_Zone

For Lights

  • Property_Color
  • Property_Brightness - I've been using Level but would love to use Brightness instead

@andrewfg
Copy link
Contributor

I am wondering about Equipment_Group for things that "wrap" a group of several other equipment things. For example in Hue a group of lights, or in a security system a group of motion detectors. These are kind of virtual equipment things. Where one may typically arm or command a channel on the group thing rather than individually on the things therein.

There is also perhaps a Scene thing which is also a kind of virtual "wrapper" thing.

=>WDYT?

@jimtng
Copy link
Contributor

jimtng commented Feb 27, 2025

I am wondering about Equipment_Group for things that "wrap" a group of several other equipment things.

This is supported by the current Semantic Model. An Equipment can contain other equipments.

Or do you mean that an equipment with no other purpose but only to contain other equipments? Does this "Group" need to be in the semantic model too?

@andrewfg
Copy link
Contributor

Umm. I am not sure. I guess a group of lights is also Equipment_Light and a group of motion detectors is an Equipment_MotionDetector. If nested equipment is allowed that would also work.

@jimtng
Copy link
Contributor

jimtng commented Feb 27, 2025

Are the last part of the names supposed to be unique?

In other words, is it allowed to have Equipment_Foo and Point_Foo?

@rkoshak
Copy link
Author

rkoshak commented Feb 27, 2025

If nested equipment is allowed that would also work.

Nested Equipment is definitely allowed. I'm not sure there will be a way to handle something like that from the binding though. At least not with out more significant changes that have been proposed thus far. The binding would need to recommend not just a tag to apply to the Equipment Group but a whole hierarchy of Groups and tags to apply.

Proposed Semantic Tag Additions

This kind of helps illustrate why I think we need some rules for what makes an acceptable tag.

Do we really need both FrontYard and BackYard or would it be better to have Yard and let the name and label of the Item distinguish between front and back?

Coming up with a heuristic to evaluate what makes a good tag is what I hoped to come out of this issue. We can come up with a list here, but that isn't necessarily my main focus.

Looking at this list of potential new tags I have some questions the answer to which might lead us to some rules.

Locations

  • Is there a semantically meaningful difference between "FrontYard" and "BackYard"? What about "SideYard"? I would think it would make sense to just have "Yard". Whether it's front, back, or side is indicated by the Item name and label. I don't think we need separate tags for each iteration of "Yard". Or maybe create Location_Outdoor_Yard and put FrontYard and BackYard under that. But I would say that these last two serve illustrative purposes instead of really needing to be there.

  • Is there really a semantically meaningful difference between a "Cupboard" and a "Kitchen_Pantry"? What about "Closet", "Tool chest", "Cabinet" and other names for a "location where stuff gets stored"? Should locations be limited to actual rooms or can a piece of furniture count as a Location?

  • Is there a semantically meaning full difference between "Office", "Studio", "Study", "Workshop" and rooms like that or does it make more sense to treat this like I described Yard above? If these are the same, does "Office" (the currently existing tag) still make sense as the name for the category or should it be something more generic?

Equipment

  • This category is pretty flat. Does it make sense to add some more depth to the hierarchy? For example, Equipment_ClimateControl, Equipment_ClimateControl_HVAC, Equipment_ClimateControl_Radiator, Equipment_ClimateControl_Thermostat, etc.

  • Does it make sense to list a bunch of single point sensors as an Equipment? Or should those be Point/Properties? This is referring to tags like MotionSensor, HumiditySensor, TemperatureSensor, etc.

Points

  • What makes a good point tag? The Point is one of the main thing that controls the default widget chosen in MainUI so that needs to be one of the things that drives what makes a good Point. The current list is clearly incomplete but some of the stuff in there are questionable I think.

Properties

  • These should all be nouns. I think this category has the least need for rules. We just need to make sure that everything is a noun and it's something that would typically be something measured or controlled in a home automation context.

Proposed Rules

Given how I would answer these questions I'd recommend the following rules:

  • A Location tag should identify a category; we don't need a separate tag for every different name or variation of that Location. Kitchen can serve for both Kitchen and Kitchenette for example. Bathroom can serve for Bathroom, MasterBathroom, WaterCloset, HalfBath, etc. The name and label of the Item serves to distinguish between all of these. A proposed new tag should not be just another name for an already existing tag.

  • It is OK to add some sub-tags to a category if it serves to help inform the end user what the category tag represents and it's a commonly used name for a location/equipment/point/property. But we need to resist the urge to try to be comprehensive.

  • When the name of a tag is ambiguous in whether it can be an Equipment or a Point or Property, add what it is to the tag. For example, BatteryEquipment might represent an UPS and BatteryPoint with the Property Level might represent how much charge a battery may have. LightingEquipment would be used for lamps, light bulbs and other lighting fixtures and LightProperty would be used with Point tags like Control, Switch, and Measurement.

  • A Point tag should be what you do to or how you get the state of the Item. LowBattery, BatteryProperty (I think this might be one of my custom tags I didn't filter out), OpenState, OpenLevel, Tampered, and Tilt are poor Point tags or at least poorly named.

  • Use the hierarchy. For example, for Point tags Switch and Setpoint should be children of Control since they all represent a form of controlling something.

  • Properties should always be a noun and represent something commonly controlled or sensed in a home automation context.**

These are just my ideas and I don't want to get too long of a list of rules. But I do think we need to constrain tags some. Given these rules, the following do not make good tags:

  • Location_Outdoor_FrontYard
  • Location_Outdoor_Backyard
  • Location_Outdoor_BackPorch
  • Location_Indoor_Room_Study and Location_Indoor_Room_Studioshould be grouped with office somehow
  • Location_Indoor_Closet, Location_Indoor_Cupboard, and Location_Indoor_Kitchen_Pantry should get just a Location_Indoor_Storage tag or all fall under this more generic tag
  • Equipment_Thermostat should be grouped together with Radiator and HVAC
  • Property_Brightness is a special case of Property_Light so should go under that as Property_Light_Brightness

For the existing tags:

  • SummerHouse should be under House or removed as redundant
  • In the US at least, Basement and Cellar are regional synonyms, I'm not sure Cellar adds anything
  • A GuestRoom is a Bedroom, we don't need a separate tag for that
  • Patio, Porch, and Terrace are all essentially "outdoor rooms" and should be grouped as such
  • At most we should have ExteriorDoor, InteriorDoor and GarageDoor

New Tags I would propose (in addition to what's been already proposed):

  • Location_Indoor_Entertainment which could include under it Location_Indoor_Theater, Location_Indoor_Den, and Location_Indoor_GameRoom
  • Location_Indoor_MudRoom under Location_Indoor_Entry
  • Location_Indoor_UtilityRoom which Location_Indoor_LaundryRoom and Location_Indoor_BoilerRoom would fall
  • Equipment_NetworkDevice_Computer and Equipment_NetworkDevice_ComputerService
  • Equipment_MediaPlayer under which Equipment_Receiver, Equipment_Television, and perhaps Equipment_Speakers should go.
  • Property_VOC
  • Property_Radon
  • Property_AirQuality
  • Property_Cost
  • Property_Time
  • Property_Image
  • Property_Video

These are just off the top of my head.

Are the last part of the names supposed to be unique?

Yes, they must be unique because the last part becomes the tag that's actually applied to the Item.

@andrewfg
Copy link
Contributor

I'm not sure there will be a way to handle something like that from the binding though.

Agreed.

@andrewfg
Copy link
Contributor

Probably you need to add Equipment_Hub or Equipment_Bridge or Equipment_Gateway.

@rkoshak
Copy link
Author

rkoshak commented Feb 27, 2025

Probably you need to add Equipment_Hub or Equipment_Bridge or Equipment_Gateway.

Would these be a child of Equipment_NetworkDevice or are you thinking something else?

@andrewfg
Copy link
Contributor

I am thinking of actual OH bridges declaring themselves as such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

No branches or pull requests

3 participants