Last active
September 13, 2024 13:23
-
-
Save DOCaCola/83e6aa26f37915cd290202be5f158702 to your computer and use it in GitHub Desktop.
Honeywell ActivLink Data Frame Generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Honeywell ActivLink Data Frame</h1> | |
<label>KEY ID (different for each transmitter) </label><input id="hw_id" value="ABCDE"><br> | |
<label>DEVICE TYPE</label> | |
<select id="hw_type"> | |
<option value="10">Doorbell</option> | |
<option value="01">PIR Motion sensor</option> | |
</select><br> | |
<label>ALERT</label> | |
<select id="hw_alert"> | |
<option value="00">normal</option> | |
<option value="01">right-left halo light pattern</option> | |
<option value="10">right-left halo light pattern (alt)</option> | |
<option value="11">full volume alarm</option> | |
</select><br> | |
<label>SECRET KNOCK (0 = default, 1 if doorbell is pressed 3x rapidly)</label><input type="checkbox" id="hw_secretknock"></input><br> | |
<label>RELAY (1 if signal is a retransmission of a received transmission, only some models)</label><input type="checkbox" id="hw_relay"></input><br> | |
<label>FLAG UNKNOWN (0 = default, but 1 is accepted and I don't observe any effects)</label><input type="checkbox" id="hw_flagunknown"></input><br> | |
<label>LOWBAT (1 if battery is low, receiver gives low battery alert)</label><input type="checkbox" id="hw_lowbatt"></input><br> | |
<button onclick="generate()">Generate</button><br> | |
<span id="hw_output"></span> | |
<script> | |
function hex2bin(hex){ | |
return (parseInt(hex, 16).toString(2)).padStart(8, '0'); | |
} | |
function pad(num, size) { | |
num = num.toString(); | |
while (num.length < size) num = "0" + num; | |
return num; | |
} | |
function generate() | |
{ | |
const output = document.getElementById('hw_output'); | |
let dataFrameBin = hex2bin(document.getElementById('hw_id').value); | |
// Key unknown | |
dataFrameBin += "000000"; | |
dataFrameBin += document.getElementById("hw_type").value; | |
// More unknown data | |
dataFrameBin += "0000000000"; | |
dataFrameBin += document.getElementById("hw_alert").value; | |
// More unknown data | |
dataFrameBin += "000"; | |
if (document.getElementById("hw_secretknock").checked) | |
dataFrameBin += 1; | |
else | |
dataFrameBin += 0; | |
if (document.getElementById("hw_relay").checked) | |
dataFrameBin += 1; | |
else | |
dataFrameBin += 0; | |
if (document.getElementById("hw_flagunknown").checked) | |
dataFrameBin += 1; | |
else | |
dataFrameBin += 0; | |
if (document.getElementById("hw_lowbatt").checked) | |
dataFrameBin += 1; | |
else | |
dataFrameBin += 0; | |
let oneCount = dataFrameBin.replaceAll('0', '').length; | |
let lsb = parseInt(oneCount, 2) & 1 | |
dataFrameBin += lsb; | |
let dataFrame = parseInt(dataFrameBin, 2).toString(16).toUpperCase(); | |
dataFrame = pad(dataFrame, 12); | |
output.textContent = dataFrame; | |
} | |
</script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Direct use link: https://htmlpreview.github.io/?https://gist.githubusercontent.com/DOCaCola/83e6aa26f37915cd290202be5f158702/raw/72107dee368e1280bf50475a7c73aa593450150a/index.html
Based on https://github.com/klohner/honeywell-wireless-doorbell to easily generate a data frame for the Honeywell ActivLink protocol.
Discussed here (german): https://forum.fhem.de/index.php/topic,130271.0.html