swingerman / ha-dual-smart-thermostat

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.
https://github.com/swingerman/ha-dual-thermostat
Apache License 2.0
128 stars 21 forks source link

[feat] - Add support for more entities #322

Open netsoft-ruidias opened 2 days ago

netsoft-ruidias commented 2 days ago

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 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:

power: switch.XXX_thermostat_power
temperature_set: number.XXX_thermostat_power

Operating mode

  1. 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
  2. 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
  3. 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)

  1. Allow defining a mode property associated with a select entity, which would allow several working modes to be supported
  2. 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).
swingerman commented 2 days ago

What if we were able to control other thermostats directly. I have something in my mind for some time

netsoft-ruidias commented 1 day ago

@swingerman Please share with us what your ideas are, and together we can brainstorm on them.