# Is Hex or CQ encoding deterministic?

**URL:** <https://forum.bondhome.io/t/is-hex-or-cq-encoding-deterministic/5044>\
**Category:** Integrations\
**Created:** [October 29, 2024, 2:23am UTC](https://forum.bondhome.io/t/is-hex-or-cq-encoding-deterministic/5044 "2024-10-29T02:23:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dblessing](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/dblessing/32/1306_2.png) [@dblessing](https://forum.bondhome.io/u/dblessing)\
**Post date:** [October 29, 2024, 2:23am UTC](https://forum.bondhome.io/t/is-hex-or-cq-encoding-deterministic/5044/1 "2024-10-29T02:23:59Z")

</div>

New to bond and trying to integrate a fireplace with a home automation system. The fireplace is a ridiculous system where the state is held in the remote, not the fireplace board. But that’s not important for my question 😅

For my integration I need to scan a bunch of signals from the fireplace remote. But what I notice is if I scan the same command multiple times it gets captured as different hex data each time. Is this because the hex encoding isn’t deterministic/produces different values each time? Or is the signal from the remote really changing in some way every time.

The scanned signal does the right thing when retransmitted by Bond. It would just be nice to be able to compare the hex-encoded signals and know whether it was the same as one I’ve already scanned.

Related, I am using the API to scan and it doesn’t look like the API supports setting hex vs. cq encoding. Is this an API limitation or is the encoding specified by the signal that’s recorded?

---

<div class="post-metadata">

**Author:** ![merck](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/merck/32/1238_2.png) [@merck](https://forum.bondhome.io/u/merck)\
**Post date:** [October 29, 2024, 12:36pm UTC](https://forum.bondhome.io/t/is-hex-or-cq-encoding-deterministic/5044/2 "2024-10-29T12:36:46Z")

</div>

Welcome! I love API questions in the morning 🙂 (Not joking)

> [@dblessing](#):
>
> ridiculous

Indeed. We call these “state remotes” and indeed they become extra ridiculous when you add in another control point like the Bond Bridge, and they fight for state…

> [@dblessing](#):
>
> the same command multiple times it gets captured as different hex data each time

It is possible that the signals are essentially the same, just appear different because of bit offset or sampling. For example of bit offset, the following four signals are indistinguishable on the air: `00 F0`, `01 E0`, `00 78`, `00 3C`. Or, consider sampling error: `0F FF FF FF` and `07 FF FF FF` are both very similar pulses just with lengths 300 versus 275 microseconds. The Bridge records by sampling every 25 uS (40 kHz).

> [@dblessing](#):
>
> The scanned signal does the right thing when retransmitted by Bond.

The receiver cannot know about bit offset, and the sampling errors usually don’t matter (25 uS is small compared to the symbol rate of most remotes).

> [@dblessing](#):
>
> It would just be nice to be able to compare the hex-encoded signals and know whether it was the same as one I’ve already scanned.

Indeed. You could graph them. We don’t have a public-facing tool for this, but it is pretty easy to do in matplotlib especially if you ask o1 for help :).

> [@dblessing](#):
>
> t doesn’t look like the API supports setting hex vs. cq encoding

For scanning, you are correct. The cq encoding is more of a language that expands into the raw hex. On recording, we get a raw sampling and the CQ encoding would be complex (due to sampling errors). Some algorithm would be needed to clean up the signal, but at the cost of not faithfully reproducing the recorded signal.

* * *

I hope that sheds some light. And please be careful with automating your fireplace.

---

<div class="post-metadata">

**Author:** ![dblessing](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/dblessing/32/1306_2.png) [@dblessing](https://forum.bondhome.io/u/dblessing)\
**Post date:** [October 29, 2024, 1:25pm UTC](https://forum.bondhome.io/t/is-hex-or-cq-encoding-deterministic/5044/3 "2024-10-29T13:25:16Z")

</div>

Thank you. This is really helpful.

> [@merck](#):
>
> Indeed. We call these “state remotes” and indeed they become extra ridiculous when you add in another control point like the Bond Bridge, and they fight for state…
> 
> I hope that sheds some light. And please be careful with automating your fireplace.

Understood. My plan is to completely replace the remote. That thing will have the batteries removed, never to see the light again. That’s the plan anyway… We’ll see if I’m still sane at the end.

> [@merck](#):
>
> Indeed. You could graph them. We don’t have a public-facing tool for this, but it is pretty easy to do in matplotlib especially if you ask o1 for help :).

Clearly there’s the benefit of graphing to see if two signals recorded are in fact more or less the same as I think they should be. But beyond that, would I potentially gain any efficiencies by looking at a command for say (very oversimplified) flame 1 and flame 2 and be able to derive flame 3? Are signals for devices like fireplaces typically some sort of sequential signal? Otherwise I should probably just knuckle down and record the several hundred signals 🥴

---

<div class="post-metadata">

**Author:** ![merck](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/merck/32/1238_2.png) [@merck](https://forum.bondhome.io/u/merck)\
**Post date:** [October 29, 2024, 1:39pm UTC](https://forum.bondhome.io/t/is-hex-or-cq-encoding-deterministic/5044/4 "2024-10-29T13:39:35Z")

</div>

> [@dblessing](#):
>
> Are signals for devices like fireplaces typically some sort of sequential signal?

This is what we do in our lab when new remotes arrive. Sometimes it is easy. Sometimes there is a checksum to figure out. Sometimes there is a CRC and we need to hunt for the algorithm. Sometimes there’s a CRC and they use a non-standard polynomial, or the entire packet is scrambled (possibly whitened) and we are unable to figure out any structure. In the latter cases you basically have to just record on/off as a user. — You as a scriptor have the option of creating something more complex with all the recorded signals.

Good luck! (And, do share a photo of the front/back of the remote. I could check what the support status of it is.)

---

<div class="post-metadata">

**Author:** ![dblessing](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/dblessing/32/1306_2.png) [@dblessing](https://forum.bondhome.io/u/dblessing)\
**Post date:** [October 29, 2024, 2:08pm UTC](https://forum.bondhome.io/t/is-hex-or-cq-encoding-deterministic/5044/5 "2024-10-29T14:08:47Z")

</div>

It’s a Proflame 2 remote. Pretty sure FCC ID: T99058402300. Unfortunately the ID on my remote is already rubbed off. I’ve seen some questions about it on the forum and it appears to be “unsupported”. It’s probably because there are some like 600 different states that have unique commands.

 ![Screenshot 2024-10-29 at 9.07.48 AM](https://us1.discourse-cdn.com/flex019/uploads/bond1/original/2X/3/392eb327ed2c2a0136d5c436801d6e5ad93d6ee5.png)

---

<div class="post-metadata">

**Author:** ![merck](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.bondhome.io/merck/32/1238_2.png) [@merck](https://forum.bondhome.io/u/merck)\
**Post date:** [November 6, 2024, 5:32pm UTC](https://forum.bondhome.io/t/is-hex-or-cq-encoding-deterministic/5044/6 "2024-11-06T17:32:41Z")

</div>

OK. Indeed this remote is known to us to be unsupported. Sorry!
