mitsubishi2MQTT
mitsubishi2MQTT copied to clipboard
Dropping decimal places when setting Celsius temperature setting.
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.
I have the same problem with the "toInt()". I changed in this file all three in "toFloat()".
Put in a pull request for this - compiled a local BIN to test, and validated as working on my PVA (@0.5 Celsius increments)