cflurin / homebridge-mqtt

Homebridge-mqtt is a Plugin for Homebridge.
Apache License 2.0
229 stars 38 forks source link

New HomeKit types? #6

Closed ArnieX closed 8 years ago

ArnieX commented 8 years ago

Hi,

will you add new HomeKit types https://developer.apple.com/reference/homekit/1627282-homekit_constants?

Thanks.

cflurin commented 8 years ago

Hi, I'll be back tomorrow and let's see what I can do over the weekend.

ArnieX commented 8 years ago

@cflurin awesome! I'm looking forward ;)

cflurin commented 8 years ago

@ArnieX I've just upload v0.2.0 to github. This version supports the types as defined in:

https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js

Please install from github:

sudo npm install -g --unsafe-perm https://github.com/cflurin/homebridge-mqtt
ArnieX commented 8 years ago

@cflurin Great some of those that didn't work are working now.

But I have some issues with certain characteristics, for example battery status for sensors:

Service.TemperatureSensor = function(displayName, subtype) {
Service.call(this, displayName, '0000008A-0000-1000-8000-0026BB765291', subtype);

  // Required Characteristics
  this.addCharacteristic(Characteristic.CurrentTemperature);

  // Optional Characteristics
  this.addOptionalCharacteristic(Characteristic.StatusActive);
  this.addOptionalCharacteristic(Characteristic.StatusFault);
  this.addOptionalCharacteristic(Characteristic.StatusLowBattery);
  this.addOptionalCharacteristic(Characteristic.StatusTampered);
  this.addOptionalCharacteristic(Characteristic.Name);
};

Which I try to set like this:

{"name": "Outdoor Temperature","characteristic": "StatusLowBattery","value": 1}

But it return error:

{"ack":false,"message":"name 'Outdoor Temperature' characteristic do not match."}
cflurin commented 8 years ago

How did you add the accessory? did you define the optional characteristic?

topic: homebridge/to/add payload:

  {
    "name": "Outdoor Temperature",
    "service": "TemperatureSensor",
    "StatusLowBattery": "default"
  }
ArnieX commented 8 years ago

No. I didn't know this has to be defined when created ;). I'll do that and come back to you.

ArnieX commented 8 years ago

@cflurin Yes it works this way. Thank you for clarification.