The `dual_smart_thermostat` is an enhaced verion of generic thermostat implemented in Home Assistant. It uses several sensors and dedicated switches connected to a heater and air conditioning under the hood.
I have several thermostats whose integration is faulty (missing features) and I want to create a custom climate entity to replace the faulty integrations.
In this case, the faulty integration is done by the official "tuya" integration.
So I want to get the values using the "LocalTuya" integration, but not creating a climate (which also works poorly), but by creating sensors, switches and others...
The Problem
Reading values from the device and getting the "ha-dual-smart-thermostat" climate in sync is simple.
Having the "ha-dual-smart-thermostat" climate setting the device values is not possible out-of-the-box, I have to use automations to be able to achieve this, and that's what I wanted to avoid, as the whole process tends to get dirty quickly as we add new features.
The solution
I think the solution would be to support two new properties, an on/off switch to turn the device on or off and a "number" to set the target temperature:
When the climate is turned on or off, it triggers the action: switch.turn_on or action: switch.turn_off action depending on its state
When a user sets a target temperature (e.g. using type: thermostat card), then the action action: number.set_value is triggered to set the value of the entity defined in temperature_set
The mode can already be controlled today, through the heater and cooler properties associated with a switch, although this only allows defining these two states
Future implementation suggestions (nice-to-have)
Allow defining a mode property associated with a select entity, which would allow several working modes to be supported
If the temperature_set is set, you can read the properties max_temp, min_temp and precision from that number entity (ie: max, min and step attributes).
Scenario:
I have several thermostats whose integration is faulty (missing features) and I want to create a custom climate entity to replace the faulty integrations.
In this case, the faulty integration is done by the official "tuya" integration. So I want to get the values using the "LocalTuya" integration, but not creating a
climate
(which also works poorly), but by creatingsensors
,switches
and others...The Problem
Reading values from the device and getting the "ha-dual-smart-thermostat"
climate
in sync is simple.Having the "ha-dual-smart-thermostat"
climate
setting the device values is not possible out-of-the-box, I have to useautomations
to be able to achieve this, and that's what I wanted to avoid, as the whole process tends to get dirty quickly as we add new features.The solution
I think the solution would be to support two new properties, an on/off switch to turn the device on or off and a "
number
" to set the target temperature:Operating mode
climate
is turned on or off, it triggers theaction: switch.turn_on
oraction: switch.turn_off
action depending on its statetype: thermostat
card), then the actionaction: number.set_value
is triggered to set the value of the entity defined intemperature_set
heater
andcooler
properties associated with a switch, although this only allows defining these two statesFuture implementation suggestions (nice-to-have)
mode
property associated with aselect
entity, which would allow several working modes to be supportedtemperature_set
is set, you can read the propertiesmax_temp
,min_temp
andprecision
from thatnumber
entity (ie:max
,min
andstep
attributes).