Yurik72 / ESPHap

ESP32/ESP8266 Arduino library for native Apple Homekit Accessory Protocol (HAP)
MIT License
265 stars 60 forks source link

Cooler + Heater : How to ? #129

Closed simkard69 closed 1 year ago

simkard69 commented 1 year ago

Hello,

I tried to create a sketch with a Heat-Pump that can do these modes :

So far, the sketch works but after pairing, I can only see the following options at the bottom of the rounded range temperature selector :

I tried to initialize the HAP server with these lines : hap_setbase_accessorytype(homekit_accessory_category_air_conditioner); // tried with value "homekit_accessory_category_heater", but got same results hap_initbase_accessory_service("host","Yurik72","0","EspHapSwitch","1.0"); HomeKit_Svc_HVAC = hap_add_heater_service("HVAC", HAP_HVAC_update, 0); hap_set_charachteristic_validrange_by_type(HomeKit_Svc_HVAC, HOMEKIT_CHARACTERISTIC_CURRENT_TEMPERATURE, -20.0, 110.0); INIT_CHARACHTERISTIC_VAL_BY_TYPE(int, HomeKit_Svc_HVAC, HOMEKIT_CHARACTERISTIC_TARGET_HEATER_COOLER_STATE, HEATER_COOLER_STATE_AUTO); INIT_CHARACHTERISTIC_VAL_BY_TYPE(int, HomeKit_Svc_HVAC, HOMEKIT_CHARACTERISTIC_CURRENT_HEATER_COOLER_STATE, HEATER_COOLER_STATE_AUTO); INIT_CHARACHTERISTIC_VAL_BY_TYPE(int, HomeKit_Svc_HVAC, HOMEKIT_CHARACTERISTIC_HEATING_THRESHOLD_TEMPERATURE, 23.0); // >>> OUTPUTS ERROR >>> !!! HomeKit: Wrong default value INIT_CHARACHTERISTIC_VAL_BY_TYPE(int, HomeKit_Svc_HVAC, HOMEKIT_CHARACTERISTIC_COOLING_THRESHOLD_TEMPERATURE, 21.0); // >>> OUTPUTS ERROR >>> !!! HomeKit: Wrong default value hap_init_homekit_server();

Thanks for helping

simkard69 commented 1 year ago

Well, this can be closed, I switched my code to use this category :

So far so good 👍