Venstar Thermostat fractional celsius temperatures

  • Platform information:
    • Hardware: Pi 3+
    • openHAB version: 3.01

Hello, I’m still pretty green to openHAB, but it’s getting easier after a bit of initial hair pulling.

I bought a Venstar ColorTouch thermostat to add to my little project.

I’ve been able to get most of it going as planned with one tiny, but annoying exception.

I have the thermostat displaying in celsius. openHAB shows me fractional temps (ex 25.5, 24.5) for current set temperatures, and current read temperature without issue.

The problem I am having is that if I try to change the temperature via openHAB it always snaps to a whole number after a second or two. Even opening the UI seems without clicking anything seems to do this if its open for the period of the refresh window.

I saw that someone else here was looking to develop the binding more fully (which would be awesome since I’d like to control the Fan as well), but more immediately I’d like to know ifI have a UI issue that I can resolve, or is this a binding issue?

Thanks in advance for any tips.

Is it also sending a whole number to the thermostat, or just not displaying the right temperature setting in the UI? Screen shots are very helpful if you can grab one from the UI you are using.

The following shows in the log viewer when I do the following.

UI shows 21.0
I click negative on stepper widget with 0.5 steps set
It shows 20.5 for a moment and then drops again to 20.0 with no intervention on my part.

2021-05-22 11:54:59.051 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ColorTouchThermostat_HeatingSetpoint’ received command 20.5
2021-05-22 11:54:59.069 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘ColorTouchThermostat_HeatingSetpoint’ predicted to become 20.5
2021-05-22 11:54:59.083 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘ColorTouchThermostat_HeatingSetpoint’ changed from 21.0 to 20.5
2021-05-22 11:55:01.457 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘ColorTouchThermostat_HeatingSetpoint’ changed from 20.5 to 20.0

Here is where it gets fun. If I increase from 20 to 20.5, it snaps back to 20 on its own.

2021-05-22 12:00:33.726 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ColorTouchThermostat_HeatingSetpoint’ received command 20.5
2021-05-22 12:00:33.738 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘ColorTouchThermostat_HeatingSetpoint’ predicted to become 20.5
2021-05-22 12:00:33.744 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘ColorTouchThermostat_HeatingSetpoint’ changed from 20.0 to 20.5
2021-05-22 12:00:36.086 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘ColorTouchThermostat_HeatingSetpoint’ changed from 20.5 to 20.0

If I bump it up two steps to 21, it stays.

2021-05-22 12:03:11.009 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ColorTouchThermostat_HeatingSetpoint’ received command 20.5
2021-05-22 12:03:11.019 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘ColorTouchThermostat_HeatingSetpoint’ predicted to become 20.5
2021-05-22 12:03:11.024 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘ColorTouchThermostat_HeatingSetpoint’ changed from 20.0 to 20.5
2021-05-22 12:03:11.316 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ColorTouchThermostat_HeatingSetpoint’ received command 21
2021-05-22 12:03:11.325 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘ColorTouchThermostat_HeatingSetpoint’ predicted to become 21
2021-05-22 12:03:11.331 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item ‘ColorTouchThermostat_HeatingSetpoint’ changed from 20.5 to 21

Thanks, but in regards to my original question, is it sending a whole number or decimal to your thermostat? Can you check what your physical thermostat says on its screen? This feels like an issue in the binding, the API docs from venstar don’t actually give decimal examples, so it might be we are sending them incorrectly. From the logs it seems like we are reading from the thermostat a whole number a few seconds after the command is set, which snaps the UI back.

Just as background, because decimal separators can vary by locale (typically , instead of .) probably worth describing yours.

One last thing, if you are able to use the console (The Console | openHAB ), enabling the debug log would give us a lot of information, the command would be

log:set DEBUG org.openhab.binding.venstarthermostat

I just checked and sure enough the thermostat never shows a 0.5 value in the set field.

I also just looked over the API docs as well, I wonder if may it was an integer field, but then it does show the decimals on all temp fields…

http query shows:
{“name”:“Thermostat”,“mode”:2,“state”:0,“fan”:1,“fanstate”:1,“tempunits”:1,“schedule”:0,“schedulepart”:255,“away”:0,“spacetemp”:26.0,“heattemp”:21.0,“cooltemp”:26.0,“cooltempmin”:21.0,“cooltempmax”:37.0,“heattempmin”:1.5,“heattempmax”:26.5,“activestage”:0,“hum_active”:0,“hum”:44,“hum_setpoint”:0,“dehum_setpoint”:99,“setpointdelta”:2.0,“availablemodes”:0}

I’m trying to manually post controls to it, but I haven’t done any of this type of stuff in years, so I’m very rusty.

If you could enable the debug logs, this will dump a lot of information and probably save a ton of time.

1 Like

Never mind, i see the issue in the code, there is specifically a function to round the temp before we send it, i have no recollection of why that is there ( there was probably a reason) , but will take a look at it again.

1 Like

Thank-you.

Maybe the rounding was put in to deal with Fahrenheit?

Perhaps [tempunits] could be used as a condition for what to do with decimals in that case? Round to nearest 0.5 if tempunits = 1 or something like that.

I appreciate the help.

its actually just a sloppy use of int vs float in the code, the rounding logic just makes sure we are sending in half steps (.5) and not something in between (so .3) as thats what venstar supports. So there was intent to support half steps, it just was not tested :slight_smile:

1 Like

I have a PR in progress i will test a little later today

1 Like

Much appreciated.

Continuing the discussion from Venstar Thermostat fractional celsius temperatures:

I am planning to do some more development on the binding, I guess you are referring to me. What fan functionality did you want to include? Did you want to try programming it yourself, or did you want someone else to do it? I don’t have a fan so won’t be able to test it. The code in my previous PR got approved, so the binding now includes a basic function corresponding to the API “/settings” URL which can be expanded (It currently only includes thermostat home/away mode). It also includes a function corresponding to the API “/control” URL which can be expanded. I’m a hobby / spare time programmer…so no promises on timing to do this :slight_smile:

The fan only has an Auto or On setting, that’s what I’d like to have added.

I was going to wait for digitaldan to merge the code normalizing the temperature variable type, and then have a more thorough look at the existing code to see if its something I think I can tackle. I haven’t done anything like this in a LONG time, so for now I think its safer in other hands.