Boom, back in business. Thanks Simon. That code makes much more sense to me now with those new parentheses locations.
No worries, thankfully it also makes more sense to the system as well
Also, more generally for everyone, from some of the digging I have done with @peterbrown77.pb around his issue, I suspect when setting mode and temperature through some of the built-in apps, potentially things like RM or the Thermostat Controller app (not sure of the exact name), I think the issue may be the way I am trying to store and then read the operating state / mode. I believe I may have a fix for this, just need to make the updates in the code.
If anyone else has had issues with setting mode and temperature in some way, apart from the various issues I still need to get back to ..... Let me know and we can test whether my changes fix the issue for you.
If anyone else has had issues with setting mode and temperature in some way
These were the other issues I was alluding to in my original post. Hadn't had a chance to read back through all your work with Peter, nor play with mine enough to properly characterize the issue. But happy to test out changes when you have some available to see if that makes my setpoint and mode functionality work better.
I think they should be relatively benign changes, I'll go through and update a few things now, then we can see how that goes, but no pressure / rush to test them.
1.0.17 - Released a short time ago to fix temperature conversion error reported by @jlupien
1.0.18 - Released just now, adjustments to reading of attributes when checking current state of the thermostat. @peterbrown77.pb - This may resolve some of your issues when adjusting the mode and temperature in quick succession. It may help others who have also seen issues with temperature changes not taking effect.
1.0.19 - Released just now, This will definitely fix issues that I expect people like @mikkomattip may have been seeing with temperature change issues (not your HTTP error we have been looking at).
I get an error when using HPM to update parent driver so I manually updated the parent device driver using the code (https://raw.githubusercontent.com/sburke781/hubitat/master/UnifiedThermostat/UnifiedThermostatParent_Driver.groovy) which was confusing because the 1.0.19 version is not indicated in the code anywhere I can see. Here is the HPM error:
Error Occurred During Installation
An error occurred while installing the package: Failed to upgrade driver https://raw.githubusercontent.com/sburke781/hubitat/master/UnifiedThermostat/UnifiedThermostatParent_Driver.groovy. Be sure the package is not in use with devices.
I adjusted the Kumo iphone app temp setpoints in 1F increments and checked hubitat "thermostat setpoint" in the unified thermostat device. What I discovered is that the Kumo app is converting the F integer setpoints to 0.5C increments but with some non algorithmic fudging. It would be very cool if your app could have an option to "Use kumo iphone app compatible F setpoints" and convert whatever the user inputs to the nearest permissible value in the table. It is very disconcerting to have the Kumo app display a -- setpoint value after adjusting the setpoint in the hubitat app. I verified that when I set the allowable F setpoints in hubitat that the expected F value shows up in the iphone app. If I try to set a setpoint that is just 0.1F off from a permissible value, the app shows -- as the setpoint. Also if i manually set hubitat setpoint to 66.2 which does not show up in the table, 67F shows up in the Kumo app meaning that either the missing 66.2 or 67.1 work with the app and both show up as 67 Here is the data:
And here is the result of setting blower to 70.0F in unified thermostat. Notice the -- for the setpoint.
Were you able to resolve this error? How were you trying to update the driver in HPM? Using the update option? In terms of the version, it relates to the version of the parent and child driver combined, with many of the most recent changes being made in the child driver, which is where the 1.0.19 reference is made in the comments at the top of the driver code.
Thanks for such detailed testing and reporting back of the results, that will be quite useful I expect. This is something I have been meaning to get back to. The Kumo Cloud (and I suspect the local adaptors) actually operate in Celsius, i.e. the drivers convert your settings in HE to Celsius, send those to Kumo and it reports back in Celsius, which again needs to be converted. I suspect it will come down to the HE drivers dealing with the different values in not enough precision to allow for the most accurate translation. I will see what I can do in terms of dealing with more precise values and see if that helps.
I was using HPM "update" button and I was unable to resolve the error.
Hmmm... That is odd. I'll see what I can work out but it may be overnight for you ...
I usually default to 0.5°C for precision and use something similar to this to handle the conversions:
…
if(useFahrenheit){
hold = temp
temp = fahrenheitToCelsius(temp).toFloat().round(1)
temp = checkForAdj(hold, temp)
} else
temp = normalizeTemp(temp)
…
Float normalizeTemp(temp) { //limits to x.5 or x.0
Float nTemp = ((int) (temp*2 + 0.5))/2.0
}
Float checkForAdj(hold, temp) {
temp = normalizeTemp(temp)
if(celsiusToFahrenheit(temp).toFloat().round(0) < hold)
temp += 0.5
return temp
}
I think I will need some debug logs to properly understand what may be going on... Staring at the screen and the code, along with some test code to see if I had missed something, hasn't produced any results... While @thebearmay's code seems a likely addition, it still bugs me I can't figure out where the problem is before I try adding something new.
If you could turn on the debug logging option in the parent device and run one or two of the temp change tests you did again and pm me the logs that would be great.
I'd also be interested in what version of the child driver you are running, according to the comments at the top of the driver code. Let me know if you need a hand to find this...
I'll see what I can work out with the HPM error you are seeing, not something I saw on my hubs...
On initial checks this seems to have resolved things. Rules without the extra workaround seem to be able to send both a state change and temperature change in one command and they are both reflected in the melview. I'll explore more but on initial obs it looks good
Nothing overtly wrong in the debug log. What might be going on is that the temperature is able to be set by the unified driver but the kumo iphone app is unable to display the setpoint unless it is in the list of setpoints in the table I sent previously. Child device handler is 1.0.19. But I have no way to see if the setpoint was actually accepted by the minisplit. Maybe it was not. That is why it is disconcerting. Here is the log:
2022-07-08 04:21:32.595 pm debugsetTemperature: Temperature adjusted to 70.0 for Kumo - Blower
dev:21142022-07-08 04:21:32.589 pm debugsetTemperature_KumoCloud: Unit Command submitted
dev:21142022-07-08 04:21:32.583 pm debugunitCommand: Initial data returned from unitCommand: [true, null, [[1434P008A100125F, 2253363181806569]]], response received 2022-07-08 20:21:32.576Z
dev:21142022-07-08 04:21:32.195 pm debugunitCommand_KumoCloud: Body of command = ["8248b6ec01e5213a398c4a182cb7d076",{"1434P008A100125F":{"spCool":21.11111}}]
dev:21142022-07-08 04:21:32.184 pm debugsetTemperature_KumoCloud: Body JSON = {"spCool":21.11111}
dev:21142022-07-08 04:21:32.178 pm debugsetTemperature: Set Temperature Provided = 70.0, converted to 21.1111111111 for KumoCloud
dev:21142022-07-08 04:21:32.161 pm debugadjustCoolingSetpoint: Current coolingSetpoint 70.0, Current ThermostatSetpoint = 70.0, New coolingSetpoint = 70.0
dev:21142022-07-08 04:21:32.155 pm debugadjustSetTemperature: Cooling / Drying mode detected, adjusting cooling set point
dev:21142022-07-08 04:21:32.149 pm debugadjustSetTemperature: Current mode is cool
dev:21142022-07-08 04:21:32.142 pm debugadjustSetTemperature: Changing Set Temperature from 72.0 to 70.0
dev:21142022-07-08 04:21:32.136 pm debugadjustSetTemperature: Temperature passed in was 70 which was parsed as 70.0, current set temperature is 72.0
dev:21142022-07-08 04:21:32.129 pm debugsetTemperature: Setting Temperature to 70.0 for Kumo - Blower
dev:21142022-07-08 04:21:32.123 pm debugsetTemperature: givenSetTemp = 70, currentThermSetTempValue = 72.0
dev:21142022-07-08 04:21:32.111 pm infoCooling Set Point adjusted to 70.0 for Kumo - Blower
dev:21142022-07-08 04:21:32.104 pm debugadjustCoolingSetpoint: Current coolingSetpoint 72.0, Current ThermostatSetpoint = 72.0, New coolingSetpoint = 70.0
dev:21142022-07-08 04:21:32.096 pm debugsetCoolingSetpoint: Setting Cooling Set Point to 70, current minimum 67.1, current maximum 82.4
Maybe the HPM error I am seeing is due to some sort of corruption on my device and not a widespread problem
Can you shown me the logs after you do a refresh please.
Released another small update (1.0.20) for an issue @waterwynde reported where minimum heating set point is not something Kumo enforces, whereas I had included this and a restriction on a maximum cooling set point. These have now been removed across all platforms.
Refresh on blower device at a Kumo iphone app compatible temperature:
21142022-07-09 08:08:56.499 am debugapplyResponseStatus: Status update complete
dev:21142022-07-09 08:08:56.493 am debugadjustThermostatFanMode: No change to Fan Speed detected, no action taken
dev:21142022-07-09 08:08:56.487 am debugadjustThermostatFanMode: No change to Fan Mode detected, no action taken
dev:21142022-07-09 08:08:56.481 am debugadjustThermostatFanMode: MEL Fan Mode Key 0 parsed as HE Fan Mode Value Auto and HE Fan Speed auto
dev:21142022-07-09 08:08:56.473 am debugadjustSetTemperature: No action taken, either no change in temperature or null temperature provided
dev:21142022-07-09 08:08:56.467 am debugadjustSetTemperature: Temperature passed in was 71.6 which was parsed as 71.6, current set temperature is 71.6
dev:21142022-07-09 08:08:56.459 am debugadjustRoomTemperature: No action taken
dev:21142022-07-09 08:08:56.454 am debugadjustRoomTemperature: Temperature provided = 70.7
dev:21142022-07-09 08:08:56.441 am debugapplyStatusUpdates: About to adjust temperatures...
dev:21142022-07-09 08:08:56.435 am debugadjustThermostatOperatingState: Thermostat Mode passed in = 3, Power passed in 1, OperatingState: cooling
dev:21142022-07-09 08:08:56.428 am debugadjustThermostatMode: Thermostat Mode provided 3, Power provided 1, parsed as Mode Description cool
dev:21142022-07-09 08:08:56.422 am debugadjustThermostatMode: Adjust Thermostat Mode called
dev:21142022-07-09 08:08:56.415 am debugapplyStatusUpdates: About to adjust thermostat mode details...
dev:21142022-07-09 08:08:56.408 am debugapplyStatusUpdates: statusIsCurrent = 1
dev:21142022-07-09 08:08:56.402 am debugapplyResponseStatus: lastCommandUTC_Date = Fri Jul 08 20:21:32 EDT 2022, statusAsAt_Date = Sat Jul 09 12:08:24 EDT 2022
dev:21142022-07-09 08:08:56.395 am debugapplyResponseStatus: lastCommandUTC = 2022-07-08 20:21:32.575Z, 2022-07-09T12:08:24.953Z
dev:21142022-07-09 08:08:56.389 am debugapplyResponseStatus: Status Info: [unitId:1434P008A100125F, statusAsAt:2022-07-09T12:08:24.953Z, power:1, setMode:3, roomTemp:70.7, setTemp:71.6, setFan:0]
dev:21142022-07-09 08:08:56.362 am debugretrieveStatusInfo_KumoCloud: Status Info - [unitId:1434P008A100125F, statusAsAt:2022-07-09T12:08:24.953Z, power:1, setMode:3, roomTemp:21.5, setTemp:22, setFan:0]
dev:21142022-07-09 08:08:56.355 am debugretrieveStatusInfo_KumoCloud: response - [true, null, [[[id:2253363478068252, record_time:2022-07-09T12:08:24.953Z, device_serial:1434P008A100125F, it_status:null, rssi:-60, power:1, operation_mode:3, set_temp:null, set_temp_a:null, fan_speed:0, air_direction:1, prohibit_local_remote_control:null, room_temp:21.5, room_temp_beyond:null, room_temp_a:null, out_of_use:null, unusual_figures:32768, two_figures_code:A0, status_display:0, actual_fan_speed:null, sp_cool:22, sp_heat:16, sp_auto:-1, raw_frames:null, run_test:0, active_thermistor:null, temp_source:null, seconds_since_contact:33]], []]]
dev:21142022-07-09 08:08:55.950 am debugretrieveStatusInfo: Retrieving status info from KumoCloud
dev:21142022-07-09 08:08:55.938 am debugrefresh: Refresh process called
And here is a refresh after setting temp to the troublesome temperature of 70.0:
dev:21142022-07-09 08:21:05.188 am debugapplyResponseStatus: Status update complete
dev:21142022-07-09 08:21:05.182 am debugadjustThermostatFanMode: No change to Fan Speed detected, no action taken
dev:21142022-07-09 08:21:05.176 am debugadjustThermostatFanMode: No change to Fan Mode detected, no action taken
dev:21142022-07-09 08:21:05.169 am debugadjustThermostatFanMode: MEL Fan Mode Key 0 parsed as HE Fan Mode Value Auto and HE Fan Speed auto
dev:21142022-07-09 08:21:05.162 am debugadjustSetTemperature: No action taken, either no change in temperature or null temperature provided
dev:21142022-07-09 08:21:05.155 am debugadjustSetTemperature: Temperature passed in was 69.9999786376953125 which was parsed as 70.0, current set temperature is 70.0
dev:21142022-07-09 08:21:05.147 am debugadjustRoomTemperature: No action taken
dev:21142022-07-09 08:21:05.140 am debugadjustRoomTemperature: Temperature provided = 70.7
dev:21142022-07-09 08:21:05.128 am debugapplyStatusUpdates: About to adjust temperatures...
dev:21142022-07-09 08:21:05.122 am debugadjustThermostatOperatingState: Thermostat Mode passed in = 3, Power passed in 1, OperatingState: cooling
dev:21142022-07-09 08:21:05.115 am debugadjustThermostatMode: Thermostat Mode provided 3, Power provided 1, parsed as Mode Description cool
dev:21142022-07-09 08:21:05.108 am debugadjustThermostatMode: Adjust Thermostat Mode called
dev:21142022-07-09 08:21:05.101 am debugapplyStatusUpdates: About to adjust thermostat mode details...
dev:21142022-07-09 08:21:05.095 am debugapplyStatusUpdates: statusIsCurrent = 1
dev:21142022-07-09 08:21:05.089 am debugapplyResponseStatus: lastCommandUTC_Date = Sat Jul 09 12:14:03 EDT 2022, statusAsAt_Date = Sat Jul 09 12:20:25 EDT 2022
dev:21142022-07-09 08:21:05.081 am debugapplyResponseStatus: lastCommandUTC = 2022-07-09 12:14:03.566Z, 2022-07-09T12:20:25.819Z
dev:21142022-07-09 08:21:05.075 am debugapplyResponseStatus: Status Info: [unitId:1434P008A100125F, statusAsAt:2022-07-09T12:20:25.819Z, power:1, setMode:3, roomTemp:70.7, setTemp:69.9999786376953125, setFan:0]
dev:21142022-07-09 08:21:05.044 am debugretrieveStatusInfo_KumoCloud: Status Info - [unitId:1434P008A100125F, statusAsAt:2022-07-09T12:20:25.819Z, power:1, setMode:3, roomTemp:21.5, setTemp:21.1111, setFan:0]
dev:21142022-07-09 08:21:05.035 am debugretrieveStatusInfo_KumoCloud: response - [true, null, [[[id:2253363478071665, record_time:2022-07-09T12:20:25.819Z, device_serial:1434P008A100125F, it_status:null, rssi:-60, power:1, operation_mode:3, set_temp:null, set_temp_a:null, fan_speed:0, air_direction:1, prohibit_local_remote_control:null, room_temp:21.5, room_temp_beyond:null, room_temp_a:null, out_of_use:null, unusual_figures:32768, two_figures_code:A0, status_display:0, actual_fan_speed:null, sp_cool:21.1111, sp_heat:16, sp_auto:-1, raw_frames:null, run_test:0, active_thermistor:null, temp_source:null, seconds_since_contact:41]], []]]
dev:21142022-07-09 08:21:04.581 am debugretrieveStatusInfo: Retrieving status info from KumoCloud
dev:21142022-07-09 08:21:04.570 am debugrefresh: Refresh process called