Reading Si7021 firmware version

I have three devices which I believe all have the same Si7021 sensor, but I need to confirm this, since we’re seeing what may be 3 degree differences in temperature readings between the 3 devices (I’m aware of the +/- 0.4 C accuracy).

The Silicon Labs documentation shows command codes (2 of them) to read the firmware version, but I don’t know how to properly send two command codes to the sensor and then read the resulting firmware revision.

I’ve attached a screenshot of what they’re indicating needs to happen.

I’m thinking the following should do the trick, but I don’t want to mess up my Si7021 by writing something that’s potentially damaging.

//used to print hex numbers
function phex(s) {
local h = “”;
for(local i=0;i<s.len();i++) h+=format("%02x",s[i]);
server.log("phex conversion: "+h);

//Reports the firmware version of the Si7021 sensor
function readFW() {
    local reading =, "", 1);
    while (reading == null) {
    reading =, "", 1);
    return reading;

I could then print the results with something like the phex function