mitsubishi2MQTT icon indicating copy to clipboard operation
mitsubishi2MQTT copied to clipboard

Dropping decimal places when setting Celsius temperature setting.

Open mminehanNZ opened this issue 2 years ago • 2 comments

When using the html page (or post using http) the half degrees (i.e. 0.5) are being ignored. So if you try and set it to 22.5 degrees it sets to 22 degrees. Using MQTT to set the set point works fine. It's just the html bit that doesn't.

Seth on the Heat-Pump gitter lobby isolated the issue to line 1207 in mitsubishi2mqtt.ino (or there abouts). There's a toInt function that is truncating the decimal places:

if (server.hasArg("TEMP")) {
      settings.temperature = convertLocalUnitToCelsius(server.arg("TEMP").toInt(), useFahrenheit);
      update = true;

So I changed it to a toFloat function:

if (server.hasArg("TEMP")) {
      settings.temperature = convertLocalUnitToCelsius(server.arg("TEMP").toFloat(), useFahrenheit);
      update = true;

I'm not very adept at Github so not sure how to make this a fork or pull request etc.

Cheers, Marty.

mminehanNZ avatar Jul 16 '22 20:07 mminehanNZ

I have the same problem with the "toInt()". I changed in this file all three in "toFloat()".

robgru avatar Dec 11 '22 19:12 robgru

Put in a pull request for this - compiled a local BIN to test, and validated as working on my PVA (@0.5 Celsius increments)

prashker avatar Apr 10 '23 13:04 prashker