Open soeoeb opened 8 months ago
I’ve got this too. Using BT with Tuya valves. Any restart of HA (update, power cycle etc) results in the BT instances becoming unavailable even though the Tuya valves still work within the Tuya integration.
The workaround noted by @soeoeb works for me - I manually reconfigure each BT instance making a small change to the sensitivity threshold, and it comes back on line. Weirdly, reloading BT doesn’t help. It needs to be reconfigured and there needs to be an actual change to the configuration, however small. Nor does hitting configure and then saving without a change help.
Facing the same issue, but not only on BT, also on versatile_thermostat. Probably something changed recently in climate or loading in core?
Same Situation here with my two Tuya valves (SALCAR TRV801W). The Rademacher Valves are working.
for me the same, also with BT Version 1.5.0
For me it's the same. I can solve the problem temporarily, if I reconfigure the component with a new value, e.g. increase "the outdoor temperature when the thermostat turns off" and it keeps available until the temperature sensor is unavailable for a short time or until a reboot.
This could also be useful to look at. I kicked out all the window switches in the BT that where not working anymore. After this, they work again, just without the window detection. After the debugging, I hope I can switch them back ;-) https://github.com/KartoffelToby/better_thermostat/issues/1333
i had too many problems with 1.5.0 also with 1.5.1
i went back to 1.4.0 , then recreated all devices => all problems gone ha v2024.4.4
I had the same problem with my Bosch BTH-RA thermostats. I have been uninstalling and upgrading for the last few days without success until I found a possible solution to the problem.
I saw that in Z2M under Details the system mode for my devices was not set. After I clicked on one of the available options, my devices were available again in BT.
I had the same problem with my Bosch BTH-RA thermostats. I have been uninstalling and upgrading for the last few days without success until I found a possible solution to the problem.
I saw that in Z2M under Details the system mode for my devices was not set. After I clicked on one of the available options, my devices were available again in BT.
Thanks for the tip, that's exactly it, BT hasn't been working for days (since I noticed it). Now it works again. Nevertheless, I will test and set up the “Advanced Heating Control” blueprint soon. A BT has already failed one or two times, the first time it was due to an unavailable external sensor because there was no connection and now I think after the update to HA 24.5.x or a restart.
for its not working like this, so thats maybe only a workaround for some devices!
Workaround for my Tuya devices TRV SALCAR TRV801W) System:
Hardware Raspberry PI 4
I have inserted some lines of code to the module /homeassistant/custom_components/better_thermostat/utils/controlling.py
after line 213.
Now the Tuya TRV are active again even after a restart of HA.
#
# Begin Workaround
#
_LOGGER.debug(
f"better_thermostat {self.name}: TO TRV set_hvac_mode: {heater_entity_id} from: {_trv.state} to: {_new_hvac_mode} WA1"
)
if _new_hvac_mode == HVACMode.HEAT:
_new_hvac_mode = HVACMode.HEAT_COOL
_LOGGER.debug(
f"better_thermostat {self.name}: TO TRV set_hvac_mode: {heater_entity_id} from: {_trv.state} to: {_new_hvac_mode} WA2"
)
#
# End Workaround
#
Background: The devices return an error when the HVAC mode is set to HEAT. Therefore, the workaround for this case is to set the HVAC mode to HEAT_COOL.
@UweTo looks good. Is it possible to write down some of the code before and after your workaround! If i go to line 213, there is still the "_logger.debug" -line! So with some additional lines i have a better overview:)
@tco99ttocs:
workaround with additional lines:
# send new HVAC mode to TRV, if it changed
if (
_new_hvac_mode is not None
and _new_hvac_mode != _trv.state
and (
(_no_off_system_mode is True and _new_hvac_mode != HVACMode.OFF)
or (_no_off_system_mode is False)
)
):
#
# Begin Workaround
#
_LOGGER.debug(
f"better_thermostat {self.name}: TO TRV set_hvac_mode: {heater_entity_id} from: {_trv.state} to: {_new_hvac_mode} WA1"
)
if _new_hvac_mode == HVACMode.HEAT:
_new_hvac_mode = HVACMode.HEAT_COOL
_LOGGER.debug(
f"better_thermostat {self.name}: TO TRV set_hvac_mode: {heater_entity_id} from: {_trv.state} to: {_new_hvac_mode} WA2"
)
#
# End Workaround
#
Update of my workaround: Module: /homeassistant/custom_components/better_thermostat/utils/controlling.py
The HVAC mode is now only changed for devices that are provided via the Tuya integration.
The workaround is inserted after line 214.
Works for me with 2 valves that are provided via the Tuya integration. The other of my valves are provided via the Rademacher integration and continue to work as before.
# send new HVAC mode to TRV, if it changed
if (
_new_hvac_mode is not None
and _new_hvac_mode != _trv.state
and (
(_no_off_system_mode is True and _new_hvac_mode != HVACMode.OFF)
or (_no_off_system_mode is False)
)
):
# Line 214
#
# Begin Workaround
#
wa_integration = self.real_trvs[heater_entity_id]["integration"]
wa_hvac_mode = _new_hvac_mode
_LOGGER.debug(
f"better_thermostat {self.name}: TO TRV_1 set_hvac_mode: {heater_entity_id} from: {_trv.state} to: {_new_hvac_mode} Integration: {wa_integration} WA1"
)
if _new_hvac_mode == HVACMode.HEAT and wa_integration.find("tuya") != -1:
_new_hvac_mode = HVACMode.HEAT_COOL
_LOGGER.debug(
f"better_thermostat {self.name}: TO TRV_2 set_hvac_mode: {heater_entity_id} from: {_trv.state} to: {_new_hvac_mode} instead of {wa_hvac_mode} Integration: {wa_integration} WA2"
)
_LOGGER.info(
"better_thermostat %s: Integration %s. Setting HVAC_Mode to %s",
self.name,
wa_integration,
_new_hvac_mode,
)
#
# End Workaround
#
i had too many problems with 1.5.0 also with 1.5.1
- device unavailable (as described here)
- cannot change targetted heater anymore
- cannot control setted heater
- entity ids names are doubled like: room1_heat_thermostat_room1_heat_thermostat
i went back to 1.4.0 , then recreated all devices => all problems gone ha v2024.4.4
I did exactly the same thing, back to 1.4.0 and after restarting everything works as before.
I have the same issue, but think another root cause. After the restart of HA some BTs are not available, but some are working:
The ZHA devices themselves are all fine. When I restart the BT component, it workes fine:
Here is the full log: home-assistant_better_thermostat_2024-11-06T14-38-43.406Z.log
Let me know when you need more log out put to better understand the issue.
Pls try the 1.7.0 Beta 1
I have The Same Problem. Also with 1.7.0 Beta 1. After restart ha all my Bt Thermostats From Tuya are Not available .
Pls try the 1.7.0 Beta 1
With the beta right now they work stable (need to knock on wood). Sorry to reply back so late. I did not find this thread beside the others I am active in. What also helped to dramatically increase the stability of my zigbee network was to replace the USB 2.0 hub with a long USB 2.0 extension cable @lexi1970. After that fix only the reboot issue was left which seems to be solved in my case.
hello thank you. but i have already tried the beta. there is exactly the same problem. after restarting ha the better thermostats are not available. i then have to remove a sensor. save it. and add the sensor again then it works again. i usually use the weather sensor. if i leave out the weather sensor then i also have the same problem when i restart.
they are Tuya thermostats without Zigbee. only my temperature sensors are zigbee2mqtt
Hello, here https://github.com/KartoffelToby/better_thermostat/issues/1322#issuecomment-2143350923 I have described a workaround that works for my Tuya valves. However, as this requires changes to be made in a Better Thermostat module and these have to be updated with each new version, I have now worked out a different solution for myself. I have created a Quirk module and placed it in the corresponding folder of Better Thermostat. I no longer have to make any code changes for new versions of BT. All I need to do is copy the Quirk module back into the relevant folder and restart. It also works for me with the current version 1.7.0-beta1. If required, I can post the code of the Quirk module here.
hello thank you. but i have already tried the beta. there is exactly the same problem. after restarting ha the better thermostats are not available. i then have to remove a sensor. save it. and add the sensor again then it works again. i usually use the weather sensor. if i leave out the weather sensor then i also have the same problem when i restart.
they are Tuya thermostats without Zigbee. only my temperature sensors are zigbee2mqtt
That would be nice if you could post the code
That would be nice if you could post the code
Here is the code that must be in this directory: /homeassistant/custom_components/better_thermostat/model_fixes/WiFi Smart Thermostat.py
WiFi Smart Thermostat is the name of the adapter model. You can find the name via Integrations->Tuya->Click on one of the Tuya thermostats. Then you will see this:
On my test system Raspberry PI the name to use is “WiFi Smart Thermostat”, on my production system based on X64 it is “1q1grefcvygxzc7w”. The Quirks file on my Raspberry is therefore called WiFI Smart Thermostat.py, on my X64 system 1q1grefcvygxzc7w.py. The content of the files is identical.
import logging
from homeassistant.components.climate.const import HVACMode
_LOGGER = logging.getLogger(__name__)
def fix_local_calibration(self, entity_id, offset):
return offset
def fix_target_temperature_calibration(self, entity_id, temperature):
return temperature
async def override_set_hvac_mode(self, entity_id, hvac_mode):
_LOGGER.debug(
f"better_thermostat {self.device_name}: TRV {entity_id} device quirk hvac WiFi Smart Thermostat active"
)
if hvac_mode == HVACMode.HEAT or hvac_mode == HVACMode.AUTO:
hvac_mode = HVACMode.HEAT_COOL
await self.hass.services.async_call(
"climate",
"set_hvac_mode",
{"entity_id": entity_id, "hvac_mode": hvac_mode},
blocking=True,
context=self.context,
)
return True
async def override_set_temperature(self, entity_id, temperature):
return False
Oh je. Das klingt kompliziert.
oh dear, that sounds complicated
Nö, ist einfach 😄.Bei Fragen gerne melden.Habe es auch mit Version 1.6.1 problemlos am laufen.Am 20.11.2024 um 17:24 schrieb lexi1970 @.***>: Oh je. Das klingt kompliziert. oh dear, that sounds complicated
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
hello thank you. but i have already tried the beta. there is exactly the same problem. after restarting ha the better thermostats are not available. i then have to remove a sensor. save it. and add the sensor again then it works again. i usually use the weather sensor. if i leave out the weather sensor then i also have the same problem when i restart.
they are Tuya thermostats without Zigbee. only my temperature sensors are zigbee2mqtt
Ich habe aufgehört den externen Wetterdienst zu verwenden, das macht auch immer wieder Probleme. Ich hätte das oben gestern nicht schreiben dürfen. Heute morgen war ein Fenstersensor im Schlafzimmer weg. Ergo Schlafzimmer kalt da TRV aus. Im gesamten Haus waren die Heizungen zu kalt obwohl BT lief. Der Offset Parameter in den TRVs war wieder extrem groß (-54), ich denke die TRVs können mit solchen Werten nicht umgehen.
So viele deutsche hier. Klasse. Englisch ist immer ein Problem. bei mir klappts auch nicht wenn ich den aussensensor oder wetterdaten weglasse.
Ich weiß nicht genau wo ich den Code einfügen soll. Oben gibts du einen anderen Pfad an als im Kommentar 1322
und auch wo genau im Code. das übersteigt meine Kenntnis komplett
[x] Model name of your Devices: ME167 Wireless Smart Radiator Thermostat (tuya)
[x] Output from Home Assistant Developer Tools state e.g.: State of climate.bt_test: unavailable
[x] Output from Home Assistant Device Diagnostic from BT:
Description
Every time I restart HA or reboot the system, my BT devices stop working (reporting "not available"). The real thermostats keep working just fine. After "making my devices stop working" I am getting a error message in HA system protocols:
In some cases I was able to "fix" the devices by reconfiguring the integration entry and changing values like tolerance on p. 1 or auto heat swap / alternative off mode on p. 2 of the config form, restarting HA and then repeat the reconfiguration process:
But most of the times, the only way to "fix" BT was to completely delete all integration entities, remove the HACCS integration, reinstalling BT and reconfiguring devices (restarting HA after every step). Why my workaround worked some time and why it didn't any other time is beyond me.
Steps to Reproduce
Expected behavior: For my set up BT devices to remain available.
Actual behavior: BT devices not responding.
Versions
HA versions: Core: 2024.3.1 Supervisor: 2024.03.0 Operating System: 12.1 Frontend: 20240307.0
BT version: Better Thermostat Firmware: 1.4.0
Additional Information
Don't know if that's of any help but this is the output of HA dev tools regarding the entity state when the entity is available: State of climate.bt_test
When trying to investigate what's happening I stumbled upon two reoccurring errors in the HA protocol that happen when BT devices are working/available.