Syncing Thermostat Temperature and Temp Change Commands

Some time ago I developed an integration (device driver) for my Mitsubishi air conditioner, which I'll release one day on the community... Here is Australia and NZ (and in parts of Europe I have since found out) Mitsubishi operate a cloud based service (not Kumo) allowing use of their Wifi Control phone app. The API I have used hooks into the same service.

One thing that I have grappled with is adjusting the temperature setting. I can send API commands successfully to adjust the temperature, and often they will take effect. I do, however, have a "refresh" process on a timed schedule in RM that looks up the current status of the air conditioner in the cloud and updates these details in the device, allowing for changes made through the wall controller or my phone to be reflected in HE. What can happen is that if there is any delay in applying the change in temperature command in the cloud, issued from say a HE dashboard tile, if the old temperature is read by the refresh process in my HE rule, it can sometimes revert the temperature in HE to the original reading, which in turn updates the air conditioner, if that makes sense.

I already have a few ideas on how best to solve this, e.g. putting some kind of hold on the refresh running until the change in temperature has been applied, etc. I just wanted to see if anyone else had any suggestions or examples of ways to approach this problem.

Thanks,
Simon

Looking at the code again and an error that was logged, looks like the main problem was an attempt call to a toDecimal method, where I needed to call toBigDecimal, that at least makes the temperature change from my dashboard take effect.

I still plan to update the refresh process so it only updates the state variables / attributes, and does not initiate a change of temperature command.

Hi @sburke781
Did you manage to set the air conditioning controls into the HE dashboard? Which template should I use?

Yes, the decimal conversion was my main problem. I used the thermostat template for my tile.