openHAB 2.4.0~20181105174706-1 (Build #1413)
Linux openHABianPi 4.14.71-v7+ #1145 SMP Fri Sep 21 15:38:35 BST 2018 armv7l
Release = Raspbian GNU/Linux 9 (stretch)
Kernel = Linux 4.14.71-v7+
Platform = Raspberry Pi 3 Model B Rev 1.2
This crude rule “widens” the target temperature windows. It used to do what I intended. It ran yesterday but failed. Now that the Item types for the Nest binding have changed, it appears that my calculation logic now has mismatched data types. The target values are OK, but when I adjust them with a local constant, they are out of whack and of course way out of limits for the API.
rule "Adjust Nest Thermostat Targets"
when
Item gInTown changed
then
val Number TARGET_ADJUST = 3.0
logInfo("my_log", "Adjust Nest Thermostat Targets - Nest max = {}", TargetTemperatureMax.state)
logInfo("my_log", "Adjust Nest Thermostat Targets - Nest min = {}", TargetTemperatureMin.state)
var TargetMax = TargetTemperatureMax.state as Number
var TargetMin = TargetTemperatureMin.state as Number
logInfo("my_log", "Adjust Nest Thermostat Targets - TargetMax = {}", TargetMax)
logInfo("my_log", "Adjust Nest Thermostat Targets - TargetMin = {}", TargetMin)
if (nestStructureAway.state == "HOME")
{
if (gInTown.state == OFF)
{
TargetMax = TargetMax + TARGET_ADJUST
TargetMin = TargetMin - TARGET_ADJUST
}
else
{
if ((TargetMax - TargetMin) >= (3.0 + (2 * TARGET_ADJUST)))
{
TargetMax = TargetMax - TARGET_ADJUST
TargetMin = TargetMin + TARGET_ADJUST
}
}
logInfo("my_log", "Adjust Nest Thermostat Targets - Adj. TargetMax = {}", TargetMax)
logInfo("my_log", "Adjust Nest Thermostat Targets - Adj. TargetMin = {}", TargetMin)
if (TargetTemperatureMax.state != TargetMax)
TargetTemperatureMax.sendCommand(TargetMax)
if (TargetTemperatureMin.state != TargetMin)
TargetTemperatureMin.sendCommand(TargetMin)
}
end
[INFO ] [pse.smarthome.model.script.SPT_house] - Running rule Away Lights Off - out of Town region.
[INFO ] [pse.smarthome.model.script.SPT_house] - Adjust Nest Thermostat Targets - Nest max = 76.0 °F
[INFO ] [pse.smarthome.model.script.SPT_house] - Adjust Nest Thermostat Targets - Nest min = 72.0 °F
[INFO ] [pse.smarthome.model.script.SPT_house] - Adjust Nest Thermostat Targets - TargetMax = 76.0 °F
[INFO ] [pse.smarthome.model.script.SPT_house] - Adjust Nest Thermostat Targets - TargetMin = 72.0 °F
[INFO ] [pse.smarthome.model.script.SPT_house] - Adjust Nest Thermostat Targets - Out of town temperatures
[INFO ] [pse.smarthome.model.script.SPT_house] - Adjust Nest Thermostat Targets - Adj. TargetMax = 300.5944444444444444444444444444444
[INFO ] [pse.smarthome.model.script.SPT_house] - Adjust Nest Thermostat Targets - Adj. TargetMin = 292.3722222222222222222222222222222
[INFO ] [pse.smarthome.model.script.SPT_house] - Running rule Back Bedroom Ceiling Fan Send Speed.
[ome.event.ItemCommandEvent] - Item 'SPT_house_FF_hallway_wall_sensor_thermostat_TargetTemperatureMax' received command 300.5944444444444444444444444444444
[ome.event.ItemCommandEvent] - Item 'SPT_house_FF_hallway_wall_sensor_thermostat_TargetTemperatureMin' received command 292.3722222222222222222222222222222
[nt.ItemStatePredictedEvent] - SPT_house_FF_hallway_wall_sensor_thermostat_TargetTemperatureMax predicted to become 300.5944444444444444444444444444444
[nt.ItemStatePredictedEvent] - SPT_house_FF_hallway_wall_sensor_thermostat_TargetTemperatureMin predicted to become 292.3722222222222222222222222222222
[WARN ] [t.internal.handler.NestBridgeHandler] - Nest API error: Temperature F value is too high: 301.0
[WARN ] [t.internal.handler.NestBridgeHandler] - Nest API error: Cannot set target low temperature '292.0' higher than target high temperature '76.0'
Regards.
Mike