Develop a driver - (Venstar Thermostat Driver Development)

Hit decrease temp 2 times on the tile:

dev:5872019-11-03 23:12:53.838 debuggetapi: getapi() completed

dev:5872019-11-03 23:12:53.836 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:53.833 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:53.822 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:53.816 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:53.811 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:53.791 debugparseJsonData: data is: [name:Dom, mode:1, state:0, fan:0, fanstate:0, tempunits:1, schedule:0, schedulepart:255, away:0, spacetemp:22.0, heattemp:20.0, cooltemp:9.0, cooltempmin:1.5, cooltempmax:37.0, heattempmin:1.50, heattempmax:37.0, setpointdelta:2.0, availablemodes:1]

dev:5872019-11-03 23:12:53.789 debuggetapi: httpGet returned: [name:Dom, mode:1, state:0, fan:0, fanstate:0, tempunits:1, schedule:0, schedulepart:255, away:0, spacetemp:22.0, heattemp:20.0, cooltemp:9.0, cooltempmin:1.5, cooltempmax:37.0, heattempmin:1.50, heattempmax:37.0, setpointdelta:2.0, availablemodes:1]

dev:5872019-11-03 23:12:53.725 debuggetapi: Executing get api to http://192.168.1.254/query/info

dev:5872019-11-03 23:12:53.723 debugpostapi: httpGet returned success

dev:5872019-11-03 23:12:53.720 debugpostapi: httpPost returned: [success:true]

dev:5872019-11-03 23:12:53.615 infopostapi: Sending on POST request to [http://192.168.1.254/control] with command [mode=1&fan=0&heattemp=20&cooltemp=9.0]

dev:5872019-11-03 23:12:53.612 infopostapi: Executing API Control update

dev:5872019-11-03 23:12:53.609 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:53.607 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:53.604 debugExecuting 'setHeatingSetpoint' with 20

dev:5872019-11-03 23:12:53.602 debuggetTemperatureVS: temperatureScale - VS = C HE = C

dev:5872019-11-03 23:12:52.212 debuggetapi: getapi() completed

dev:5872019-11-03 23:12:52.209 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:52.200 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:52.189 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:52.186 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:52.162 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:52.145 debugparseJsonData: data is: [name:Dom, mode:1, state:0, fan:0, fanstate:0, tempunits:1, schedule:0, schedulepart:255, away:0, spacetemp:22.0, heattemp:21.0, cooltemp:9.0, cooltempmin:1.5, cooltempmax:37.0, heattempmin:1.50, heattempmax:37.0, setpointdelta:2.0, availablemodes:1]

dev:5872019-11-03 23:12:52.142 debuggetapi: httpGet returned: [name:Dom, mode:1, state:0, fan:0, fanstate:0, tempunits:1, schedule:0, schedulepart:255, away:0, spacetemp:22.0, heattemp:21.0, cooltemp:9.0, cooltempmin:1.5, cooltempmax:37.0, heattempmin:1.50, heattempmax:37.0, setpointdelta:2.0, availablemodes:1]

dev:5872019-11-03 23:12:52.091 debuggetapi: Executing get api to http://192.168.1.254/query/info

dev:5872019-11-03 23:12:52.089 debugpostapi: httpGet returned success

dev:5872019-11-03 23:12:52.085 debugpostapi: httpPost returned: [success:true]

dev:5872019-11-03 23:12:51.960 infopostapi: Sending on POST request to [http://192.168.1.254/control] with command [mode=1&fan=0&heattemp=21&cooltemp=9.0]

dev:5872019-11-03 23:12:51.954 infopostapi: Executing API Control update

dev:5872019-11-03 23:12:51.952 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:51.940 debuggetTemperatureHE: temperatureScale - HE = C VS = C

dev:5872019-11-03 23:12:51.937 debugExecuting 'setHeatingSetpoint' with 21

dev:5872019-11-03 23:12:51.935 debuggetTemperatureVS: temperatureScale - VS = C HE = C

And on the device commands: set 22.5, status updated to 22.0
BUT if I change on the thermostat the temp setting and put 22.5, device commands will update the value to 22.5 !

Alright.

This should be it... I think I found the bug in setting the heating/cooling setpoints, and the 0.5 degree setpoint accuracy...

UPDATE: Removed old version...

in fact, you found it !
It works, on the device:commands AND in the tile itself: the 0.5 degree increase/decrease is accepted. You did an excellent work in a quick.
I spared a lot of time by not learning how to program devices on HE :pensive: (next time).

Another question (if not abusing your time): when the thermostat is in idle mode, in heat mode for now, but not heating (because temp asked is equal to temp measured), the venstar state variable is equal to 0. When heating (and I suppose cooling), the venstar state variable is equal to 1.
Is it possible to define a variable/attribute ("Idle/running") to reflect the state of the thermostat, so I can use it in display/rules ?

IF (thermostatStateMode.) = 0 then ...

The state variables are not exposed outside the driver, and can not be accessed by RM or dashboard tiles (or anything else).

The "Attribute" tile you show is a dashboard template. The template is coded to have the supported "Current States" available... You will notice that I have added a current state for "thermostatFanOperatingMode" (The is because the fan can be on even when the thermostat is idle - and the thermostat capability does not have an attribute for the fan state) ... But it does not appear in the attribute list. That is because, even though it has been added to the driver, the system does not recognize it.

So... You would need to reference an existing and supported attribute...

You now have a non-working and a working example of the driver. You can study the differences to learn what is needed. 8-}

I found a few minor bugs and a logic error in the data parsing... and there is some unneeded code still hanging around... I'll do a cleanup and post the update later today.

1 Like

You're absolutely right ! I'll dig into it to learn the differences. with a real device, it's easier to understand because you see directly the mistakes...

Anyway, again:
thankyou

And here is the (hopefully) final version...

Includes minor bug fixes, code cleanup and changes to make setting the thermostat mode and fan mode from the dashboard tile work properly.

UPDATE: Removed old version...

2 Likes

Thank you so much for doing this! It's simply awesome! Works great with my T7850.

I'm not sure what I'm going to do with it yet... but plans are starting to form.

you'll agree that this little unit is nice, right ? And it's one of the few "smart" who has an external sensor and now compatible with Hubitat !

I love the external sensors and the web interface/phone app. I do with the external sensor was smaller. But all things considered, it's a great unit. I haven't been at all tempted to replace it.

@PPz, @jabecker Do either of you have the external sensor??? The driver does not support reading the the external sensors, humidity, alerts or settings control... But they can be added if needed.

Yes I have the external one. For now I swapped to the internal to avoid problems with the driver, but the idea is to use the external probe because the thermostat itself will be located in a different room (because of my Hubitat tablet that will replace the physical thermostat).

But I need to install the latest update and look at the differences :innocent:

Yes I have the external one as well. I have the internal and external sensors averaged to keep the house temperature more even. The thermostat itself is in a hallway that's always hotter than the rest of the house.

in fact, the sensor sold by venstar is a regular thermistor, and the ACCTSEN sensor and the ACCDSEN sensors are the same type and you can replace them with a same quality (resistance) sensor.


accdsen
thermistor

Is it needed in your latest update to make the T5800 usable ? (yes, I'm reading the code)

This is immaterial (remember... I don't have a Venstar thermostat)...

My question (to put it more succinctly) is: Do you want/desire, the ability to display

  1. Humidity (if reported by thermostat) (possibly child device)
  2. Alerts that are active on the thermostat
  3. external temperature sensors (possibly child device)
  4. Home/Away status of the thermostat (possibly child device)

It is not NEEDED to make the T5800 work... It is NEEDED to allow an "offline test mode"... Which allows me to determine how the data is processed and make changes, even though I do not have a physical Venstar thermostat.

Good. I hope it helps you learn. 8-}

Honnestly, you made far more than expected: you made my T5800 integrated into hubitat.
To answer completely:

  1. personnally, NO. I have a different way to control humidity (through my modbus system/plc)
  2. personally, NO. On a geothermal unit, the only alert is: No electricity
    3) personally, YES. Really useful in my case
  3. personally, NO because with my system, home/away are absolutely not related how the unit should work

that said, @jabecker could find some options interesting/useful for him [her]. Or more generally, useful for others. I really don't want to push you, regarding what you've done for us. It's up to you. If you can learn more (...???...) with this, go ahead. I remembered a guy, days ago, who was bored. Still bored ? :innocent:

Ah. Actually what I was thinking of was the wifi external sensor. That's what I have.
https://venstar.com/thermostats/accessories/wifi-temperature-sensor/

  1. No I don't need humidity.
  2. Might be interesting, but not necessarily useful as the thermostat emails me with alerts.
  3. Yes, see previous post. Temperature only. It actually would be cool to be able to integrate the temp from this sensor into RM since it's in a different room than the Venstar thermostat.
  4. I don't use modes with the thermostat unless I'm going to be gone for multiple days at a time.

P.S. I'm a "her"

1 Like