Corrected redis sensor code