From 4b56df88a2b6447dc297984c9326b9250f1efc9d Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Tue, 23 Jul 2024 16:22:00 -0600 Subject: [PATCH] [homekit] allow linking GarageDoorOpener directly to a Rollershutter Signed-off-by: Cody Cutrer --- bundles/org.openhab.io.homekit/README.md | 454 +++++++++--------- .../homekit/internal/HomekitTaggedItem.java | 16 + .../HomekitCharacteristicFactory.java | 48 +- 3 files changed, 280 insertions(+), 238 deletions(-) diff --git a/bundles/org.openhab.io.homekit/README.md b/bundles/org.openhab.io.homekit/README.md index 88156aa0f601d..6e320cd00e6c5 100644 --- a/bundles/org.openhab.io.homekit/README.md +++ b/bundles/org.openhab.io.homekit/README.md @@ -737,233 +737,233 @@ Note that even though these characteristics can be linked to an item, they are n All accessories also support the following optional characteristic that can be linked to a Switch item: * Identify (receives `ON` command when the user wishes to identify the accessory) -| Accessory Tag | Mandatory Characteristics | Optional Characteristics | Supported openHAB item types | Description | Configuration Options | Valid Enum Values | -|-----------------------------|-----------------------------|-----------------------------|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------| -| AirQualitySensor | | | | Air Quality Sensor which can measure different parameters | | | -| | AirQuality | | Number, String, Switch | Air quality state | | UNKNOWN (0, OFF), EXCELLENT (1, ON), GOOD (2), FAIR (3), INFERIOR (4), POOR (5) | -| | | ActiveStatus | Contact, Switch | Working status | | | -| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | NitrogenDioxideDensity | Number | NO2 density in micrograms/m3, max 1000 | | | -| | | OzoneDensity | Number | Ozone density in micrograms/m3, max 1000 | | | -| | | PM10Density | Number | PM10 micrometer particulate density in micrograms/m3, max 1000 | | | -| | | PM25Density | Number | PM2.5 micrometer particulate density in micrograms/m3, max 1000 | | | -| | | SulphurDioxideDensity | Number | SO2 density in micrograms/m3, max 1000 | | | -| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | -| | | VOCDensity | Number | VOC Density in micrograms/m3, default max 1000 | minValue (0), maxValue (100), step (1) | | -| BasicFan | | | | Fan. A BasicFan is a subset of Fan, but the Home app allows you to customize the icon of the accessory to show a ceiling fan. | | | -| | OnState | | Dimmer, Switch | Accessory current working status. A value of "ON"/"OPEN" indicates that the accessory is active and is functioning without any errors. | inverted (false) | | -| | | RotationDirection | Number, Switch | Rotation direction. | inverted (false) | CLOCKWISE (0, OFF), COUNTER_CLOCKWISE (1, ON) | -| | | RotationSpeed | Dimmer, Number | Fan rotation speed in % (1-100) | | | -| Battery | | | | Accessory with battery. Battery can be chargeable (configuration chargeable:true) and non-chargeable (configuration chargeable:false) | | | -| | BatteryLevel | | Number | Battery level 0% to 100% | | | -| | BatteryChargingState | | Contact, Dimmer, Switch | Mandatory only for chargeable battery. ON/OPEN = battery is charging | | | -| | BatteryLowStatus | | Contact, Number, Switch | Battery low indicator. ON/OPEN = battery level is low; for number if the value is below the lowThreshold, then it is low. Default is 20. | inverted (false), lowThreshold (20) | | -| CarbonDioxideSensor | | | | Carbon Dioxide Sensor | | | -| | CarbonDioxideDetectedState | | Contact, Dimmer, Switch, Number, String | carbon dioxide sensor state | inverted (false) | NORMAL (0, OFF, CLOSED), ABNORMAL (1, ON, OPEN) | -| | | ActiveStatus | Contact, Switch | Working status | | | -| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | -| | | CarbonDioxideLevel | Number | Carbon dioxide level in ppm, max 100000 | | | -| | | CarbonDioxidePeakLevel | Number | highest detected level (ppm) of carbon dioxide detected by a sensor, max 100000 | | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | -| CarbonMonoxideSensor | | | | Carbon monoxide Sensor | | | -| | CarbonMonoxideDetectedState | | Contact, Dimmer, Switch, Number, String | Carbon monoxide sensor state | inverted (false) | NORMAL (0, OFF, CLOSED), ABNORMAL (1, ON, OPEN) | -| | | ActiveStatus | Contact, Switch | Working status | | | -| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | -| | | CarbonMonoxideLevel | Number | Carbon monoxide level in ppm, max 100 | | | -| | | CarbonMonoxidePeakLevel | Number | highest detected level (ppm) of carbon monoxide detected by a sensor, max 100 | | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | -| ContactSensor | | | | Contact Sensor, An accessory with on/off state that can be viewed in HomeKit but not changed such as a contact sensor for a door or window | | | -| | ContactSensorState | | Contact, Dimmer, Number, String, Switch | Contact sensor state | inverted (false) | DETECTED (0, OFF, CLOSED), NOT_DETECTED (1, ON, OPEN) | -| | | ActiveStatus | Contact, Switch | Working status | | | -| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | -| Door | | | | Motorized door. One Rollershutter item covers all mandatory characteristics. see examples below. | | | -| | CurrentPosition | | Dimmer, Number, Rollershutter | Current position of motorized door | | | -| | PositionState | | Number, Rollershutter, String | Position state. If no state is provided, "STOPPED" is used. | | DECREASING (0), INCREASING (1), STOPPED (2) | -| | TargetPosition | | Dimmer, Number, Rollershutter | Target position of motorized door | | | -| | | HoldPosition | Rollershutter, Switch | Motorized door should stop at its current position. ON is sent to Switch items. STOP is sent to Rollershutter items. Only supported by 3rd party Home apps (such as Elgato Eve) | | | -| | | ObstructionStatus | Contact, Dimmer, Switch | Current status of obstruction sensor. ON-obstruction detected, OFF - no obstruction | | | -| Fan | | | | Fan | | | -| | ActiveStatus | | Dimmer, Switch | Accessory current working status. A value of "ON"/"OPEN" indicates that the accessory is active and is functioning without any errors. | | | -| | | CurrentFanState | Number, String | Current fan state. | | INACTIVE (0), IDLE (1), BLOWING_AIR (2) | -| | | LockControl | Number, Switch, String | Status of physical control lock | inverted (false) | CONTROL_LOCK_DISABLED (0, OFF), CONTROL_LOCK_ENABLED (1, ON) | -| | | RotationDirection | Number, Switch, String | Rotation direction | inverted (false) | CLOCKWISE (0, OFF), COUNTER_CLOCKWISE (1, ON) | -| | | RotationSpeed | Dimmer, Number | Fan rotation speed in % (1-100) | | | -| | | SwingMode | Number, Switch, String | Swing mode | inverted (false) | SWING_DISABLED (0, OFF), SWING_ENABLED (1, ON) | -| | | TargetFanState | Number, Switch, String | Target fan state | inverted (false) | MANUAL (0, OFF), AUTO (1, ON) | -| Faucet | | | | Faucet or shower. It should be used in combination with Valve or/and HeaterCooler. | | | -| | Active | | Contact, Dimmer, Switch | Accessory current working status | inverted (false) | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| Filter | | | | Accessory with filter maintenance indicator | | | -| | FilterChangeIndication | | Contact, Dimmer, Number, String, Switch | Filter change indicator | inverted (false) | NO_CHANGED_NEEDED (0, OFF, CLOSED), CHANGE_NEEDED (1, ON, OPEN) | -| | | FilterLifeLevel | Number | Current filter life level. 0% to 100% | | | -| | | FilterResetIndication | Switch | Send "filter reset" action triggered by user in iOS Home app to openHAB ("ON" = reset requested by user). | | | -| GarageDoorOpener | | | | A garage door opener. | | | -| | CurrentDoorState | | Contact, Switch, Number, String | Current door state. | inverted (false) | OPEN (0, ON, OPEN), CLOSED (1, OFF, CLOSED), OPENING (2), CLOSING (3), STOPPED (4) | -| | TargetDoorState | | Contact, Switch, Number, String | Target door state. | inverted (false) | OPEN (0, ON, OPEN), CLOSED (1, OFF, CLOSED) | -| | | LockCurrentState | Contact, Number, String, Switch | Current state of lock mechanism | inverted (false) | UNSECURED (0, OFF, CLOSED), SECURED (1, ON, OPEN), JAMMED (2), UNKNOWN (3) | -| | | LockTargetState | Number, String, Switch | Target state of lock mechanism | inverted (false) | UNSECURED (0, OFF), SECURED (1, ON) | -| | | ObstructionStatus | Contact, Switch | Current status of obstruction sensor. ON-obstruction detected, OFF - no obstruction | inverted (false) | | -| HeaterCooler | | | | Heater or/and cooler device | | | -| | ActiveStatus | | Dimmer, Switch | Accessory current working status. A value of "ON"/"OPEN" indicates that the accessory is active and is functioning without any errors. | | | -| | CurrentHeaterCoolerState | | Number, String | Current heater/cooler mode. | | INACTIVE (0), IDLE (1), HEATING (2), COOLING (3) | -| | CurrentTemperature | | Number | Current temperature | minValue (0), maxValue (100), step (0.1) | | -| | TargetHeaterCoolerState | | Number, String | Target heater/cooler mode. | | AUTO (0, OFF), HEAT (1, ON), COOL (2) [*](#customizable-enum) | -| | | CoolingThresholdTemperature | Number | Maximum temperature that must be reached before cooling is turned on | minValue (10), maxValue (35), step (0.1) | | -| | | HeatingThresholdTemperature | Number | Minimum temperature that must be reached before heating is turned on | minValue (0), maxValue (25), step (0.1) | | -| | | LockControl | Number, Switch, String | Status of physical control lock | inverted (false) | CONTROL_LOCK_DISABLED (0, OFF), CONTROL_LOCK_ENABLED (1, ON) | -| | | RotationSpeed | Number | Fan rotation speed in % (1-100) | | | -| | | SwingMode | Number, Switch, String | Swing mode | inverted (false) | SWING_DISABLED (0, OFF), SWING_ENABLED (1, ON) | -| HumiditySensor | | | | Relative Humidity Sensor providing read-only values | | | -| | RelativeHumidity | | Number | Relative humidity in % between 0 and 100 | homekitMultiplicator = {number to multiply result with} | | -| | | ActiveStatus | Contact, Switch | Working status | | | -| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | -| InputSource | | | | Input source linked service. Can only be used with Television. | | | -| | | ConfiguredName | String | Name of the input source configured in the iOS Home app. User can rename the source in iOS Home app and this characteristic can be used to reflect change in openHAB and sync name changes from openHAB to Home app. | | | -| | | Configured | Contact, Dimmer, Switch | If the source is configured on the device. Non-configured inputs will not show up in the Home app. - ON/OPEN = show, OFF/CLOSED = hide. Default is ON. Can also be configured via metadata, e.g. [Configured=true] | | | -| | | CurrentVisibility | Contact, Dimmer, Number, String, Switch | If the source has been hidden by the user. Can also be configured via metadata, e.g. [CurrentVisibility=false] | inverted (false) | SHOWN (0, ON), HIDDEN (1, OFF) | -| | | Identifier | Number | The identifier of the source, to be used with the ActiveIdentifier characteristic. Can also be configured via metadata, e.g. [Identifier=1] | | | -| | | InputDeviceType | String | Type of the input device. possible values (OTHER, TV, RECORDING, TUNER, PLAYBACK, AUDIO_SYSTEM). Custom mapping can be defined at item level. Can also be configured via metadata, e.g. [InputDeviceType="OTHER"]. | | | -| | | InputSourceType | String | Type of the input source. possible values (OTHER, HOME_SCREEN, TUNER, HDMI, COMPOSITE_VIDEO, S_VIDEO, COMPONENT_VIDEO, DVI, AIRPLAY, USB, APPLICATION). Custom mapping can be defined at item level. Can also be configured via metadata, e.g. [InputSourceType="OTHER"]. | | | -| | | TargetVisibilityState | Switch, Number, String | The desired visibility state of the input source. | inverted (false) | SHOWN (0, ON), HIDDEN (1, OFF) | -| IrrigationSystem | | | | An accessory that represents multiple water valves and accommodates a programmed scheduled. | | | -| | Active | | Contact, Dimmer, Number, String, Switch | If the irrigation system as a whole is enabled. This must be ON if any of the valves are also enabled. | inverted (false) | INACTIVE (0, OFF), ACTIVE (1, ON) | -| | InUseStatus | | Contact, Dimmer, Number, String, Switch | If the irrigation system as a whole is running. This must be ON if any of the valves are ON. | inverted (false) | NOT_IN_USE (0, OFF, CLOSED), IN_USE (1, ON, OPEN) | -| | ProgramMode | | String | The current program mode of the irrigation system. Possible values (NO_SCHEDULED - no programs scheduled, SCHEDULED - program scheduled, SCHEDULED_MANUAL - program scheduled, currently overriden to manual mode). | | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | RemainingDuration | Number | The remaining duration for all scheduled valves in the current program in seconds. | | | -| LeakSensor | | | | Leak Sensor | | | -| | LeakDetectedState | | Contact, Dimmer, Number, String, Switch | Leak sensor state | inverted (false) | LEAK_NOT_DETECTED (0, OFF, CLOSED), LEAK_DETECTED (1, ON, OPEN) | -| | | ActiveStatus | Contact, Switch | Working status | | | -| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | -| LightSensor | | | | Light sensor | | | -| | LightLevel | | Number | Light level in lux | minValue (0.0001), maxValue (100000) | | -| | | ActiveStatus | Contact, Switch | Working status | | | -| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | -| Lighting | | | | A lightbulb, can have further optional parameters for brightness, hue, etc | | | -| | OnState | | Switch | State of the light - ON/OFF | | | -| | | Brightness | Dimmer, Color | Brightness in % (1-100). See "Usage of dimmer modes" for configuration details. | | | -| | | ColorTemperature | Dimmer, Number | Color temperature. If the item is a Number with no units, it is represented in mireds. The default value range is from 50 to 400 (2500 K to 20,000 K). If the item is a Dimmer, it will be transformed linearly to mireds. Color temperature should not be used in combination with hue, saturation and brightness. | minValue (50), maxValue (400), inverted | | -| | | Hue | Dimmer, Color | Hue | | | -| | | Saturation | Dimmer, Color | Saturation in % (1-100) | | | -| Lock | | | | A Lock Mechanism | inverted (false) | | -| | LockCurrentState | | Contact, Number, String, Switch | Current state of lock mechanism | inverted (false) | UNSECURED (0, OFF, CLOSED), SECURED (1, ON, OPEN), JAMMED (2), UNKNOWN (3) | -| | LockTargetState | | Number, String, Switch | Target state of lock mechanism | inverted (false) | UNSECURED (0, OFF), SECURED (1, ON) | -| Microphone | | | | Microphone accessory | | | -| | Mute | | Contact, Dimmer, Switch | Mute indication. ON/OPEN = microphone is muted | inverted (false) | | -| | | Volume | Number | Microphone volume from 0% to 100% | | | -| MotionSensor | | | | Motion Sensor | | | -| | MotionDetectedState | | Contact, Dimmer, Switch | Motion sensor state (ON=motion detected, OFF=no motion) | inverted (false) | | -| | | ActiveStatus | Contact, Switch | Working status | | | -| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | -| OccupancySensor | | | | Occupancy Sensor | | | -| | OccupancyDetectedState | | Contact, Dimmer, Number, String, Switch | Occupancy sensor state | inverted (false) | NOT_DETECTED (0, OFF, CLOSED), DETECTED (1, ON, OPEN) | -| | | ActiveStatus | Contact, Switch | Working status | | | -| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | -| Outlet | | | | An accessory that can be turned off and on. While similar to a lightbulb, this will be presented differently in the Siri grammar and iOS apps | | | -| | InUseStatus | | Contact, Dimmer, Switch | Indicates whether the outlet has an appliance e.g., a floor lamp, physically plugged in. This characteristic is set to True even if the plugged-in appliance is off. | inverted (false) | | -| | OnState | | Dimmer, Switch | State of the outlet - ON/OFF | | | -| SecuritySystem | | | | Security system. | | | -| | CurrentSecuritySystemState | | Number, String | Current state of the security system | | STAY_ARM (0), AWAY_ARM (1), NIGHT_ARM (2), DISARMED (3), TRIGGERED (4) | -| | TargetSecuritySystemState | | Number, String | Requested state of the security system. While the requested state is not DISARM, and the current state is DISARMED, HomeKit will display "Arming...", for example during an exit delay. | | STAY_ARM (0), AWAY_ARM (1), NIGHT_ARM (2), DISARM (3) [*](#customizable-enum) | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | -| Slat | | | | Slat which tilts on a vertical or a horizontal axis. Configuration "type:horizontal" or "type:vertical" | | | -| | CurrentSlatState | | Number, String | Current slat state. | | FIXED (0), JAMMED (1), SWINGING (2) | -| | | CurrentTiltAngle | Dimmer, Number | Number Item = current angle of slats. values -90 to 90. A value of 0 indicates that the slats are rotated to a fully open position. Dimmer Item = the percentage of openness (0%-100%) | | | -| | | SwingMode | Number, Switch, String | Swing mode | inverted (false) | SWING_DISABLED (0, OFF), SWING_ENABLED (1, ON) | -| | | TargetTiltAngle | Dimmer, Number | Number Item = target angle of slats (-90 to +90). Dimmer Item = the percentage of openness (0%-100%) | | | -| SmartSpeaker | | | | Smart speaker accessory with Play/Stop/Pause control | | | -| | CurrentMediaState | | Number, String | Current smart speaker state | | PLAY (0), PAUSE (1), STOP (2), UNKNOWN (3) | -| | TargetMediaState | | Number, String | Target smart speaker state | | PLAY (0), PAUSE (1), STOP (2) | -| | | ConfiguredName | String | Name of the speaker accessory configured in iOS Home app. User can rename the speaker in iOS Home app and this characteristic can be used to reflect change in openHAB and sync name changes from openHAB to Home app. | | | -| | | Mute | Contact, Switch | Mute indication. ON/OPEN = speaker is muted | inverted (false) | | -| | | Volume | Number | Speaker volume from 0% to 100% | | | -| SmokeSensor | | | | Smoke Sensor | | | -| | SmokeDetectedState | | Contact, Dimmer, Number, String, Switch | Smoke sensor state | inverted (false) | NOT_DETECTED (0, OFF, CLOSED), DETECTED (1, ON, OPEN) | -| | | ActiveStatus | Contact, Switch | Working status | | | -| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | -| Speaker | | | | Speaker accessory | | | -| | Mute | | Contact, Dimmer, Switch | Mute indication. ON/OPEN = speaker is muted | inverted (false) | | -| | | Active | Contact, Dimmer, Number, String, Switch | Accessory current working status | inverted (false) | INACTIVE (0, OFF), ACTIVE (1, ON) | -| | | Volume | Number | Speaker volume from 0% to 100% | | | -| StatelessProgrammableSwitch | | | | A stateless programmable switch is a button or scene controller that simply sends an event to Home when it is pressed, allowing automations to occur. See [Stateless Programmable Switch Groups](#Stateless-Programmable-Switch-Groups) for configuring multiple in one accessory. | | | -| | ProgrammableSwitchEvent | | Contact, Number, String, Switch | The button press event. Note that the event will be forwarded to Home for every _update_ of the item, not just on change. | inverted (false) | SINGLE_PRESS (0, ON, OPEN), DOUBLE_PRESS (1), LONG_PRESS (2) [*](#customizable-enum) | -| | | Volume | Number | Speaker volume from 0% to 100% | | | -| Switchable | | | | An accessory that can be turned off and on. While similar to a lightbulb, this will be presented differently in the Siri grammar and iOS apps | | | -| | OnState | | Dimmer, Switch | State of the switch - ON/OFF | | | -| Television | | | | Television accessory with inputs | | | -| | Active | | Contact, Dimmer, Number, String, Switch | State of the television (on/off) | inverted (false) | INACTIVE (0, OFF), ACTIVE (1, ON) | -| | | ActiveIdentifier | Number | The input that is currently active (based on its identifier). Can also be configured via metadata, e.g. [ActiveIdentifier=1] | | | -| | | Brightness | Dimmer | Screen brightness in % (1-100). | | | -| | | ClosedCaptions | Contact, Dimmer, Number, String, Switch | Indicates closed captions are enabled. Can also be configured via metadata, e.g. [ClosedCaptions=true] | inverted (false) | DISABLED (0, OFF), ENABLED (1, ON) | -| | | ConfiguredName | String | Name of the television accessory configured in the iOS Home app. User can rename the television in iOS Home app and this characteristic can be used to reflect change in openHAB and sync name changes from openHAB to Home app. | | | -| | | CurrentMediaState | Number, String | Current television state. | | PLAY (0), PAUSE (1), STOP (2), UNKNOWN (3) | -| | | PictureMode | Number, String | Selected picture mode. | | OTHER (0), STANDARD (1), CALIBRATED (2), CALIBRATED_DARK (3), VIVID (4), GAME (5), COMPUTER (6), CUSTOM (7) | -| | | PowerMode | Switch, Number, String | This oddly named characteristic will receive an ON command when the user requests to open the TV's menu. | inverted (false) | SHOW (0, ON), HIDE (1, OFF) | -| | | RemoteKey | String | Receives a keypress event. | | | -| | | SleepDiscoveryMode | Contact, Dimmer, Number, String, Switch | Indicates if the television is discoverable while in standby mode. Can also be configured via metadata, e.g. [SleepDiscoveryMode=true] | inverted (false) | NOT_DISCOVERABLE (0, OFF), ALWAYS_DISCOVERABLE (1, ON) | -| | | TargetMediaState | Number, String | Target television state. | | PLAY (0), PAUSE (1), STOP (2) | -| TelevisionSpeaker | | | | An accessory that can be added to a Television in order to control the speaker associated with it. | | | -| | Mute | | Switch | If the television is muted. ON = muted, OFF = not muted. | | | -| | | Active | Contact, Dimmer, Number, String, Switch | Unknown. This characteristic is undocumented by Apple, but is still available. | inverted (false) | INACTIVE (0, OFF), ACTIVE (1, ON) | -| | | Volume | Dimmer, Number | Current volume. | | | -| | | VolumeControlType | String | The type of control available. This will default to infer based on what other items are linked. NONE = status only, no control; RELATIVE = INCREMENT/DECREMENT only, no status; RELATIVE_WITH_CURRENT = INCREMENT/DECREMENT only with status; ABSOLUTE = direct status and control. Can also be configured via metadata, e.g. [VolumeControlType="ABSOLUTE"]. | | | -| | | VolumeSelector | Dimmer, String | If linked to a dimmer item, will send INCREASE/DECREASE commands. If linked to a string item, will send INCREMENT and DECREMENT. | | | -| TemperatureSensor | | | | Temperature sensor | | | -| | CurrentTemperature | | Number | current temperature | minValue (0), maxValue (100), step (0.1) | | -| | | ActiveStatus | Contact, Switch | Working status | | | -| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | -| Thermostat | | | | A thermostat requires at least one of TargetTemperature, CoolingThresholdTemperature, or HeatingThresholdTemperature must be provided. | | | -| | CurrentHeatingCoolingMode | | Number, String, Switch | Current heating cooling mode | | OFF (0, OFF), HEAT (1, ON), COOL (2) | -| | CurrentTemperature | | Number | Current temperature. | minValue (0), maxValue (100), step (0.1) | | -| | TargetHeatingCoolingMode | | Number, String, Switch | Target heating cooling mode | | OFF (0, OFF), HEAT (1, ON), COOL (2), AUTO (3) [*](#customizable-enum) | -| | | TargetTemperature | Number | Target temperature. If CoolingThresholdTemperature and HeatingThresholdTemperature are also provided, this characteristic is used when the thermostat is in HEAT or COOL mode. In AUTO mode, this characteristic receives the average of the two thresholds. | minValue (10), maxValue (38), step (0.1) | | -| | | CoolingThresholdTemperature | Number | Maximum temperature that must be reached before cooling is turned on. If TargetTemperature is not provided, this characteristic will also be used in COOL mode. | minValue (10), maxValue (35), step (0.1) | | -| | | HeatingThresholdTemperature | Number | Minimum temperature that must be reached before heating is turned on. If TargetTemperature is not provided, this characteristic will also be used in HEAT mode. | minValue (0), maxValue (25), step (0.1) | | -| | | RelativeHumidity | Number | Relative humidity in % between 0 and 100. | | | -| | | TargetRelativeHumidity | Number | Target relative humidity in % between 0 and 100. | | | -| | | TemperatureUnit | Number, String, Switch | The units the accessory itself uses to display the temperature. Can also be configured via metadata, e.g. [TemperatureUnit="CELSIUS"] | | CELSIUS (0, OFF), FAHRENHEIT (1, ON) | -| Valve | | | | Valve | ValveType = ["Generic", "Irrigation", "Shower", "Faucet"] ("Generic") | | -| | ActiveStatus | | Dimmer, Switch | Accessory current working status. A value of "ON"/"OPEN" indicates that the accessory is active and is functioning without any errors. | | | -| | InUseStatus | | Contact, Dimmer, Switch | Indicates whether fluid flowing through the valve. A value of "ON"/"OPEN" indicates that fluid is flowing. | inverted (false) | | -| | | Duration | Number | Defines how long a valve should be set to ʼIn Useʼ in second. | homekitDefaultDuration = {default duration in seconds} | | -| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | -| | | RemainingDuration | Number | Describes the remaining duration on the accessory. the remaining duration increases/decreases from the accessoryʼs usual countdown. i.e. changes from 90 to 80 in a second. | | | -| Window | | | | Motorized window. One Rollershutter item covers all mandatory characteristics. see examples below. | | | -| | CurrentPosition | | Dimmer, Number, Rollershutter | Current position of motorized window | | | -| | PositionState | | Number, Rollershutter, String | Position state. If no state is provided, "STOPPED" is used. | | DECREASING (0), INCREASING (1), STOPPED (2) | -| | TargetPosition | | Dimmer, Number, Rollershutter | Target position of motorized window | | | -| | | HoldPosition | Rollershutter, Switch | Motorized door should stop at its current position. ON is sent to Switch items. STOP is sent to Rollershutter items. Only supported by 3rd party Home apps (such as Elgato Eve) | | | -| | | ObstructionStatus | Contact, Dimmer, Switch | Current status of obstruction sensor. ON-obstruction detected, OFF - no obstruction | | | -| WindowCovering | | | | Window covering / blinds. One Rollershutter item covers all mandatory characteristics. see examples below. | | | -| | CurrentPosition | | Dimmer, Number, Rollershutter | Current position of window covering | | | -| | PositionState | | Number, Rollershutter, String | Position state. If no state is provided, "STOPPED" is used. | | DECREASING (0), INCREASING (1), STOPPED (2) | -| | TargetPosition | | Dimmer, Number, Rollershutter | Target position of window covering | | | -| | | CurrentHorizontalTiltAngle | Dimmer, Number | Number Item = current angle of horizontal slats. values -90 to 90. A value of 0 indicates that the slats are rotated to a fully open position. A value of -90 indicates that the slats are rotated all the way in a direction where the user-facing edge is higher than the window-facing edge. Dimmer Item = the percentage of openness (0%-100%) | | | -| | | CurrentVerticalTiltAngle | Dimmer, Number | Number Item = current angle of vertical slats (-90 to +90) . Dimmer Item = the percentage of openness (0%-100%) | | | -| | | HoldPosition | Rollershutter, Switch | Motorized door should stop at its current position. ON is sent to Switch items. STOP is sent to Rollershutter items. Only supported by 3rd party Home apps (such as Elgato Eve) | | | -| | | ObstructionStatus | Contact, Dimmer, Switch | Current status of obstruction sensor. ON-obstruction detected, OFF - no obstruction | | | -| | | TargetHorizontalTiltAngle | Dimmer, Number | Number Item = target angle of horizontal slats (-90 to +90). Dimmer Item = the percentage of openness (0%-100%) | | | -| | | TargetVerticalTiltAngle | Dimmer, Number | Number Item = target angle of vertical slats. Dimmer Item = the percentage of openness (0%-100%) | | | +| Accessory Tag | Mandatory Characteristics | Optional Characteristics | Supported openHAB item types | Description | Configuration Options | Valid Enum Values | +|-----------------------------|-----------------------------|-----------------------------|------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------| +| AirQualitySensor | | | | Air Quality Sensor which can measure different parameters | | | +| | AirQuality | | Number, String, Switch | Air quality state | | UNKNOWN (0, OFF), EXCELLENT (1, ON), GOOD (2), FAIR (3), INFERIOR (4), POOR (5) | +| | | ActiveStatus | Contact, Switch | Working status | | | +| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | NitrogenDioxideDensity | Number | NO2 density in micrograms/m3, max 1000 | | | +| | | OzoneDensity | Number | Ozone density in micrograms/m3, max 1000 | | | +| | | PM10Density | Number | PM10 micrometer particulate density in micrograms/m3, max 1000 | | | +| | | PM25Density | Number | PM2.5 micrometer particulate density in micrograms/m3, max 1000 | | | +| | | SulphurDioxideDensity | Number | SO2 density in micrograms/m3, max 1000 | | | +| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | +| | | VOCDensity | Number | VOC Density in micrograms/m3, default max 1000 | minValue (0), maxValue (100), step (1) | | +| BasicFan | | | | Fan. A BasicFan is a subset of Fan, but the Home app allows you to customize the icon of the accessory to show a ceiling fan. | | | +| | OnState | | Dimmer, Switch | Accessory current working status. A value of "ON"/"OPEN" indicates that the accessory is active and is functioning without any errors. | inverted (false) | | +| | | RotationDirection | Number, Switch | Rotation direction. | inverted (false) | CLOCKWISE (0, OFF), COUNTER_CLOCKWISE (1, ON) | +| | | RotationSpeed | Dimmer, Number | Fan rotation speed in % (1-100) | | | +| Battery | | | | Accessory with battery. Battery can be chargeable (configuration chargeable:true) and non-chargeable (configuration chargeable:false) | | | +| | BatteryLevel | | Number | Battery level 0% to 100% | | | +| | BatteryChargingState | | Contact, Dimmer, Switch | Mandatory only for chargeable battery. ON/OPEN = battery is charging | | | +| | BatteryLowStatus | | Contact, Number, Switch | Battery low indicator. ON/OPEN = battery level is low; for number if the value is below the lowThreshold, then it is low. Default is 20. | inverted (false), lowThreshold (20) | | +| CarbonDioxideSensor | | | | Carbon Dioxide Sensor | | | +| | CarbonDioxideDetectedState | | Contact, Dimmer, Switch, Number, String | carbon dioxide sensor state | inverted (false) | NORMAL (0, OFF, CLOSED), ABNORMAL (1, ON, OPEN) | +| | | ActiveStatus | Contact, Switch | Working status | | | +| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | +| | | CarbonDioxideLevel | Number | Carbon dioxide level in ppm, max 100000 | | | +| | | CarbonDioxidePeakLevel | Number | highest detected level (ppm) of carbon dioxide detected by a sensor, max 100000 | | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | +| CarbonMonoxideSensor | | | | Carbon monoxide Sensor | | | +| | CarbonMonoxideDetectedState | | Contact, Dimmer, Switch, Number, String | Carbon monoxide sensor state | inverted (false) | NORMAL (0, OFF, CLOSED), ABNORMAL (1, ON, OPEN) | +| | | ActiveStatus | Contact, Switch | Working status | | | +| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | +| | | CarbonMonoxideLevel | Number | Carbon monoxide level in ppm, max 100 | | | +| | | CarbonMonoxidePeakLevel | Number | highest detected level (ppm) of carbon monoxide detected by a sensor, max 100 | | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | +| ContactSensor | | | | Contact Sensor, An accessory with on/off state that can be viewed in HomeKit but not changed such as a contact sensor for a door or window | | | +| | ContactSensorState | | Contact, Dimmer, Number, String, Switch | Contact sensor state | inverted (false) | DETECTED (0, OFF, CLOSED), NOT_DETECTED (1, ON, OPEN) | +| | | ActiveStatus | Contact, Switch | Working status | | | +| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | +| Door | | | | Motorized door. One Rollershutter item covers all mandatory characteristics. see examples below. | | | +| | CurrentPosition | | Dimmer, Number, Rollershutter | Current position of motorized door | | | +| | PositionState | | Number, Rollershutter, String | Position state. If no state is provided, "STOPPED" is used. | | DECREASING (0), INCREASING (1), STOPPED (2) | +| | TargetPosition | | Dimmer, Number, Rollershutter | Target position of motorized door | | | +| | | HoldPosition | Rollershutter, Switch | Motorized door should stop at its current position. ON is sent to Switch items. STOP is sent to Rollershutter items. Only supported by 3rd party Home apps (such as Elgato Eve) | | | +| | | ObstructionStatus | Contact, Dimmer, Switch | Current status of obstruction sensor. ON-obstruction detected, OFF - no obstruction | | | +| Fan | | | | Fan | | | +| | ActiveStatus | | Dimmer, Switch | Accessory current working status. A value of "ON"/"OPEN" indicates that the accessory is active and is functioning without any errors. | | | +| | | CurrentFanState | Number, String | Current fan state. | | INACTIVE (0), IDLE (1), BLOWING_AIR (2) | +| | | LockControl | Number, Switch, String | Status of physical control lock | inverted (false) | CONTROL_LOCK_DISABLED (0, OFF), CONTROL_LOCK_ENABLED (1, ON) | +| | | RotationDirection | Number, Switch, String | Rotation direction | inverted (false) | CLOCKWISE (0, OFF), COUNTER_CLOCKWISE (1, ON) | +| | | RotationSpeed | Dimmer, Number | Fan rotation speed in % (1-100) | | | +| | | SwingMode | Number, Switch, String | Swing mode | inverted (false) | SWING_DISABLED (0, OFF), SWING_ENABLED (1, ON) | +| | | TargetFanState | Number, Switch, String | Target fan state | inverted (false) | MANUAL (0, OFF), AUTO (1, ON) | +| Faucet | | | | Faucet or shower. It should be used in combination with Valve or/and HeaterCooler. | | | +| | Active | | Contact, Dimmer, Switch | Accessory current working status | inverted (false) | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| Filter | | | | Accessory with filter maintenance indicator | | | +| | FilterChangeIndication | | Contact, Dimmer, Number, String, Switch | Filter change indicator | inverted (false) | NO_CHANGED_NEEDED (0, OFF, CLOSED), CHANGE_NEEDED (1, ON, OPEN) | +| | | FilterLifeLevel | Number | Current filter life level. 0% to 100% | | | +| | | FilterResetIndication | Switch | Send "filter reset" action triggered by user in iOS Home app to openHAB ("ON" = reset requested by user). | | | +| GarageDoorOpener | | | | A garage door opener. | | | +| | CurrentDoorState | | Contact, Number, Rollershutter, String, Switch | Current door state. | inverted (false) | OPEN (0, ON, OPEN), CLOSED (1, OFF, CLOSED), OPENING (2), CLOSING (3), STOPPED (4) | +| | TargetDoorState | | Contact, Number, Rollershutter, String, Switch | Target door state. | inverted (false) | OPEN (0, ON, OPEN), CLOSED (1, OFF, CLOSED) | +| | | LockCurrentState | Contact, Number, String, Switch | Current state of lock mechanism | inverted (false) | UNSECURED (0, OFF, CLOSED), SECURED (1, ON, OPEN), JAMMED (2), UNKNOWN (3) | +| | | LockTargetState | Number, String, Switch | Target state of lock mechanism | inverted (false) | UNSECURED (0, OFF), SECURED (1, ON) | +| | | ObstructionStatus | Contact, Switch | Current status of obstruction sensor. ON-obstruction detected, OFF - no obstruction | inverted (false) | | +| HeaterCooler | | | | Heater or/and cooler device | | | +| | ActiveStatus | | Dimmer, Switch | Accessory current working status. A value of "ON"/"OPEN" indicates that the accessory is active and is functioning without any errors. | | | +| | CurrentHeaterCoolerState | | Number, String | Current heater/cooler mode. | | INACTIVE (0), IDLE (1), HEATING (2), COOLING (3) | +| | CurrentTemperature | | Number | Current temperature | minValue (0), maxValue (100), step (0.1) | | +| | TargetHeaterCoolerState | | Number, String | Target heater/cooler mode. | | AUTO (0, OFF), HEAT (1, ON), COOL (2) [*](#customizable-enum) | +| | | CoolingThresholdTemperature | Number | Maximum temperature that must be reached before cooling is turned on | minValue (10), maxValue (35), step (0.1) | | +| | | HeatingThresholdTemperature | Number | Minimum temperature that must be reached before heating is turned on | minValue (0), maxValue (25), step (0.1) | | +| | | LockControl | Number, Switch, String | Status of physical control lock | inverted (false) | CONTROL_LOCK_DISABLED (0, OFF), CONTROL_LOCK_ENABLED (1, ON) | +| | | RotationSpeed | Number | Fan rotation speed in % (1-100) | | | +| | | SwingMode | Number, Switch, String | Swing mode | inverted (false) | SWING_DISABLED (0, OFF), SWING_ENABLED (1, ON) | +| HumiditySensor | | | | Relative Humidity Sensor providing read-only values | | | +| | RelativeHumidity | | Number | Relative humidity in % between 0 and 100 | homekitMultiplicator = {number to multiply result with} | | +| | | ActiveStatus | Contact, Switch | Working status | | | +| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | +| InputSource | | | | Input source linked service. Can only be used with Television. | | | +| | | ConfiguredName | String | Name of the input source configured in the iOS Home app. User can rename the source in iOS Home app and this characteristic can be used to reflect change in openHAB and sync name changes from openHAB to Home app. | | | +| | | Configured | Contact, Dimmer, Switch | If the source is configured on the device. Non-configured inputs will not show up in the Home app. - ON/OPEN = show, OFF/CLOSED = hide. Default is ON. Can also be configured via metadata, e.g. [Configured=true] | | | +| | | CurrentVisibility | Contact, Dimmer, Number, String, Switch | If the source has been hidden by the user. Can also be configured via metadata, e.g. [CurrentVisibility=false] | inverted (false) | SHOWN (0, ON), HIDDEN (1, OFF) | +| | | Identifier | Number | The identifier of the source, to be used with the ActiveIdentifier characteristic. Can also be configured via metadata, e.g. [Identifier=1] | | | +| | | InputDeviceType | String | Type of the input device. possible values (OTHER, TV, RECORDING, TUNER, PLAYBACK, AUDIO_SYSTEM). Custom mapping can be defined at item level. Can also be configured via metadata, e.g. [InputDeviceType="OTHER"]. | | | +| | | InputSourceType | String | Type of the input source. possible values (OTHER, HOME_SCREEN, TUNER, HDMI, COMPOSITE_VIDEO, S_VIDEO, COMPONENT_VIDEO, DVI, AIRPLAY, USB, APPLICATION). Custom mapping can be defined at item level. Can also be configured via metadata, e.g. [InputSourceType="OTHER"]. | | | +| | | TargetVisibilityState | Switch, Number, String | The desired visibility state of the input source. | inverted (false) | SHOWN (0, ON), HIDDEN (1, OFF) | +| IrrigationSystem | | | | An accessory that represents multiple water valves and accommodates a programmed scheduled. | | | +| | Active | | Contact, Dimmer, Number, String, Switch | If the irrigation system as a whole is enabled. This must be ON if any of the valves are also enabled. | inverted (false) | INACTIVE (0, OFF), ACTIVE (1, ON) | +| | InUseStatus | | Contact, Dimmer, Number, String, Switch | If the irrigation system as a whole is running. This must be ON if any of the valves are ON. | inverted (false) | NOT_IN_USE (0, OFF, CLOSED), IN_USE (1, ON, OPEN) | +| | ProgramMode | | String | The current program mode of the irrigation system. Possible values (NO_SCHEDULED - no programs scheduled, SCHEDULED - program scheduled, SCHEDULED_MANUAL - program scheduled, currently overriden to manual mode). | | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | RemainingDuration | Number | The remaining duration for all scheduled valves in the current program in seconds. | | | +| LeakSensor | | | | Leak Sensor | | | +| | LeakDetectedState | | Contact, Dimmer, Number, String, Switch | Leak sensor state | inverted (false) | LEAK_NOT_DETECTED (0, OFF, CLOSED), LEAK_DETECTED (1, ON, OPEN) | +| | | ActiveStatus | Contact, Switch | Working status | | | +| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | +| LightSensor | | | | Light sensor | | | +| | LightLevel | | Number | Light level in lux | minValue (0.0001), maxValue (100000) | | +| | | ActiveStatus | Contact, Switch | Working status | | | +| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | +| Lighting | | | | A lightbulb, can have further optional parameters for brightness, hue, etc | | | +| | OnState | | Switch | State of the light - ON/OFF | | | +| | | Brightness | Dimmer, Color | Brightness in % (1-100). See "Usage of dimmer modes" for configuration details. | | | +| | | ColorTemperature | Dimmer, Number | Color temperature. If the item is a Number with no units, it is represented in mireds. The default value range is from 50 to 400 (2500 K to 20,000 K). If the item is a Dimmer, it will be transformed linearly to mireds. Color temperature should not be used in combination with hue, saturation and brightness. | minValue (50), maxValue (400), inverted | | +| | | Hue | Dimmer, Color | Hue | | | +| | | Saturation | Dimmer, Color | Saturation in % (1-100) | | | +| Lock | | | | A Lock Mechanism | inverted (false) | | +| | LockCurrentState | | Contact, Number, String, Switch | Current state of lock mechanism | inverted (false) | UNSECURED (0, OFF, CLOSED), SECURED (1, ON, OPEN), JAMMED (2), UNKNOWN (3) | +| | LockTargetState | | Number, String, Switch | Target state of lock mechanism | inverted (false) | UNSECURED (0, OFF), SECURED (1, ON) | +| Microphone | | | | Microphone accessory | | | +| | Mute | | Contact, Dimmer, Switch | Mute indication. ON/OPEN = microphone is muted | inverted (false) | | +| | | Volume | Number | Microphone volume from 0% to 100% | | | +| MotionSensor | | | | Motion Sensor | | | +| | MotionDetectedState | | Contact, Dimmer, Switch | Motion sensor state (ON=motion detected, OFF=no motion) | inverted (false) | | +| | | ActiveStatus | Contact, Switch | Working status | | | +| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | +| OccupancySensor | | | | Occupancy Sensor | | | +| | OccupancyDetectedState | | Contact, Dimmer, Number, String, Switch | Occupancy sensor state | inverted (false) | NOT_DETECTED (0, OFF, CLOSED), DETECTED (1, ON, OPEN) | +| | | ActiveStatus | Contact, Switch | Working status | | | +| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | +| Outlet | | | | An accessory that can be turned off and on. While similar to a lightbulb, this will be presented differently in the Siri grammar and iOS apps | | | +| | InUseStatus | | Contact, Dimmer, Switch | Indicates whether the outlet has an appliance e.g., a floor lamp, physically plugged in. This characteristic is set to True even if the plugged-in appliance is off. | inverted (false) | | +| | OnState | | Dimmer, Switch | State of the outlet - ON/OFF | | | +| SecuritySystem | | | | Security system. | | | +| | CurrentSecuritySystemState | | Number, String | Current state of the security system | | STAY_ARM (0), AWAY_ARM (1), NIGHT_ARM (2), DISARMED (3), TRIGGERED (4) | +| | TargetSecuritySystemState | | Number, String | Requested state of the security system. While the requested state is not DISARM, and the current state is DISARMED, HomeKit will display "Arming...", for example during an exit delay. | | STAY_ARM (0), AWAY_ARM (1), NIGHT_ARM (2), DISARM (3) [*](#customizable-enum) | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | +| Slat | | | | Slat which tilts on a vertical or a horizontal axis. Configuration "type:horizontal" or "type:vertical" | | | +| | CurrentSlatState | | Number, String | Current slat state. | | FIXED (0), JAMMED (1), SWINGING (2) | +| | | CurrentTiltAngle | Dimmer, Number | Number Item = current angle of slats. values -90 to 90. A value of 0 indicates that the slats are rotated to a fully open position. Dimmer Item = the percentage of openness (0%-100%) | | | +| | | SwingMode | Number, Switch, String | Swing mode | inverted (false) | SWING_DISABLED (0, OFF), SWING_ENABLED (1, ON) | +| | | TargetTiltAngle | Dimmer, Number | Number Item = target angle of slats (-90 to +90). Dimmer Item = the percentage of openness (0%-100%) | | | +| SmartSpeaker | | | | Smart speaker accessory with Play/Stop/Pause control | | | +| | CurrentMediaState | | Number, String | Current smart speaker state | | PLAY (0), PAUSE (1), STOP (2), UNKNOWN (3) | +| | TargetMediaState | | Number, String | Target smart speaker state | | PLAY (0), PAUSE (1), STOP (2) | +| | | ConfiguredName | String | Name of the speaker accessory configured in iOS Home app. User can rename the speaker in iOS Home app and this characteristic can be used to reflect change in openHAB and sync name changes from openHAB to Home app. | | | +| | | Mute | Contact, Switch | Mute indication. ON/OPEN = speaker is muted | inverted (false) | | +| | | Volume | Number | Speaker volume from 0% to 100% | | | +| SmokeSensor | | | | Smoke Sensor | | | +| | SmokeDetectedState | | Contact, Dimmer, Number, String, Switch | Smoke sensor state | inverted (false) | NOT_DETECTED (0, OFF, CLOSED), DETECTED (1, ON, OPEN) | +| | | ActiveStatus | Contact, Switch | Working status | | | +| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | +| Speaker | | | | Speaker accessory | | | +| | Mute | | Contact, Dimmer, Switch | Mute indication. ON/OPEN = speaker is muted | inverted (false) | | +| | | Active | Contact, Dimmer, Number, String, Switch | Accessory current working status | inverted (false) | INACTIVE (0, OFF), ACTIVE (1, ON) | +| | | Volume | Number | Speaker volume from 0% to 100% | | | +| StatelessProgrammableSwitch | | | | A stateless programmable switch is a button or scene controller that simply sends an event to Home when it is pressed, allowing automations to occur. See [Stateless Programmable Switch Groups](#Stateless-Programmable-Switch-Groups) for configuring multiple in one accessory. | | | +| | ProgrammableSwitchEvent | | Contact, Number, String, Switch | The button press event. Note that the event will be forwarded to Home for every _update_ of the item, not just on change. | inverted (false) | SINGLE_PRESS (0, ON, OPEN), DOUBLE_PRESS (1), LONG_PRESS (2) [*](#customizable-enum) | +| | | Volume | Number | Speaker volume from 0% to 100% | | | +| Switchable | | | | An accessory that can be turned off and on. While similar to a lightbulb, this will be presented differently in the Siri grammar and iOS apps | | | +| | OnState | | Dimmer, Switch | State of the switch - ON/OFF | | | +| Television | | | | Television accessory with inputs | | | +| | Active | | Contact, Dimmer, Number, String, Switch | State of the television (on/off) | inverted (false) | INACTIVE (0, OFF), ACTIVE (1, ON) | +| | | ActiveIdentifier | Number | The input that is currently active (based on its identifier). Can also be configured via metadata, e.g. [ActiveIdentifier=1] | | | +| | | Brightness | Dimmer | Screen brightness in % (1-100). | | | +| | | ClosedCaptions | Contact, Dimmer, Number, String, Switch | Indicates closed captions are enabled. Can also be configured via metadata, e.g. [ClosedCaptions=true] | inverted (false) | DISABLED (0, OFF), ENABLED (1, ON) | +| | | ConfiguredName | String | Name of the television accessory configured in the iOS Home app. User can rename the television in iOS Home app and this characteristic can be used to reflect change in openHAB and sync name changes from openHAB to Home app. | | | +| | | CurrentMediaState | Number, String | Current television state. | | PLAY (0), PAUSE (1), STOP (2), UNKNOWN (3) | +| | | PictureMode | Number, String | Selected picture mode. | | OTHER (0), STANDARD (1), CALIBRATED (2), CALIBRATED_DARK (3), VIVID (4), GAME (5), COMPUTER (6), CUSTOM (7) | +| | | PowerMode | Switch, Number, String | This oddly named characteristic will receive an ON command when the user requests to open the TV's menu. | inverted (false) | SHOW (0, ON), HIDE (1, OFF) | +| | | RemoteKey | String | Receives a keypress event. | | | +| | | SleepDiscoveryMode | Contact, Dimmer, Number, String, Switch | Indicates if the television is discoverable while in standby mode. Can also be configured via metadata, e.g. [SleepDiscoveryMode=true] | inverted (false) | NOT_DISCOVERABLE (0, OFF), ALWAYS_DISCOVERABLE (1, ON) | +| | | TargetMediaState | Number, String | Target television state. | | PLAY (0), PAUSE (1), STOP (2) | +| TelevisionSpeaker | | | | An accessory that can be added to a Television in order to control the speaker associated with it. | | | +| | Mute | | Switch | If the television is muted. ON = muted, OFF = not muted. | | | +| | | Active | Contact, Dimmer, Number, String, Switch | Unknown. This characteristic is undocumented by Apple, but is still available. | inverted (false) | INACTIVE (0, OFF), ACTIVE (1, ON) | +| | | Volume | Dimmer, Number | Current volume. | | | +| | | VolumeControlType | String | The type of control available. This will default to infer based on what other items are linked. NONE = status only, no control; RELATIVE = INCREMENT/DECREMENT only, no status; RELATIVE_WITH_CURRENT = INCREMENT/DECREMENT only with status; ABSOLUTE = direct status and control. Can also be configured via metadata, e.g. [VolumeControlType="ABSOLUTE"]. | | | +| | | VolumeSelector | Dimmer, String | If linked to a dimmer item, will send INCREASE/DECREASE commands. If linked to a string item, will send INCREMENT and DECREMENT. | | | +| TemperatureSensor | | | | Temperature sensor | | | +| | CurrentTemperature | | Number | current temperature | minValue (0), maxValue (100), step (0.1) | | +| | | ActiveStatus | Contact, Switch | Working status | | | +| | | BatteryLowStatus | Contact, Number, Switch | Battery status | inverted (false), lowThreshold (20) | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | TamperedStatus | Contact, Number, String, Switch | Tampered status | inverted (false) | NOT_TAMPERED (0, OFF, CLOSED), TAMPERED (1, ON, OPEN) | +| Thermostat | | | | A thermostat requires at least one of TargetTemperature, CoolingThresholdTemperature, or HeatingThresholdTemperature must be provided. | | | +| | CurrentHeatingCoolingMode | | Number, String, Switch | Current heating cooling mode | | OFF (0, OFF), HEAT (1, ON), COOL (2) | +| | CurrentTemperature | | Number | Current temperature. | minValue (0), maxValue (100), step (0.1) | | +| | TargetHeatingCoolingMode | | Number, String, Switch | Target heating cooling mode | | OFF (0, OFF), HEAT (1, ON), COOL (2), AUTO (3) [*](#customizable-enum) | +| | | TargetTemperature | Number | Target temperature. If CoolingThresholdTemperature and HeatingThresholdTemperature are also provided, this characteristic is used when the thermostat is in HEAT or COOL mode. In AUTO mode, this characteristic receives the average of the two thresholds. | minValue (10), maxValue (38), step (0.1) | | +| | | CoolingThresholdTemperature | Number | Maximum temperature that must be reached before cooling is turned on. If TargetTemperature is not provided, this characteristic will also be used in COOL mode. | minValue (10), maxValue (35), step (0.1) | | +| | | HeatingThresholdTemperature | Number | Minimum temperature that must be reached before heating is turned on. If TargetTemperature is not provided, this characteristic will also be used in HEAT mode. | minValue (0), maxValue (25), step (0.1) | | +| | | RelativeHumidity | Number | Relative humidity in % between 0 and 100. | | | +| | | TargetRelativeHumidity | Number | Target relative humidity in % between 0 and 100. | | | +| | | TemperatureUnit | Number, String, Switch | The units the accessory itself uses to display the temperature. Can also be configured via metadata, e.g. [TemperatureUnit="CELSIUS"] | | CELSIUS (0, OFF), FAHRENHEIT (1, ON) | +| Valve | | | | Valve | ValveType = ["Generic", "Irrigation", "Shower", "Faucet"] ("Generic") | | +| | ActiveStatus | | Dimmer, Switch | Accessory current working status. A value of "ON"/"OPEN" indicates that the accessory is active and is functioning without any errors. | | | +| | InUseStatus | | Contact, Dimmer, Switch | Indicates whether fluid flowing through the valve. A value of "ON"/"OPEN" indicates that fluid is flowing. | inverted (false) | | +| | | Duration | Number | Defines how long a valve should be set to ʼIn Useʼ in second. | homekitDefaultDuration = {default duration in seconds} | | +| | | FaultStatus | Contact, Number, String, Switch | Fault status | inverted (false) | NO_FAULT (0, OFF, CLOSED), GENERAL_FAULT (1, ON, OPEN) | +| | | RemainingDuration | Number | Describes the remaining duration on the accessory. the remaining duration increases/decreases from the accessoryʼs usual countdown. i.e. changes from 90 to 80 in a second. | | | +| Window | | | | Motorized window. One Rollershutter item covers all mandatory characteristics. see examples below. | | | +| | CurrentPosition | | Dimmer, Number, Rollershutter | Current position of motorized window | | | +| | PositionState | | Number, Rollershutter, String | Position state. If no state is provided, "STOPPED" is used. | | DECREASING (0), INCREASING (1), STOPPED (2) | +| | TargetPosition | | Dimmer, Number, Rollershutter | Target position of motorized window | | | +| | | HoldPosition | Rollershutter, Switch | Motorized door should stop at its current position. ON is sent to Switch items. STOP is sent to Rollershutter items. Only supported by 3rd party Home apps (such as Elgato Eve) | | | +| | | ObstructionStatus | Contact, Dimmer, Switch | Current status of obstruction sensor. ON-obstruction detected, OFF - no obstruction | | | +| WindowCovering | | | | Window covering / blinds. One Rollershutter item covers all mandatory characteristics. see examples below. | | | +| | CurrentPosition | | Dimmer, Number, Rollershutter | Current position of window covering | | | +| | PositionState | | Number, Rollershutter, String | Position state. If no state is provided, "STOPPED" is used. | | DECREASING (0), INCREASING (1), STOPPED (2) | +| | TargetPosition | | Dimmer, Number, Rollershutter | Target position of window covering | | | +| | | CurrentHorizontalTiltAngle | Dimmer, Number | Number Item = current angle of horizontal slats. values -90 to 90. A value of 0 indicates that the slats are rotated to a fully open position. A value of -90 indicates that the slats are rotated all the way in a direction where the user-facing edge is higher than the window-facing edge. Dimmer Item = the percentage of openness (0%-100%) | | | +| | | CurrentVerticalTiltAngle | Dimmer, Number | Number Item = current angle of vertical slats (-90 to +90) . Dimmer Item = the percentage of openness (0%-100%) | | | +| | | HoldPosition | Rollershutter, Switch | Motorized door should stop at its current position. ON is sent to Switch items. STOP is sent to Rollershutter items. Only supported by 3rd party Home apps (such as Elgato Eve) | | | +| | | ObstructionStatus | Contact, Dimmer, Switch | Current status of obstruction sensor. ON-obstruction detected, OFF - no obstruction | | | +| | | TargetHorizontalTiltAngle | Dimmer, Number | Number Item = target angle of horizontal slats (-90 to +90). Dimmer Item = the percentage of openness (0%-100%) | | | +| | | TargetVerticalTiltAngle | Dimmer, Number | Number Item = target angle of vertical slats. Dimmer Item = the percentage of openness (0%-100%) | | | ### Examples diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitTaggedItem.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitTaggedItem.java index 6a6b7826e0aa9..afe50632f9b4b 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitTaggedItem.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitTaggedItem.java @@ -35,6 +35,7 @@ import org.openhab.core.library.types.PercentType; import org.openhab.core.library.types.QuantityType; import org.openhab.core.library.types.StringType; +import org.openhab.core.library.types.UpDownType; import org.openhab.core.types.State; import org.openhab.core.types.StateDescription; import org.slf4j.Logger; @@ -277,6 +278,21 @@ public void send(StringType command) { getName()); } + /** + * Send UpDownType command to a RollshutterItem (or a Group:Rollershutter) + */ + public void send(UpDownType command) { + if (getItem() instanceof GroupItem groupItem && getBaseItem() instanceof RollershutterItem) { + groupItem.send(command); + return; + } else if (getItem() instanceof RollershutterItem rollershutterItem) { + rollershutterItem.send(command); + return; + } + logger.warn("Received UpDownType command for item {} that doesn't support it. This is probably a bug.", + getName()); + } + /** * send openHAB item command via proxy item, which allows to group commands. * e.g. sendCommandProxy(hue), sendCommandProxy(brightness) would lead to one openHAB command that updates hue and diff --git a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java index bc5047c992557..82bbad359f6e4 100644 --- a/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java +++ b/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/accessories/HomekitCharacteristicFactory.java @@ -50,6 +50,7 @@ import org.openhab.core.library.types.QuantityType; import org.openhab.core.library.types.StopMoveType; import org.openhab.core.library.types.StringType; +import org.openhab.core.library.types.UpDownType; import org.openhab.core.library.unit.ImperialUnits; import org.openhab.core.library.unit.SIUnits; import org.openhab.core.library.unit.Units; @@ -855,11 +856,23 @@ private static CoolingThresholdTemperatureCharacteristic createCoolingThresholdC private static CurrentDoorStateCharacteristic createCurrentDoorStateCharacteristic(HomekitTaggedItem taggedItem, HomekitAccessoryUpdater updater) { - List validValues = new ArrayList<>(); - var map = createMapping(taggedItem, CurrentDoorStateEnum.class, validValues, true); - return new CurrentDoorStateCharacteristic(() -> getEnumFromItem(taggedItem, map, CurrentDoorStateEnum.CLOSED), - getSubscriber(taggedItem, CURRENT_DOOR_STATE, updater), - getUnsubscriber(taggedItem, CURRENT_DOOR_STATE, updater)); + if (taggedItem.getBaseItem() instanceof RollershutterItem) { + return new CurrentDoorStateCharacteristic(() -> { + if (taggedItem.getItem().getState() instanceof PercentType percentType + && percentType.equals(PercentType.HUNDRED)) { + return CompletableFuture.completedFuture(CurrentDoorStateEnum.CLOSED); + } + return CompletableFuture.completedFuture(CurrentDoorStateEnum.OPEN); + }, getSubscriber(taggedItem, CURRENT_DOOR_STATE, updater), + getUnsubscriber(taggedItem, CURRENT_DOOR_STATE, updater)); + } else { + List validValues = new ArrayList<>(); + var map = createMapping(taggedItem, CurrentDoorStateEnum.class, validValues, true); + return new CurrentDoorStateCharacteristic( + () -> getEnumFromItem(taggedItem, map, CurrentDoorStateEnum.CLOSED), + getSubscriber(taggedItem, CURRENT_DOOR_STATE, updater), + getUnsubscriber(taggedItem, CURRENT_DOOR_STATE, updater)); + } } private static CurrentHeatingCoolingStateCharacteristic createCurrentHeatingCoolingStateCharacteristic( @@ -1426,12 +1439,25 @@ private static SwingModeCharacteristic createSwingModeCharacteristic(HomekitTagg private static TargetDoorStateCharacteristic createTargetDoorStateCharacteristic(HomekitTaggedItem taggedItem, HomekitAccessoryUpdater updater) { - List validValues = new ArrayList<>(); - var map = createMapping(taggedItem, TargetDoorStateEnum.class, validValues, true); - return new TargetDoorStateCharacteristic(() -> getEnumFromItem(taggedItem, map, TargetDoorStateEnum.CLOSED), - (targetState) -> setValueFromEnum(taggedItem, targetState, map), - getSubscriber(taggedItem, TARGET_DOOR_STATE, updater), - getUnsubscriber(taggedItem, TARGET_DOOR_STATE, updater)); + if (taggedItem.getBaseItem() instanceof RollershutterItem) { + return new TargetDoorStateCharacteristic(() -> { + if (taggedItem.getItem().getState() instanceof PercentType percentType + && percentType.equals(PercentType.HUNDRED)) { + return CompletableFuture.completedFuture(TargetDoorStateEnum.CLOSED); + } + return CompletableFuture.completedFuture(TargetDoorStateEnum.OPEN); + }, (targetState) -> taggedItem + .send(targetState.equals(TargetDoorStateEnum.OPEN) ? UpDownType.UP : UpDownType.DOWN), + getSubscriber(taggedItem, TARGET_DOOR_STATE, updater), + getUnsubscriber(taggedItem, TARGET_DOOR_STATE, updater)); + } else { + List validValues = new ArrayList<>(); + var map = createMapping(taggedItem, TargetDoorStateEnum.class, validValues, true); + return new TargetDoorStateCharacteristic(() -> getEnumFromItem(taggedItem, map, TargetDoorStateEnum.CLOSED), + (targetState) -> setValueFromEnum(taggedItem, targetState, map), + getSubscriber(taggedItem, TARGET_DOOR_STATE, updater), + getUnsubscriber(taggedItem, TARGET_DOOR_STATE, updater)); + } } private static TargetFanStateCharacteristic createTargetFanStateCharacteristic(HomekitTaggedItem taggedItem,