Yurik72/ESPHap

SLAT do not show up on HomeKit after pairing

Closed this issue · 1 comments

Hello,

I wanted to use SLATs for air direction properties for my heat-pump, but even after creating the needed functions/Definitions in files homeintegration.h and homeintegration.c, nothing shows up on HomeKit's side.

Any idea why it just doesn't appear ?
I've just used the required characteristics + 1 optionnal characteristics (which are correctly initialized during boot-up process) :

  • NAME
  • SLAT_TYPE
  • CURRENT_SLAT_STATE
  • SWING_MODE

Here are my added lines to both files :

  • homeintegration.h
homekit_service_t* hap_add_slat_horizontal_service_MOD(const char* szname, hap_callback cb, void* context);
homekit_service_t* hap_new_slat_horizontal_service_MOD(const char* szname, hap_callback cb, void* context);
  • homeintegration.c
homekit_service_t* hap_new_slat_horizontal_service_MOD(const char* szname, hap_callback cb, void* context) {
	return NEW_HOMEKIT_SERVICE(SLAT, .characteristics=(homekit_characteristic_t*[]) {
			NEW_HOMEKIT_CHARACTERISTIC(NAME, szname),
			NEW_HOMEKIT_CHARACTERISTIC(SLAT_TYPE, 0),			// HORIZONTAL SLAT TYPE : [0] Horizontal ; [1] Vertical
			NEW_HOMEKIT_CHARACTERISTIC(CURRENT_SLAT_STATE, 0),	// HORIZONTAL SLAT STATE :	[0] Stationary (The slats are stationary)
																//										[1] Jammed (The slats are jammed)
																//										[2] Oscillating (The slats are oscillating)
			NEW_HOMEKIT_CHARACTERISTIC(CURRENT_TILT_ANGLE, 0),	// 
			NEW_HOMEKIT_CHARACTERISTIC(TARGET_TILT_ANGLE, 0,	// Value in degrees for horizontal slats between :
				.callback = HOMEKIT_CHARACTERISTIC_CALLBACK(	//				[-90] Closed and rotated such that the user-facing edge is higher than the opposing edge
					cb, .context = context						//				[0] Edges should be aligned, with the slats fully open
				)),												//				[90] N/C
			NEW_HOMEKIT_CHARACTERISTIC(SWING_MODE, 0,			// HORIZONTAL SLAT SWING MODE : [0] Disabled ; [1] Enabled
				.callback = HOMEKIT_CHARACTERISTIC_CALLBACK(
					cb, .context = context
				)),
			NULL
	});

}
homekit_service_t* hap_add_slat_horizontal_service_MOD(const char* szname, hap_callback cb, void* context) {
	INFO("hap_add_slat_horizontal_service_MOD");
	homekit_service_t*service = hap_new_slat_horizontal_service_MOD(szname, cb, context);
	return hap_add_service(service);
}

Managed to get it working using a different method.