Closed AustinRobinson closed 5 years ago
As far as I know you have to set the value yourself and then send the notification. It is built this way because things like buttons only send notifications, they don’t change values.
What do you mean by set the value yourself and then send the notification?
See “button_callback” here: https://github.com/maximkulkin/esp-homekit-demo/blob/master/examples/sonoff_basic/main.c
I set the value of the characteristic first, then I send the notification.
Never mind, I figured it out. have to do current.value = HOMEKIT_UINT8(3);
and then call homekit_characteristic_notify(¤t, current.value);
Thanks for your help.
Even though current.value is 1, and my phone gets the "Default Room Garage Door Was Closed" it says opening in the Home App.
The home app keeps saying opening... or closing... until obstruction detected is false and the current position matches the target position. So check the value of target door state.
Ok I get it now, thanks.
If I call
homekit_characteristic_t current = HOMEKIT_CHARACTERISTIC_(CURRENT_DOOR_STATE, 0);
and then callprintf("Current: %d\n", current.value.int_value);
it outputs "Current: 0" as expected. But when I callhomekit_characteristic_notify(¤t, HOMEKIT_UINT8(3));
it still outputs "Current: 0"