I'm building a UPS monitor using BTHome. I'm using an INA226 to measure the voltage/current into/out-of the battery.
I'd like to be able to measure the current as positive (discharging) or negative (charging) with a single value, but today the current value is unsigned.
I could use 2 attributes (charge current and discharge current), but that adds an additional 3 bytes to the payload which is more than I can fit in a legacy ADV packet.
Is there any recommendation for how to deal with this?
Add a new attribute type?
abuse the current attribute, and just send it as s32_t?
Use a raw type? (adds 1 byte to the payload)
use the abs-value of the current, and a flag bit to specifiy positive/negative? (adds 2 bytes to the payload)
I'm building a UPS monitor using BTHome. I'm using an INA226 to measure the voltage/current into/out-of the battery. I'd like to be able to measure the current as positive (discharging) or negative (charging) with a single value, but today the current value is unsigned. I could use 2 attributes (charge current and discharge current), but that adds an additional 3 bytes to the payload which is more than I can fit in a legacy ADV packet. Is there any recommendation for how to deal with this? Add a new attribute type? abuse the current attribute, and just send it as s32_t? Use a raw type? (adds 1 byte to the payload) use the abs-value of the current, and a flag bit to specifiy positive/negative? (adds 2 bytes to the payload)