Skip to content

feat: Initial support for IBS-P02B - #657

Merged
DigiH merged 9 commits into
theengs:developmentfrom
twardnw:development
Aug 26, 2025
Merged

DigiH merged 9 commits into
theengs:developmentfrom
twardnw:development

Conversation

@twardnw

@twardnw twardnw commented Aug 24, 2025

Copy link
Copy Markdown
Contributor

Adding support for Inkbird IBS-P02B pool thermometer

I have the temperature working, but have been struggling with the battery level and would love some help. Following is a sample of data reported by the ScanAndDecode script.

data sent to decoder:  {"manufacturerdata": "49250327059dde0000005901800000000000", "name": "IBS-P02B", "id": "49:25:03:27:05:9D", "rssi": -59}
TheengsDecoder found device: {"manufacturerdata":"49250327059dde0000005901800000000000","name":"IBS-P02B","id":"49:25:03:27:05:9D","rssi":-59,"brand":"Inkbird","model":"IBS-P02B","model_id":"IBS-P02B","tempc":22.4,"tempf":72.32,"batt":-112}
{"properties":{"tempc":{"unit":"°C","name":"temperature"},"batt":{"unit":"%","name":"battery"}}}
brand: Inkbird , model: IBS-P02B

Here are some sample payloads with differing voltages.

voltage payload
3.0v+ 49250327059dde0000006401800000000000
2.62v 49250327059dde0000003401800000000000
2.22v 49250327059dde0000000201801000000000

Checklist:

  • The pull request is done against the latest development branch
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • I accept the DCO.

battery monitoring still WIP
@DigiH

DigiH commented Aug 24, 2025 •

Copy link
Copy Markdown
Contributor

Hi @twardnw

Thanks for this addition. I don't think that the actual voltage is included in the BLE broadcast data, but it looks like the battery level is

"batt":{
      "decoder":["value_from_hex_data", "manufacturerdata", 20, 2]
   }

should give

voltage payload battery level
3.0v+ 49250327059dde0000006401800000000000 100 %
2.62v 49250327059dde0000003401800000000000 52 %
2.22v 49250327059dde0000000201801000000000 2 %

with index 26 likely also indicating a low battery bit.

Could you also remove these from the decoder

"type":"THERM",
  "cidc":false,

and add

"tag":"0103",

instead, as the type and cidc information is encoded in the tag.

Also the model condition could be amended and extended a bit, e. g.

"condition":["name", "index", 0, "IBS-P02B", "&", "manufacturerdata", "=", 36],

and the model to

"model":" Pool thermometer",

Could you also add a documentation page for the new IBS-P02B pool thermometer, similar to

https://github.com/theengs/decoder/blob/development/docs/devices/IBS-P01B.md

If you are unsure about how to add test cases, I can add these later with your examples given above.

@twardnw

twardnw commented Aug 24, 2025 •

Copy link
Copy Markdown
Contributor Author

Sorry about the docs, forgot to add that to the commit when I pushed the MR.

I incorporated your feedback, the battery pct is working correctly now, and the lowBat is working. Thanks for the help!

Oddly though, I'm getting weird values reported from ScanAndDecode 😕 . The device display always reports the correct temperature, and the Inkbird app picks up the correct temp. But not via the script. Puzzling.

@twardnw

twardnw commented Aug 24, 2025

Copy link
Copy Markdown
Contributor Author

I think the decoder line I committed was the wrong iteration, and now I can't recall which one worked 😆

@twardnw

twardnw commented Aug 24, 2025

Copy link
Copy Markdown
Contributor Author

Here's some more samples, where I know the temp

manufacturerdata known temp
49250327059dd90000006400800000000000 21.7C
49250327059df30000006400800000000000 24.3C
49250327059de30000006400800000000000 22.7C

Running the 13th & 14th characters (d9, f3, e3) through https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ I can see the appropriate value from what they mark as INT16 - Little Endian (BA), but I can't seem to come up with the right combo on the decoder to get a matching value

@twardnw

twardnw commented Aug 24, 2025

Copy link
Copy Markdown
Contributor Author

Oh, is it zero-indexed?

@twardnw

twardnw commented Aug 24, 2025

Copy link
Copy Markdown
Contributor Author

It is 😆

@twardnw

twardnw commented Aug 24, 2025

Copy link
Copy Markdown
Contributor Author

Sample decode using commit 567ab82

TheengsDecoder found device: {"manufacturerdata":"49250327059ddd0000006400800000000000","name":"IBS-P02B","id":"49:25:03:27:05:9D","rssi":-59,"brand":"Inkbird","model":"Pool Thermometer","model_id":"IBS-P02B","type":"THB","cidc":false,"acts":true,"tempc":22.1,"tempf":71.78,"batt":100,"lowBat":"false","displayUnit":"C"}

@DigiH

DigiH commented Aug 25, 2025

Copy link
Copy Markdown
Contributor

Great thanks. Just a few last review comments.

ª In general we have property names all lower case. Could you do that for lowBat and displayUnit.
ª The display unit strings really should also have the degree sign included. i. e.
"decoder":["bit_static_value", "manufacturerdata", 23, 0, "°C", "°F"]
• lowbatt should have two Ls for consistency. It should also be a proper Boolean, not a string - this will auto-discovery it correctly as a binary sensor, with the appropriate icons and labels.

Have a look at the iNode lowbatt for guidance (which I actually had to just fix with the correct device class :)
https://github.com/theengs/decoder/blob/development/src/devices/iNodeEM_json.h#L36-L38

https://github.com/theengs/decoder/blob/development/src/devices/iNodeEM_json.h#L66-L69

@twardnw

twardnw commented Aug 25, 2025

Copy link
Copy Markdown
Contributor Author

ah ha, I had looked through for bool or binary types, didn't realize status is the same. Changes incoming

@DigiH

DigiH commented Aug 26, 2025

Copy link
Copy Markdown
Contributor

Thanks

@DigiH
DigiH merged commit f3064be into theengs:development Aug 26, 2025
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.

2 participants