KartoffelToby / better_thermostat

This custom component for Home Assistant will add crucial features to your climate-controlling TRV (Thermostatic Radiator Valves) to save you the work of creating automations to make it smart. It combines a room-temperature sensor, window/door sensors, weather forecasts, or an ambient temperature probe to decide when it should call for heat and automatically calibrate your TRVs to fix the imprecise measurements taken in the radiator's vicinity.
https://better-thermostat.org
GNU Affero General Public License v3.0
847 stars 128 forks source link

TRV modes - off / auto / heat #176

Closed marcinwadon closed 2 years ago

marcinwadon commented 2 years ago

Hey, I'd love to force the TRV to be either closed or opened. While I can close the TRV from the ai_thermostat, I cannot turn it forcibly on, as the heat mode is used for automation. Is there a way to map "auto" mode on climate entity on ai_thermostat to "auto" mode on the TRV and "heat" mode to keep TRV opened?

This would be really useful for deaeration process when all TRVs should be opened.

KartoffelToby commented 2 years ago

mapping heat to a mode called boost?

marcinwadon commented 2 years ago

Not really a boosted but a forcible opened. Boost opens the TRV for n seconds but I want it to open as it does natively with "heat" mode.

marcinwadon commented 2 years ago

So basically for Tuya TRVs default behavior is following:

So I think there should be off and heat 1:1 mapped to TRV. Currently heat in better_thermostat is mapped to auto in TRV. One option is missing

KartoffelToby commented 2 years ago

No, thats one of the main reasons of this project, heat means boost 100% open vavle, its not equal to what HA or Google Home unterstands of mode heat.

So it would be possible to remap heat to boost, than you can trigger the boost mode via a automation or in HA

marcinwadon commented 2 years ago

So there is one more missing. Boost isn't enough because it goes back after few minutes

RubenKelevra commented 2 years ago

Hey @marcinwadon,

heat means that you don't want any cooling. auto means that it will heat or cool as necessary and off means it won't neither heat or cool.

There's no such thing as "full valve open"-mode in the climate entity.

The decision if heat is necessary and how much is the task which is the TRV is meant to do.


To get the behaviour you want you can deactivate the PID functionality and switch to on/off mode (The right term would be bang-bang controller).

How to do this on your valves is explained in the manual.


But PID is usually the better choice, so I'm curious, why would you want to force open the valve? Usually it does this if you setpoint has a positive delta of 3 K for the local temperature anyway?

marcinwadon commented 2 years ago

hey @RubenKelevra

heat means that you don't want any cooling. auto means that it will heat or cool as necessary and off means it won't neither heat or cool.

this is exactly what I need :) and better_thermostat doesn't provide one of these options


I'm using PID but TRV uses "off, auto, heat" modes and better_thermostat uses only "off, heat" by mapping "heat" to TRV "auto" and providing temperature calibration. One mode is missing. The use case for it is e.g. deaeration process

RubenKelevra commented 2 years ago

hey @RubenKelevra

heat means that you don't want any cooling. auto means that it will heat or cool as necessary and off means it won't neither heat or cool.

this is exactly what I need :) and better_thermostat doesn't provide one of these options


I'm using PID but TRV uses "off, auto, heat" modes and better_thermostat uses only "off, heat" by mapping "heat" to TRV "auto" and providing temperature calibration. One mode is missing. The use case for it is e.g. deaeration process

Obviously "auto" is missing 'cause better_thermostat can't cool. :)

Maybe once again:

Auto - > Switch between heating and cooling dynamically Heat - > forbid any cooling Cool - > forbid any heating off - > no heating/no cooling

The TS0601 is actually implemented wrong. It should only have heat and off as well.

Here's the documentation for the HVAC modes:

https://developers.home-assistant.io/docs/core/entity/climate/

marcinwadon commented 2 years ago

It makes sense for general climate but does not make sense for a TRV because it cannot cool at all.

So for TRVs, or directly for Tuya TRV if possible:

Currently better_termostat uses:

calibration_type: 1
mode_map:
  heat: auto

for TS0601. And the URL for climate you provided above says:

HVAC_MODE_HEAT: The device is set to heat to a target temperature. HVAC_MODE_AUTO : The device is set to a schedule, learned behavior, AI.

Which makes sense and I don't understand why better_termostat uses HEAT mode for actually "learned behavior, AI"

Btw, to enable "heat" mode on the TRV I need to disable the better_termostat climate entity, add TRV climate to the UI and enable "heat". It's not so practical :|

RubenKelevra commented 2 years ago

It makes sense for general climate but does not make sense for a TRV because it cannot cool at all.

Well, just because we don't have any support for ACs atm doesn't mean we will never implement this.

So for TRVs, or directly for Tuya TRV if possible:

  • off -> no heating
  • auto -> better_termostat drives TRV calibration
  • heat -> map 1:1 to TRV heat.

We can't change the current behaviour. The TuYa TS0601 are exporting their modes wrongly via Z2M.

Actually, we might want to fix that in Z2M, as it is just wrong.

The TRV won't "heat to a target temperature" on heat. It will open the valve to 100% and call it a day.

That's not a setpoint heating but Sauna mode. 😂

Currently better_termostat uses:

calibration_type: 1
mode_map:
  heat: auto

for TS0601. And the URL for climate you provided above says:

HVAC_MODE_HEAT: The device is set to heat to a target temperature. HVAC_MODE_AUTO : The device is set to a schedule, learned behavior, AI.

We use heat, cause we will use the TRV to "heat to a target temperature".

There's neigther "schedule, learned behavior" nor an "AI" involved.

Which makes sense and I don't understand why better_termostat uses HEAT mode for actually "learned behavior, AI"

Can you please elaborate how this makes sense to you? I can't follow your thoughts here.

Btw, to enable "heat" mode on the TRV I need to disable the better_termostat climate entity, add TRV climate to the UI and enable "heat". It's not so practical :|

I understand that you found a limitation in the current feature set. But we can't change the behaviour of better thermostat to a wrong behaviour because Z2M exports it wrongly for this TRV.


Let's turn this around, please explain your use case and we might find a way to extend our feature set without breaking other people's use cases by implementing something differently than specified:

marcinwadon commented 2 years ago

Tuya TRV exposes three modes:

I'd like to use the local_calibration from better_thermostat, but also be able to forcibly open or close the thermostat if needed. I want to control it from a single climate entity (I understand better_thermostat to be kinda wrapper to the original climate entity that adds local_calibration feature). The use case is really simple - I'd like to force TRV to be opened. I can set a very high setpoint, but even then the TRV will react with a massive delay. What I need to do now is to disable better_thermostat climate entity and enable "heat" mode on TRV, to keep it open. That's fine, until you have 20-30 entities.

marcinwadon commented 2 years ago

Anyway, if that's not the case for better_thermostat, I will handle it other way :) I just thought that the climate entity here could map all modes for TRVs somehow. I understand Tuya made it wrongly but actually it's because of using climate entity for TRV that is not a fully climate entity

KartoffelToby commented 2 years ago

i didn' get the Point why you need it full open.

i.mean set the climate to off will close the valve and if you want to heat just set it to heat and choose 30°C

marcinwadon commented 2 years ago

Partially yes. As I said, the TRV will open with a delay and that's the case.

marcinwadon commented 2 years ago

There are two cases. One - I want to open the bathroom TRV (no matter what) in the morning when my wife wakes up and gets a shower. (Tuya's TRV changes the valve position gradually when I set 30°C) Second - I want to open all TRVs when I want to make a deaeration process or any installation procedure (I need all TRVs to be fully opened, to enforce full flow)

Padm59 commented 2 years ago

Hey I would also like to have the full control. One way this can be done (I guess) is by using presets. There could be the boost preset and as long as this is set the TRV will be fully open, without automatic switching back. Another preset could be the night mode. I did not read the documentation about the heating entity in HA yet and don't know if this is possible to implement. Maybe you could tell me or I will post it when I read about it.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity.

RubenKelevra commented 2 years ago

242 superseded the missing functionality for the presented use-cases.