Recently I’ve purchased EnOcean starting kit as I think that energy harvesting solutions have big potential. They are batteries free therefore maintenance free. This is a big advantage comparing to other technologies. Anyway, the set has a temperature sensor which I’ve added to my OpenRemote controller and after linking it to a label I’ve noticed that its value has 2.5 centigrade offset comparing to my thermostat. Although, EnOcean claims that the sensor is calibrated I trust more my thermostat, the offset is simply too much!
Luckily for OpenRemote this is not a big problem. The solution is as follows:
- have 2 sensors, the real that’s read from the device and a virtual linked to the user interface. Both should be custom sensors with the empty custom states list;
- for the virtual sensor, you would have “In-memory Virtual Command” VTEMP, command: STATUS and address: VTEMP;
- have a rule on the real value, do your computation, then call the write command.
The rule is (checked and tested to work correctly):
rule "Correct Temperature" when CustomState(source=="Temperature", $v: value) then double correctedValue = Double.parseDouble($v.toString()) - 2.5; double fahrenheit = (correctedValue*9) / 5 + 32; execute.command("VTEMP", String.format("%.1f \u2103 / %.1f \u2109", correctedValue, fahrenheit)); end