Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added doorbell service #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lukehoersten
Copy link
Contributor

The video doorbell service depends on a doorbell service which in turn depends on more services and characteristics. I've implemented that whole tree of dependencies.

The video portion of the doorbell is important because that's how the Home app connects "chimes" on the HomePods to the doorbell. The doorbell service currently works on it's own but there's no way for the Home app to configure doorbell chimes then.

The video services with the respective tlv8 configs are only stubbed out and a WIP.

NOTE: This is a work in progress. I'm looking for feedback or help with the TLV8 configs etc. I also realize I've mistakenly auto formatted the files. I'll revert this at a later point.

@CLAassistant
Copy link

CLAassistant commented Mar 2, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@lukehoersten
Copy link
Contributor Author

@Clovel Cleaned out the formatting errors I had so now you should be able to see the actual changes.

I'm looking for guidance on how to handle the TLV8 config fields:

  1. Should I have a separate TLV8 config object for each sub-service of the video doorbell that takes it's own TLV8 config?
  2. Are there TLV8 structures to provide as a part of the API to help users fill it out.

The reason I'm adding the video doorbell stuff on top of the plain doorbell service is that HAP doesn't really support standalone doorbells without video. Certain features are missing like HomePod chime configuration. So even if the doorbell doesn't have video, you need to provide a vestigial video and audio stream anyway. Any thoughts on how to approach this?

@lukehoersten lukehoersten marked this pull request as ready for review June 2, 2021 15:50
@lukehoersten lukehoersten changed the title [WIP] Added video doorbell services and characteristics Added doorbell service Jun 2, 2021
@lukehoersten
Copy link
Contributor Author

Dropped the addition of both doorbell and video doorbell in favor of just the simpler doorbell first.

@mcpat-it
Copy link

mcpat-it commented Oct 21, 2021

@lukehoersten can you explain howto implement? I get the information "This accessory is not currently supported by the Homeapp." / "Dieses Gerät wird derzeit nicht von der Home-App unterstützt" on my iPhone (iOS 15.0.2).

I tried

hap_acc_cfg_t bridge_cfg_bell = {
        .name = "Esp-Doorbell",
        .manufacturer = "Espressif",
        .model = "EspDoorbell01",
        .serial_num = "abcdefg",
        .fw_rev = "0.9.0",
        .hw_rev = NULL,
        .pv = "1.1.0",
        .identify_routine = accessory_identify,
        .cid = HAP_CID_BRIDGE,
    };
    accessory = hap_acc_create(&bridge_cfg_bell);
    service_bell = hap_serv_doorbell_create(0);
    hap_serv_add_char(service_bell, hap_char_name_create("My Bell"));
    hap_serv_set_priv(service_bell, strdup("My Bell"));
    /* Set the write callback for the service - not sure if needed */
    hap_serv_set_write_cb(service_bell, fan_write);

    hap_acc_add_serv(accessory, service_bell);
    hap_add_bridged_accessory(accessory, hap_get_unique_aid("My Bell"));

But I can raise the ring event and receive a notification on iPhone and AppleTV with:

hap_char_t *temp = hap_serv_get_char_by_uuid(service_bell, HAP_CHAR_UUID_PROGRAMMABLE_SWITCH_EVENT);
    hap_val_t appliance_value = {
        .b = 1
    };
    hap_char_update_val(temp, &appliance_value);

Thx in advance

@lukehoersten
Copy link
Contributor Author

Here's an example of how I use it:

https://github.com/lukehoersten/esp-homekit-intercom

Let me know if you have any questions with this concrete example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants