jeffschubert / homebridge-daikin-oneplus

Homebridge plugin to control a Daikin One+ thermostat
Apache License 2.0
20 stars 7 forks source link

Automation turning thermostat On does not set temperature #29

Open jeffschubert opened 1 year ago

jeffschubert commented 1 year ago

Describe The Bug: A scenario related to #28 and not yet fixed: If the thermostat is off and your automation sets the temp along with turning it on. Specifically if the desired temp is different than when the thermostat was last in the state your automation is going to. For example:

The scenario above is due to how the Home app notifies the plugin of a desired change. It sets each characteristic (mode, target temp, target humidity) of the thermostat individually one after the other. The plugin tells the Daikin API to change each individually. The way it is right now, the plugin (at the point it sets the target temp) doesn't know what the desired state (heat/cool/auto) is. So it isn't able to set the target temp correctly. If you are going to the Auto state it'll work fine, but not if going to Cool or Heat.

To Reproduce: Create an automation in the Home app. Tell it to Heat at a temperature other than the Heat mode is currently set to. Then turn the thermostat off and subsequently trigger the automation. The thermostat will turn on to Heat, but remain at the original target temperature, not the temperature set in the automation.

Expected behavior: The thermostat should be changed to the temperature defined in the automation.

Environment: