[Feature Request] HMS Code mapping
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- api
Research direction
Start by inspecting the report print payload's hms array and the provided Node-RED conversion snippet. Compare the decimal attr and code values with the linked Bambu HMS-code documentation; completion criteria and the implementation location still need to be agreed because the issue does not identify a project entry point or expected API shape.
Written by the indexing model from the issue text.
Description
Wasn't sure where this would fit in the current layout, so I will give my findings here.
In the report print payload for all sensors (or a subset if the P1P as it does not send all unless pushall is invoked), there is the value hms with an array.
If it contains values, it is as such:
"hms": [
{
"code": "somecode",
"attr": "somecode"
},
{
"code": "somecode",
"attr": "somecode"
}
]
The codes and attributes are not recognizable at first, but can be mapped to errors. Both the code and attr are decimal numbers that when converted to Hex with Two's complement, then append the code after the attr and separate each set of 4 character with an underscore, it will be in the format of Bambu's official HMS code errors as per their website.
Note: Not all hms codes are documented yet.
Here is a snippet of how I convert them in nodered:
function DecimalHexTwosComplement(decimal) {
var size = 8;
var hexadecimal;
if (decimal >= 0) {
hexadecimal = decimal.toString(16);
while ((hexadecimal.length % size) != 0) {
hexadecimal = "" + 0 + hexadecimal;
}
return hexadecimal;
} else {
hexadecimal = Math.abs(decimal).toString(16);
while ((hexadecimal.length % size) != 0) {
hexadecimal = "" + 0 + hexadecimal;
}
var output = '';
for (var i = 0; i < hexadecimal.length; i++) {
output += (0x0F - parseInt(hexadecimal[i], 16)).toString(16);
}
output = (0x01 + parseInt(output, 16)).toString(16);
return output;
}
}
let template = [];
if(msg.payload.print.hms != undefined){
for (var hms_code of msg.payload.print.hms) {
var attr = DecimalHexTwosComplement(hms_code.attr);
var code = DecimalHexTwosComplement(hms_code.code);
let full_code = (attr + code).replace(/(.{4})/g, "$1_");
full_code = full_code.substring(0, full_code.length - 1);
let url = "https://wiki.bambulab.com/en/x1/troubleshooting/hmscode/"+full_code;
template.push({"code": "HMS_"+full_code, "url": url});
}
msg.payload.print.hms = template;
}
- Dominant language
- No language data
- Stars
- 684
- Forks
- 96
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Doridian/OpenBambuAPI
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Doridian/OpenBambuAPI#51 · 8 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Doridian/OpenBambuAPI#10 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
Doridian/OpenBambuAPI#72 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
Doridian/OpenBambuAPI#59 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
Doridian/OpenBambuAPI#56 · 1 comment ·
All issues in Doridian/OpenBambuAPI
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
CopilotKit/OpenDots#55 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pymc-labs/pymc-marketing#3102 · 1 comment ·
Maintainers usually reply within 1 day
-
comp/plugins duplicate P3 platform/slack type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NousResearch/hermes-agent#132594 · 2 comments ·
Maintainers usually reply within 1 day
-
code-review
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100