(EDGE Driver-Mc): Zigbee Temp Sensor and Child Thermostat Mc, Zigbee Temp Sensor with Thermostat Mc

(NEW RELEASE): Edge Driver Zigbee TempSensor and Thermostat Mc:

Version 2 in this link

Version 2.2 in this link

Version 3 in this link

Version 3.5 in this link

Version 4 in this link

Version 4.5 Thermostat Sensors Groups Control

Versions of Zigbee Temp Humidity Sensor Mc driver

Version 2.5 in this link

version 3 in this link

Version 4 in this link

Version 5 in this Link

This new Edge Driver allows you to convert a sensor that has the capability of Temperature into a fully programmable Thermostat that runs locally and usable with Routines and Scenes.

My thanks to @milandjurovic71 for his debugging work and for his always useful ideas and suggestions that it do possible build his idea of a fully operational virtual thermostat on the same driver.
Thanks also to @TAustin for helping me how make code for select which thermostat modes I want use and display.

Zigbee devices that have at least the Capability of TemperatureMesurement can be used.

This capability and all the others that the sensor has, motion, humidity, atmospheric pressure, contact 
 They have to use the Edge default libraries.

One Driver can control all sensors paired independently

For example, it has been tested with a SmartThings (Samjin) motion Sensor and Aqara Weather sensor.

In this link there is a complete manual.pdf for the installation and use of the virtual thermostat edge drivers.

Thermostat Default Capabilities:
1. thermostatMode:
1.1. Asleep: Control Heat and Cool with Presets in Preferences for Heat and Cool Temperature
1.2. Away: Control Heat and Cool with Presets in Preferences for Heat and Cool Temperature
1.3. Auto: Control Heat and Cool with Presets in Heat Preferences for and Cool Temperature
1.4. Rush Hour: Control Heat and Cool with Presets in Preferences for Heat and Cool Temperature
1.5. Cool: Controls the temperature for Cooling with the set point entered manually.
1.6. Eco: Heat and Cool Control without Presets in Preferences for Heat and Cool Temperature
1.7. Heat: Controls the temperature for Heating with the set point entered manually.
1.8. Manual: Heat and Cool Control without Presets in Preferences for Heat and Cool Temperature
1.9. Off: Thermostat off. You can use fan On, Circulate, Scheduled modes

2. thermostatOperatingState:
2.1. Idle: Thermostat off, no temperature control
2.2. Heating: The current temperature is below the HeatSetPoint – Differential Temp
2.3. Pending Heat: The current temperature is above the HeatSetPoint – Temp Differential / 2
2.4. Cooling: The current temperature is above the CoolSetPoint + Temp Differential
2.5. Pending Cool: The current temperature is below the CoolSetPoint + Temp Differential / 2
2.6. Fan Only: Active Fan is selected and thermostat mode is Off
2.7. Vent economizer: Fan Circulate has been selected and the Thermostat Mode is Off.

3. thermostatFanMode:

3.1. Auto: Indicates that the fan will be activated automatically in the climate control.

  • If thermostat state are Pending Heat or Pending Cool then Fan Current status go to OFF.
  • If thermostat state are Heating or Cooling then Fan Current status go to ON.

3.2. On: The Fan will always be running in On mode.

  • Fan Only will be displayed under Thermostat Status If Thermostat Mode is Off.
    if thermostat mode is different from off the status for heat or cool is displayed

3.3. Circulate: The Fan will always be running in Circulate mode.

  • Vent economizer: will be displayed under Thermostat Status if Thermostat Mode is Off.
    if thermostat mode is different from off the heat or cool status is displayed

3.4. Followschedule: The Fan works with the on and off schedule according to the values, in minutes, chosen in preferences for Time On and Time Off. (Range between 1 and 60 min).

4. The Information Panels (Custom Capabilities):
4.1. Fan Current State: Indicates the Fan current Status On or Off, and can be used in Routines to activate fans, etc 

4.2. Fan Next State Change: Indicates the time at which the next scheduled Fan state change will occur.
To match your local time: Adjust the time difference with UTC time in preferences
4.3. Thermostat Next State Change Information: Displays information of the current ambient
temperature, with two decimal places and the next expected thermostat state change and the
temperature at which the change will occur

In preferences you can program the temperature preset values for 5 thermostat modes.
This allows you to program with simple routines to vary the desired target temperatures for different Hours of the Day or for situations such as, I am away or vacation.

Preferences settings to improve the comfort and save energy:

To improve energy savings and comfort it is necessary to introduce in preference settings the type of heating and cooling that the thermostat has to control and the thermal inertia of the installation.

What is the thermal inertia of the installation?: For our use, is the capacity of a heating or cooling installation to continue emitting heat or cold when the heating or cooling stops.

The thermal inertia is bidirectional, it takes some time for the thermal emitter to lose temperatura and it will also take some time to heat up with the heater.

For example, an installation with external radiators or underfloor, electric, with water or liquid, will continue to emit heat or cold until its temperature equals the ambient temperature, even if it is already stopped.

If installation is the underfloor heating and cooling type, the thermal inertia is very large, since the mass to be heated or cooled is very large.

If installation is heating or cooling by air has no thermal inertia. The hot or cold air is forced to circulate and begins to heat or cool instantly and when the system stops then Air stops circulating and quickly equalizes its temperature with the ambient temperature.

How to Use the Preference Setting: “Thermal Inertia of your Installation”

This simulates the acceleration resistance of real mechanical thermostats.

How to calculate Thermal Inertia of your Installation?
We will observe the history events and look for the temperature when thermostat Operating state change to “Pending Heat” state and then we will look for the maximum temperature following that event.
The difference between the maximum temperature reached and that of the event of change to “Pending Heat” is approximately equivalent to the thermal inertia of our heating system with the temperature conditions that we have fixed in the electric emitters, floor or water radiators.

Preference Values are in Âș in a range of 0Âș to 1.5Âș. The unit are in C o F, according to your selection in thermostat temperature unit in preference. Default value is 0.3Âș

The thermal inertia value is used to calculate the temperature to “stop” the heating or cooling, in order to no exceed or exceed as little as possible the temperature target in the set Point and improve comfort by saving energy.

In Next Picture an Example of calculate with history events the Thermal Inertia for Heat set Point 19ÂșC:

  • Temperature for Pending Heat state= 18.8ÂșC
  • Max. Temperature after Temperature for Pending Heat state= 19.1ÂșC
  • Heat Thermal Inertia with Radiator water Temp 55ÂșC = 0.3ÂșC
  • Difference Set Point to Turn-On Temp = 0.6Âș aprox will be a good value

How to Use the Preference: “Select Your Heating and Cooling Type”

This preference is used to tell the thermostat what type of heating and cooling will be used so that it can calculate the heating or cooling ON and OFF temperature points.

  1. “Air for Heat & Cool”: Hot air heating and cold air cooling. This system is considered to have zero thermal inertia, regardless of the value entered by the user in the “Thermal Inertia of your Installation” preference.
  2. “Radiators for Heat & Air for Cool”: Heating by water radiators, electric ceramics and cold air cooling. Thermal inertia is used by subtracting it from the heating set point and zero value of thermal inertia is used for refrigeration.
  3. “Radiators for Heat & Cool”: Heating and cooling by water radiators. Thermal inertia is used by subtracting it from the heating set point and adding it to the cooling set point.
  4. “Floor for Heat & Air for Cool”: Underfloor heating of water or electric and cooling by cold air. Thermal inertia is used by subtracting it from the heating set point and zero value of thermal inertia is used for refrigeration
  5. “Floor for Heat & Cool”: Heating and cooling by underfloor heating of water or electric. Thermal inertia is used by subtracting it from the heating set point and adding it to the cooling set point.

Default value is “Radiators for Heat & Cool”

How to Use the Preference “Difference Set Point to Turn-On Temp”

This setting is used to calculate the starting and stopping of the heating and cooling and achieve an optimal comfort for each user.

Select the desired Maximum difference between Final Temperature Target (set Points) and Heating or Cooling temperatures to Turn On the system.

For example, if the heating set point is 20Âșc and we choose a value Difference Set Point to Turn-On Temp = 0.6Âș, then when the ambient temperature in the thermostat is 19.4Âșc, the state of the thermostat will change from Pending Heat to Heating to turn On the Heater

In my experience a valid value could be twice the thermal inertia of the heating or cooling system. If the thermal inertia = 0.3Âșc, then the value Difference Set Point to Turn-On Temp = 0.6Âșc approx will be a good value

Select a value between 0.3Âș to 4Âș. Default value is 0.6Âș

Values above 1Âșc suggest low comfort

For underfloor heating installations , which have a very large thermal inertia and will also take longer to reheat or cool, the starting point is set at 0.15Âșc below the stopping point.

For example, if the thermal inertia is 0.5Âșc and the heating set point is 20Âșc:

  • The change point to Pending Heat will be: 20Âșc - 0.5Âșc = 19.5Âșc
  • The change point to Heating will be: 19.5Âșc - 0.15Âșc = 19.35Âșc

Can see complete day temperature graphics in device details, and you can see the result of your automations and Temperature Set Points, in order to correct them if necessary to adjust the control to your needs.

When the device is installed for the first time:

  1. It may be necessary to restart the Hub as it has custom capabilities.
  2. The thermostat will not control the temperature until a first event of the current temperature is received. You can force an event by heating the sensor a little with your hand.
  3. The sensor works with the default settings of temperature reports:
    Minimum Interval: 30 sec
    Maximum Interval: 300 sec
    Reportable temperature change: 0.1ÂșC

Important considerations:

  1. All sensors emit their reports inÂșC. As the maximum precision is 0.1ÂșC, the maximum precision in ÂșF will be 0.18ÂșF, which when rounded to 1 decimal place will be approximately 0.2ÂșF.
  2. The values of the temperature presets have no units and the defaults are equivalent to ÂșC.
  3. If your location use ÂșF, change the units to ÂșF in preferences and change the Heat and Cool values to equivalent values ÂșF.
  4. The range for entering temperature in preferences is -50.0 to 250.0.
  5. Decimal values can be used. this range covers the values required for ÂșC and ÂșF adjustments
  6. The range to change the set point temperature in the thermostat and automations is from 0ÂșC to 40ÂșC and from 32ÂșF to 104ÂșF, with increments of +/-1Âș. This is due to the default presentation of the capability. If smartThings changes it to be able to enter decimals and expand the range it would be an improvement.

The functions of the thermostat are updated every time a temperature change occurs in the real device or any manual change is made in settings or values in any thermostat capability.

My Beta Drivers Channel link

SmartThings. Add a little smartness to your things

List of supported devices Zigbee Temp Sensor with Thermostat Mc

List of supported devices Zigbee Temp Sensor and Child Thermostat Mc

8 Likes

Just an idea on how I started using this.

As Garage HVAC, Aqara’s Temperature/Humidity sensor, set up through Automations to control plug with Heater, and plug with gable fan to bring fresh outdoor air. I could use old window A/C.
Now all I do to make adjustments is using Set Temperature +/- buttons. No need to change temperature in Automations.

Another Aqara’s temperature sensor is already used to control, Humidifier and Fans, and Heater, all plugged in smart plugs

1 Like

I have Panasonic hvac. But I can’t connect it straight to SmartThings. Only to Alexa or Google Assistant. I could use this driver to control my heating? :thinking:

I don’t use voice assistants and I do not know them in depth.

I figure it will depend on the level of integration and the actions you can run on your HVAC from Google or Alexa.

Thermostat actions are handled with rules and scenes that change switch states, fans, or other virtual devices.

All thermostat capabilities are accessible for conditions and actions of the rules and scenes.

  • If your integration with Google allows you to turn the hvac on and off:
    With a virtual device and two automations you could control the on and off.
    If thermostat mode = Off then switch HVAC = Off
    If thermostat mode = x or 
 Thermostat mode = y then switch HVAC = On
  • If it allows you to change the mode to heat, cool or fan:
    With automations that change the state of virtual devices according to the state of the Thermostat Mode.
    If thermostat mode = Cool then switch Cool HVAC mode = On
    If thermostat mode = Heat then switch Heat HVAC mode = On
    If mode Fan thermostat = On then switch Fan HVAC = On
    

    I guess then it’s goole home you have to do the automations with the states of the virtual devices.

Sure there are more options and it will depend on the level of actions accessible with google or alexia that your HVAC allows.

This is un example of the 24 Hours Automatic Heat Control with 5 Routines an 1 switch for heat On-Off.

If this switch were accessible by google home to control On-Off your HVAC it would be similar, taking into account that the thermal inertia of the air heating is 0Âș and you would have to set the Start-Stop differential temperature to 0.1Âș in preferences, the minimum.

@Sakari I have tried yesterday something just to see if can work. Used this driver to control ecobee thermostat. Pretty much instead of ecobee’s temperature sensor, I have used Aqara’s.
Worked

There is a lot possibilities.

2 Likes

Could you add Nedis Temp/humidity sensor to your driver and I can see if it works with this?

  • application: 4A
  • endpointId: 01
  • manufacturer: TUYATEC-prhs1rsd
  • model: RH3052
  • zigbeeNodeType: SLEEPY_END_DEVICE
    Raw Description 01 0104 0302 00 05 0000 0001 0003 0402 0405 03 0003 0402 0405
1 Like
  - id: "TUYATEC/RH3052"
    deviceLabel: TUYATEC RH3052
    manufacturer: TUYATEC-prhs1rsd
    model: RH3052
    deviceProfileName: temp-humid-therm-battery

Try it and any questions you have, ask me

Couldn’t find it at all. Appears only as a thing. :thinking:

Sensor pairing with stock DTH or Custom DTH?

Stock. I haven’t any custom dth anymore installed. I tried to reboot hub, delete cache, but no luck. Just appears as a thing.

I could check CLI logs but it’d have to wait untill tomorrow.

@Sakari,

Is the driver installed in you hub Zigbee Temp Sensor with Thermostat Mc or Zigbee Temp Sensor with Thermostat?

Yes, I had wrong driver. Now it works. Thanks.

1 Like

@Sakari you can swap drivers back and forth, no problem. Only requirement is to restart the app, to refresh Detail view

(NEW RELEASE) Version 2.0 of Edge Driver Zigbee Temp Sensor and Thermostat Mc:

Improvements and bug fixes:

  1. As the driver runs locally, I have added corrections to prevent the temperature control Timer stopping, if a Reboot HUB occurs and the thermostat is running.
    When the Hub is back online, it will continue to work with the settings it had.
    This could happen unintentionally during a Hub firmware update.
  2. Added in preferences an adjustment for Underfloor Heating installation with the No, Heat (Heat only) and Heat & Cool options.
  3. With this option the temperatures of the change to the Heating and / or Cooling state are corrected, to bring them closer to the set point Heat and Cool. In this way it begins to heat or cool earlier than in other air conditioning systems, to compensate that the underfloor heating system has more thermal inertia and takes longer to heat and cool the floor.

To facilitate the update, I am going to change version 1.0 to the name Zigbee Temp Sensor and Thermostat Mc (OLD).
I will publish the new version 2.0 with the original name Zigbee Temp Sensor and Thermostat Mc.

In this way, your driver installed will have the name with (OLD), indicating that there is a new version available and you can install the new version with a driver change whenever you want.

Devices added to driver:

  - id: "SmartThings-Motion-Sensor"
    deviceLabel: ST Motion Sensor
    manufacturer: Samjin
    model: motion
    deviceProfileName: motion-temp-therm-battery
  - id: "lumi.weather"
    deviceLabel: Aqara Weather
    manufacturer: LUMI
    model: lumi.weather
    deviceProfileName: temp-humid-press-therm-battery
  - id: "TUYATEC/RH3052"
    deviceLabel: TUYATEC RH3052
    manufacturer: TUYATEC-prhs1rsd
    model: RH3052
    deviceProfileName: temp-humid-therm-battery
1 Like

@Mariano_Colmenarejo :Hello, first i want to thanks you for the driver.
I used it for the past two days for Aqara temp sensor. I have two issues with it:

  1. i set temperature offset “-0.2C” and at random time it display the offset temp instead the real temp.
  2. second issue is that is display the temp with to much decimals, see the attached photo.

Hi @Catalin_S,

Accoding your screenshot, If you can see the events in the IDE it is that your device is using a Groovy DTH. You are not using the Edge Driver.

Look at the details of the device, Memu 3 points, If you don’t have the Driver Option, you are not using it.
If you have it, look to see what driver you are using

Thanks for quick reply.
This is the driver version:

@Catalin_S,

Sorry, Effectively entering IDE, devices, you can see the events.

In the detaills screen of the device do you see same data too?

In IDE, decimals are seen when an offset temperature value has been entered in preferences, but in the app it is rounded by default to 1 decimal.

The device sends a value, that is divided by 100, which gives two decimal places.
The temperature offset value is added to prior value and then rounded to 1 decimal place. This is what is shown in the App.

In DTH groovy the last calcutation was this, I think in edge are similar but in Lua language:

		if (tempOffset) {
			map.value = new BigDecimal((map.value as float) + (tempOffset as float)).setScale(1, BigDecimal.ROUND_HALF_UP)
            log.debug " temperature" + "${value}"
		}
		map.descriptionText = temperatureScale == 'C' ? '{{ device.displayName }} was {{ value }}°C' : '{{ device.displayName }} was {{ value }}°F'

The -0.2Âș event could occur if the device sent temperature 0Âș. This could happen during pairing, if the device has not sent temperature, but it is rare.
In fact when installed, the thermostat does not work until the device sends the first temperature event after installation.

The temperature and battery events are sent by the driver’s default libraries.
The thermostat code only sends events to the thermostat and custom capabilities, Fan Current State and Fan Next State Change.

@milandjurovic71 uses this Aqara Weather sensor. I don’t know if he has any of these problems

No problems at all. Only difference is that I am using Fahrenheit units.



Looking at those pictures i think the driver in not working correctly because mine is show 0 % battery and the device name is different (if @milandjurovic71 is using Version 2.0 of Edge Driver Zigbee Temp Sensor and Thermostat Mc)