Read error is indicated with humidity = nil
ake some adjustments because of the optimization using local variables