[ST Edge] Capability that receives values from external device/source

How can you access the heater and cooler/fan measures/config? I mean, are they Zigbee, Z-Wave, Wi-Fi or they’re just electronic (not Smart) devices that have physical controls?
If you could share their brand and model, it would be very helpful.

This is because we need to read their measures (temperature) and config (cooling, heating, idle mode)

As I understand, @Mariano_Colmenarejo created automatic actions based on the settings defined in the driver, but those actions are applied to the same device that is controlled by it and doesn’t involve other devices. Is that correct, Mariano?

Yes, That is correct

1 Like

@nayelyz we were talking about intelligence in Virtual Thermostat, and I think that @ygerlovin has solved that. We are looking how to bring data from external temperature sensor, into virtual thermostat device’s current temperature field.

Ok, I took another look at your description and I believe I understand more, let me know if this is correct:

You have a Smart Temperature sensor which you want to integrate to ST with the capabilities:

  • TemperatureMeasurement
  • thermostatOperatingState (for the heating,cooling, idle states)
  • thermostatHeatingSetpoint
  • thermostatCoolingSetpoint

You would receive the value of the current temperature from the sensor and based on this you would control the other capabilities value within the driver.
This is possible because in your driver:

  1. You will receive the event of a temperature change (this depends on the communication protocol used by the Temperature sensor - Zigbee, Z-Wave, etc.)
  2. Then, you can compare this new value to the heating/cooling setpoints (they could be also saved in a device preference instead of a capability)
  3. And make a condition to change the thermostatOperatingState capability to the corresponding state

You would also need to integrate switch 1 (connected to the heater) and switch 2 (connected to the cooler/fan).
After that, you can create simple rules (in Automations) where the thermostatOperatingState is used as a condition, to change the switch 1 or switch 2 states accordingly.

It would be helpful if you could share:

  • A diagram of how you expect the communication to be in the integration.
  • Define which devices are already integrated to ST.
  • Brands and models of the Temperature Sensor and the switches

It would be Virtual Thermostat

This is pretty much everything is needed as everything else can be done through Automations.

I have multiple Zigbee and Z-wave Temperature sensors that can be utilized for this.

For example i would use this one due it’s size and battery that ladt really long time
Aqara Temperature/Humidity sensor
Also had Atmospheric pressure capability.



It is using custom DTH, but there is Edge Driver already available, but without Atmospheric pressure

Hi @nayelyz

The virtual thermostat will have 3 kinds (groups) of capabilities

  1. That receive the value from the external source. Either through automation, rules or anything else
  2. That are set by a user, either from the APP or API (or anything else)
  3. Set (calculated) by the thermostat

The actual switches and sensors are different devices, zigbee, wifi or z-wave. It doesn’t really matter as long as they are connected to the same account.

I will simplify things and omit fans control here, but the idea is pretty much the same as with heating/cooling.

The user will be responsible to setup the automation that triggers the switches, based on the operating state.
The user also will set the values for heating/cooling setpoints and the thermostat mode on the virtual thermostat.

Once thermostat receives the temperature measurement update from the external source it compares the value with heating and cooling setpoints and then based on the selected mode decides what should be the operating state.

Once the operating state changes, it will trigger the automation on the switches.

Now, it is fairly simple to control the switches with automation. Automations allow to thermostat to set switch capability value on another device.
However, I don’t see a way to setup automation on temperature sensor so it would be triggered on any temperature change. I also do not see a way to copy sensor’s temperature value to thermostat’s temperarure capability.
Basically 2 things are missing in automations:

  • Trigger/condition on any change, in addition to ‘below’, ‘above’ and ‘equal’
  • Action that allows to set the value, based on another value

Does it make any sense?

@ygerlovin,

What I would try is:

1- In the Real temperature sensor Driver add all the custom capabilities necessary for the thermostat

2- Create custom capabilities to activate and deactivate the device Commands, which are the actions to be executed. Example “Fan”, “heater”, “Cooler” …

3- In the Real device that has to execute the command: I would make an automation that is activated according to the “On” or “Off” status of the custom capability from step 2.

4- So until all functions are completed.

1 Like

@Mariano_Colmenarejo Thank you for your answer.

The idea here is to allows using the existing sensors and their drivers without modification.
That would make virtual thermostat to actually be virtual and provide a great flexibility for the user, while keeping things simple.

Naturally, we can create a thermostat driver for every combination of temperature and humidity sensors on the market, but it would miss the whole point of virtual thermostat

2 Likes

@ygerlovin,

You just have to add the fingerprint to the driver of each sensor you want to use.

But you can also do this if you want to use a virtual thermostat:

1- Create the capability to adjust the control temperature in the detail view
2- Create a capability to receive the action of an automation, for example:

  • Capability “Temp Control” type “number” where you will receive the action of several automations that will collect the control range of the thermostat: 18º to 22º with 0.5º increments. (10 Automations)
  • You do automations where if the temperature sensor = Xº write value “X” in the setcommand of the custom capability.
  • Reading the value of that capability in the virtual thermostat driver you know the temperature of the sensor and you can execute the actions.

3 - Create the capabilities to execute the actions, for example “Fan” with “On and Off” values.

4 - In the real device that executes the action, you do an automation with the condition of the value of the virtual Thermostat capability “Fan” = “on or Off” and Action Fan “on or off”

Sure there are more solutions using preferences!

1 Like

Or "Mirror” action in Automations

ok, based on your current configuration. You would need an extra SmartApp to act as a bridge between the sensors (which are installed and use their own handlers) and the Edge driver of “Virtual Thermostat”. This way, you would:

  • Create subscriptions to the temperatureMeasurement capability of those devices
  • Send the new value to “Virtual Thermostat” from there.

There are other options to achieve the same functionality like:

@nayelyz @Mariano_Colmenarejo @ygerlovin @TAustin @Sakari

I got an idea, but that’s is temporary solution or it could be good solution, as is not giving choice of temperature sensor change in device settings. @Mariano_Colmenarejo said place fingerprints in virtual thermostat, which let me thinking why not opposite.

We were trying to bring external devices’ data to virtual thermostat, but I’ll ask, if opposite is actually the solution:

Temperature Sensor with Thermostat capabilities

Could we modify temperature sensor driver to have thermostat capabilities?
It would be still temperature/humidity sensor with a little bit of extra
I was going to use Aqara’s Temperature sensor, as it has temperature, humidity and atmospheric pressure capabilities.
Currently I am using DTH, I think, created by orangebucket (Graham), Anidea for Aqara Temperature sensor

as current Edge driver doees not have atmospheric pressure, but it does have all other capabilities

GitHub

GitHub - veonua/SmartThingsEdge-Xiaomi: SmartThings Edge drivers for XIaomi…

SmartThings Edge drivers for XIaomi and Aqara devices - GitHub - veonua/SmartThingsEdge-Xiaomi: SmartThings Edge drivers for XIaomi and Aqara devices

I can provide fingerprints

This way plain “Temperature driver” can be swapped for “Temperature driver with thermostat capabilities”. Only same fingerprints need to be added to both drivers.

As I missed some responses I can see pluses and minuses of bith solutions.

  • Temperature Sensor Driver with Thermostat capabilities, needs to be upgraded with additional fingerprints for each protocol, zigbee, z-wave etc…
  • Virtual Thermostat, would be more flexible as will allow any temperature sensor to be used as Current temperature value.

Device would look like this, more or less


Can an Edge driver be ‘bilingual’ ? In otherwords, can you take a zwave or zigbee driver and add LAN type device support to it? Since right now Edge virtual devices are treated as LAN devices in order to use the try_create_device function. If that’s possible without breaking the zwave/zigbee stuff, then this approach sounds pretty straightforward.

I like the last option you listed, however I’m not sure why anyone would want to do this on an ESP when, for not much more $, you can have a full blown compute environment on a Raspberry Pi or Raspberry Pi zero. You could actually use the SmartThings RESTful API to retrieve the temperature device reading on some periodic interval and send it to an Edge LAN driver with a virtual thermostat device.

Of course SmartThings could make this much easier, just by (1) giving Edge drivers access to the RESTful API, or (2) giving Edge drivers access to any Edge device state on the same hub. :upside_down_face:

1 Like

Sorry everyone, but this is funny as I started replying like 3 hours earlier, got stuck with some family duties, and continued with my reply 3 hours later, not checking for any responses.
In meantime same thoughts came up, and my reply was too late.
Anyway looks like we are getting somewhere

One of advantage @Mariano_Colmenarejo solution, driver with extra capabilities, is that it would be local, and there is no need for any SmartApp or intermediate server (ESP),

@milandjurovic71,

In my opinion this is the easiest option right now.

  • The common philosophy of a virtual device is that it communicates with the ecosystem by automations and thus you can use any type of device to execute the actions.
  • The temperature capabilities work very well with the default libraries and could be used for many types of sensor. Simply adding fingerprint and having multiple profiles.
  • In fact, with a single driver you have everything, you don’t need have one for the sensor and a virtual one for the thermostat.
  • If you have several sensors and individual heating per room, with each sensor you have a thermostat.
  • You will always have the option to change your sensor to a stock driver.
  • In fact when I finish what I am doing I will make a multifunction driver starting from my st-motion sensor.
    I’m going to add profiles for temperature, humidity, and thermostat and switch control capabilities, for fixed and variable fans and underfloor heating valves.
1 Like

Here is the virtual thermostat inside a real sensor