steilerDev / homebridge-openhab2-complete

A homebridge plugin for openHAB, that has the expectation to fully support all Services offered by Apple's Homekit Accessory Protocol (HAP)
GNU General Public License v3.0
52 stars 16 forks source link

Heater/Cooler Error: Not configuring binary actor characteristic #74

Closed SmartHome-OH closed 3 years ago

SmartHome-OH commented 4 years ago

I have been using the plugin for a month. Very satisfied. It works stably. Thanks.

I try to add air conditioning and get an error. I don’t understand what I am doing wrong.

[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Transformation map for 1FL-LR-A2: {"0":"OFF","1":"ON","OFF":0,"ON":1}
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Unable to add accessory 1FL-LR-A2: Error: Not configuring binary actor characteristic for 1FL-LR-A2: Required item for 1FL-LR-A2 not defined: {"name":"1FL-LR-A2","type":"heatercooler","currentTempItem":"brzc_set_temperature","activeItem":"brzc_power","activeItemInverted":"false","heatingItem":"brz_State_Power","tempUnit":"Celsius","serialNumber":"8AEA24348BC35C3440BCD","version":"1.1.0"}, skipping

Configurations

                {
                    "name": "1FL-LR-A2",
                    "type": "heatercooler",
                    "currentTempItem": "brzc_set_temperature",
                    "activeItem": "brzc_power",
                    "activeItemInverted": "false",
                    "heatingItem": "brz_State_Power",
                    "tempUnit": "Celsius"
                }

OpenHab: Switch brz_State_Power Switch brzc_power Number brzc_set_temperature

21:35:38.341 [INFO ] [smarthome.event.ItemStateChangedEvent] - brzc_power changed from OFF to ON
21:36:11.039 [INFO ] [smarthome.event.ItemStateChangedEvent] - brz_State_Power changed from OFF to ON
21:37:55.953 [INFO ] [smarthome.event.ItemStateChangedEvent] - brzc_set_temperature changed from 25 to 26

Logs:

[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Found accessory in config: '1FL-LR-A2' (heatercooler)
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Creating new accessory: 1FL-LR-A2
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Trying battery service for 1FL-LR-A2
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Not configuring battery service for 1FL-LR-A2: Not configuring battery warning characteristic for 1FL-LR-A2: Required batteryItem for 1FL-LR-A2 not defined: {"name":"1FL-LR-A2","type":"heatercooler","currentTempItem":"brzc_set_temperature","activeItem":"brzc_power","activeItemInverted":"false","heatingItem":"brz_State_Power","tempUnit":"Celsius","serialNumber":"8AEA24348BC35C3440BCD","version":"1.1.0"}
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Creating Heater/Cooler service for 1FL-LR-A2
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Checking cache for brzc_set_temperature
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Returning value (Number) for key brzc_set_temperature
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Creating numeric sensor/actor characteristic for 1FL-LR-A2 with brzc_set_temperature
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Subscribing to changes for brzc_set_temperature
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Queueing subscription for brzc_set_temperature
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Creating 'TargetHeaterCoolingState' characteristic for 1FL-LR-A2 with mode set to 1
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Checking cache for brz_State_Power
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Returning value (Switch) for key brz_State_Power
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] coolingItem for 1FL-LR-A2 not defined in config: {"name":"1FL-LR-A2","type":"heatercooler","currentTempItem":"brzc_set_temperature","activeItem":"brzc_power","activeItemInverted":"false","heatingItem":"brz_State_Power","tempUnit":"Celsius","serialNumber":"8AEA24348BC35C3440BCD","version":"1.1.0"})
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Subscribing to changes for brz_State_Power
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Queueing subscription for brz_State_Power
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Creating 'CurrentHeaterCoolerState' characteristic for 1FL-LR-A2 with mode set to heating
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Transformation map for 1FL-LR-A2: {"0":"OFF","1":"ON","OFF":0,"ON":1}
[4/8/2020, 12:07:16 AM] [openHAB2-Complete] Unable to add accessory 1FL-LR-A2: Error: Not configuring binary actor characteristic for 1FL-LR-A2: Required item for 1FL-LR-A2 not defined: {"name":"1FL-LR-A2","type":"heatercooler","currentTempItem":"brzc_set_temperature","activeItem":"brzc_power","activeItemInverted":"false","heatingItem":"brz_State_Power","tempUnit":"Celsius","serialNumber":"8AEA24348BC35C3440BCD","version":"1.1.0"}, skipping

Environment:

steilerDev commented 4 years ago

Hi @SmartHome-OH,

i think this is a documentation error. Could you try item and inverted instead of activeItem and activeItemInverted?

Thank you!

SmartHome-OH commented 4 years ago

@steilerDev Thank you! I have changed config. The accessory was added successfully. But I still see the error "Transformation map for 1FL-LR-A2: {"0":"OFF","1":"ON","OFF":0,"ON":1}". The accessory was added but status is "Not supported".

Config:

                {
                    "name": "1FL-LR-A2",
                    "type": "heatercooler",
                    "currentTempItem": "brzc_set_temperature",
                    "item": "brzc_power",
                    "heatingItem": "brz_State_Power",
                    "tempUnit": "Celsius"
                }

Log:

[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Found accessory in config: '1FL-LR-A2' (heatercooler)
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Creating new accessory: 1FL-LR-A2
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Trying battery service for 1FL-LR-A2
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Not configuring battery service for 1FL-LR-A2: Not configuring battery warning characteristic for 1FL-LR-A2: Required batteryItem for 1FL-LR-A2 not defined: {"name":"1FL-LR-A2","type":"heatercooler","currentTempItem":"brzc_set_temperature","item":"brzc_power","heatingItem":"brz_State_Power","tempUnit":"Celsius","serialNumber":"8AEA24348BC35C3440BCD","version":"1.1.0"}
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Creating Heater/Cooler service for 1FL-LR-A2
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Applied minValue -100, maxValue 200 and minStep 0.1
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Checking cache for brzc_set_temperature
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Returning value (Number) for key brzc_set_temperature
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Creating numeric sensor characteristic for 1FL-LR-A2 with brzc_set_temperature
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Subscribing to changes for brzc_set_temperature
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Queueing subscription for brzc_set_temperature
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Creating 'TargetHeaterCoolingState' characteristic for 1FL-LR-A2 with mode set to 1
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Checking cache for brz_State_Power
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Returning value (Switch) for key brz_State_Power
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] coolingItem for 1FL-LR-A2 not defined in config: {"name":"1FL-LR-A2","type":"heatercooler","currentTempItem":"brzc_set_temperature","item":"brzc_power","heatingItem":"brz_State_Power","tempUnit":"Celsius","serialNumber":"8AEA24348BC35C3440BCD","version":"1.1.0"})
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Subscribing to changes for brz_State_Power
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Queueing subscription for brz_State_Power
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Creating 'CurrentHeaterCoolerState' characteristic for 1FL-LR-A2 with mode set to heating
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Transformation map for 1FL-LR-A2: {"0":"OFF","1":"ON","OFF":0,"ON":1}
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Checking cache for brzc_power
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Returning value (Switch) for key brzc_power
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Creating binary actor characteristic for 1FL-LR-A2 with item brzc_power and inverted set to false
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Subscribing to changes for brzc_power
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Queueing subscription for brzc_power
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Not configuring numeric actor characteristic for 1FL-LR-A2: Required heatingThresholdTempItem for 1FL-LR-A2 not defined: {"name":"1FL-LR-A2","type":"heatercooler","currentTempItem":"brzc_set_temperature","item":"brzc_power","heatingItem":"brz_State_Power","tempUnit":"Celsius","serialNumber":"8AEA24348BC35C3440BCD","version":"1.1.0"}
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Not configuring numeric actor characteristic for 1FL-LR-A2: Required coolingThresholdTempItem for 1FL-LR-A2 not defined: {"name":"1FL-LR-A2","type":"heatercooler","currentTempItem":"brzc_set_temperature","item":"brzc_power","heatingItem":"brz_State_Power","tempUnit":"Celsius","serialNumber":"8AEA24348BC35C3440BCD","version":"1.1.0"}
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Not configuring numeric actor characteristic for 1FL-LR-A2: Required rotationSpeedItem for 1FL-LR-A2 not defined: {"name":"1FL-LR-A2","type":"heatercooler","currentTempItem":"brzc_set_temperature","item":"brzc_power","heatingItem":"brz_State_Power","tempUnit":"Celsius","serialNumber":"8AEA24348BC35C3440BCD","version":"1.1.0"}
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Not configuring binary sensor characteristic for 1FL-LR-A2: Required swingItem for 1FL-LR-A2 not defined: {"name":"1FL-LR-A2","type":"heatercooler","currentTempItem":"brzc_set_temperature","item":"brzc_power","heatingItem":"brz_State_Power","tempUnit":"Celsius","serialNumber":"8AEA24348BC35C3440BCD","version":"1.1.0"}
[4/12/2020, 6:06:38 PM] [openHAB2-Complete] Added accessory 1FL-LR-A2 (Type: heatercooler)
SmartHome-OH commented 4 years ago

I see this message. Is it ok?

function addActiveCharacteristic(service, optional) {
    let inverted = this._checkInvertedConf(BINARY_CONFIG.inverted);
    let transformation = {
        "OFF": inverted ? 1 : 0,
        "ON": inverted ? 0 : 1,
        [inverted ? 0 : 1]: "ON",
        [inverted ? 1 : 0]: "OFF"
    };
    this._log.error(`Transformation map for ${this.name}: ${JSON.stringify(transformation)}`);
    addBinarySensorActorCharacteristicWithTransformation.bind(this)(service, service.getCharacteristic(this.Characteristic.Active), BINARY_CONFIG, transformation, optional);
}
steilerDev commented 4 years ago

Seems to be a forgotten debug message :D Thanks for finding this, i will merge your PR :)

Does it work for you now?

SmartHome-OH commented 4 years ago

The accessory was added but status is "Not supported". I have no idea how to debug this.

steilerDev commented 3 years ago

Fixed with 1.3.0