On a device status message I am seeing batteryLevel of 0, which from docs indicates 0 means external power source. But the external power source field is false. The end device is externally powered, so it seems just the externalPowerSource field is incorrect while the batteryLevel is correct.
Hi @John_Roesler that might be something to fix in the docs, please see the definition of the status message here:
When battery_level_unavailable is set to true, then it means no battery-level status is available. I believe battery_level is actually converted to a percentage.
Ah, so when the batteryLevelUnavailable is true, I should expect batteryLevel to be the zero value the field, in this case 0 and can be ignored.
If the externalPowerSource is coming back false but the device is powered, would that be an issue with how the device is responding to the status message request from chirpstack?
With Protobuf 3 you can’t specify a field as optional, thus it always defaults back to 0 when not set. You are correct that if batteryLevelUnavailable, the rest should be ignored.
If batteryLevelUnavailable is false and externalPowerSource is true, then you can ignore batteryLevel, in the last case you should check batteryLevel (as the device is not powered by an external source).
If one of you would like a pull-request to make the documentation more clear, that would be great