Creating device with template - how do you find addr and zero_gap?

Quick background, I’m trying to get the F2 template to apply to my Windward IV 52 in. Indoor LED Oil Rubbed Bronze Ceiling Fan with Dimmable Light Kit, Remote Control and Reversible Motor ceiling fan. This is Fan Remote Model: HD3 with FCC ID: 2AAZPHD3. The Bond app won’t offer me the F2 template regardless of what I do, so I’m trying to use the API to create the device instead by sending a POST request to /v2/devices.

The issue I’m running into is finding the right values for the properties. In other posts on the forum, it’s noted that to create a device you need to know the addr, bps, zero_gap, and freq.

I know the freq is either 304150 or 304250 and bps is 40000. But I don’t have values for addr, or zero_gap.

I tried to look up the addr and zero_gap for my manually set up fan from the /devices/deviceID/properties endpoint, but it just gives me

{
"max_speed": 2,
"trust_state": false,
"_": "b17cd87a",
"__": "b17cd87a"
}

As you can see, no addr, bps, and zero_gap, or freq shared.

When I look up a command via API, then use that to look up a signal, I get a little more info, but still no addr or zero_gap.

{
"freq": 304150,
"bps": 40000,
"deviation": 0,
"reps": 1,
"modulation": "OOK",
"encoding": "hex",
"data": "F80000000FFFF8........

Can anyone help me figure out how to get the missing addr and zero_gap values? Thanks in advance!

Is addr just the pips sequence in the remote? If so, how would I reflect the pips in the attached remote picture?

Here is my device create call so far - like I said, addr and zero_gap are just dummy values taken from other posts on this forum:

{
  "name": "testfan",
  "type": "CF",
  "template": "F2",
    "location": "My Room",
    "properties": {"addr": "1111", "bps": 40000, "zero_gap": 30, "freq": 304150}
}

I really like seeing new folks on the forums being so resourceful! Welcome, @breeze .

Now, as far as the actual questions you posed, I don’t have a quick answer.
Maybe @merck or another Bond staff member will run through here sometime this week.
Meanwhile, I’ll have a poke around my notes and the forums as well, see if I can jog any nuggets free of things I’ve seen, currently have, or can find buried in a corner in the posts here.

1 Like

Manually creating template devices via the API is not something that we even are able to do well internally, as it is very dependent on reading the correct values of props out of the signal recorded.

Does it work with raw recording? Where you record one signal per button? That should be way easier.

bps is 40000

That’s the max rate of our radio. Checking our db, users of F2 have bps from 2200–2925. zero_gap from 16–31. Address needs to be determined from the signal, unless you just make one up and then manage to get the fan to pair it by doing long reps of the power button (which is usually involved in pairing these remotes).

Thanks for the responses, @merck and @residualimages!

The remote works with raw recording, but because of how the remote works it would be very difficult if not impossible to manually record all fan speeds, etc. Hence my wanting to get the template to work.

I’m trying to reverse engineer the addr, bps, and zero_gap from the raw recording, but the API won’t give me that info. Or I can’t figure out how to get the API to give me that info.

Here’s what I’m doing.

  1. Get list of Commands for Ceiling Fan that I manually recorded (/v2/devices/:device_id/commands)
  2. Get Signal associated with Command (/v2/devices/:device_id/commands/:command_id/signal)
  3. Look at response body and wish it had the addr and zero_gap details…or an accurate bps!

If there is any way for me to read the property values (or for you to look up the values that I’ve manually recorded) I would really appreciate it! Thanks again.

Here’s the response body again, for reference:

{
    "freq": 304150,
    "bps": 40000,
    "deviation": 0,
    "reps": 1,
    "modulation": "OOK",
    "encoding": "hex",
 "data": "FFFFFFFFC0007FFFF..........

In raw-recording, the Bridge just has a raw waveform. It’s kind of like a WAV file instead of a TXT file. The Bridge doesn’t know the protocol it’s just a 600 ms buffer of 1s and 0s.

Figuring out the address requires inspecting the packet with knowledge of the protocol. This is what our backend tries to do when it checks the “remotes database” based on the recorded signal.

@merck Ah, that makes sense. In that case, do you have any suggestions on how to best get the app to recognize the remote in the remotes database? It’s listed as a fully supported device on your website but I can’t get the app to offer a template no matter how many times and different ways I try to raw record. Thanks.

1 Like

Can we jump on a quick video call to sort it out? https://meetings.hubspot.com/chris-merck/engineering-support-call

2 Likes