I have a MOES BHT-002 thermostat from a series affected by an unpleasant ailment, the MCU hanging up. I am not the only one as the series of faulty thermostats was quite large.
Unfortunately, I don't yet have enough experience in using and writing scripts in OpenBK to create what I describe below, hence my plea to the experts for help.
The hang-up manifests itself as a complete unresponsiveness of the thermostat, a reboot is needed which brings it back to life for a while, this happens completely irregularly, sometimes after two weeks and then the next day, there is no rule.
At the same time, the CB3S module in the thermostat works without problems all the time.
I have managed to technically prepare a manual reboot of the MCU itself by placing a MOSFET transistor as a ground cut from the microcontroller, I control it via GPIOP_8 in the CB3S set as Relay on channel 10 (toggle), and manually it works perfectly.
I would like to automate this so that reboots are done independently when the MCU is found to be suspended.
The only clear symptom showing the current state of the MCU is this report in the logs:.
.
whereby with the suspension state TuyaMCU heartbeat_valid = 0 , wifi_state_valid = 0 and product_information_valid=0 have state 0, during normal operation 1.
This is what an example log looks like in a suspended state every second...:
.
Now the questions:
1. is it possible to write a script for the OBK which, when receiving the suspend information a couple of times, would start/shut down the GPIOP_8 for 1 second, thus restarting the MCU ?
or:
2. is it possible to send the TuyaMCU heartbeat_valid status via MQTT to Home Assistant ?. There I would be able to run the automation restarting the MCU.
Unfortunately, I don't yet have enough experience in using and writing scripts in OpenBK to create what I describe below, hence my plea to the experts for help.
The hang-up manifests itself as a complete unresponsiveness of the thermostat, a reboot is needed which brings it back to life for a while, this happens completely irregularly, sometimes after two weeks and then the next day, there is no rule.
At the same time, the CB3S module in the thermostat works without problems all the time.
I have managed to technically prepare a manual reboot of the MCU itself by placing a MOSFET transistor as a ground cut from the microcontroller, I control it via GPIOP_8 in the CB3S set as Relay on channel 10 (toggle), and manually it works perfectly.
I would like to automate this so that reboots are done independently when the MCU is found to be suspended.
The only clear symptom showing the current state of the MCU is this report in the logs:.
ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=20
whereby with the suspension state TuyaMCU heartbeat_valid = 0 , wifi_state_valid = 0 and product_information_valid=0 have state 0, during normal operation 1.
This is what an example log looks like in a suspended state every second...:
ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 0, product_information_valid=0, self_processing_mode = 1, wifi_state_valid = 0, wifi_state_timer=5
Now the questions:
1. is it possible to write a script for the OBK which, when receiving the suspend information a couple of times, would start/shut down the GPIOP_8 for 1 second, thus restarting the MCU ?
or:
2. is it possible to send the TuyaMCU heartbeat_valid status via MQTT to Home Assistant ?. There I would be able to run the automation restarting the MCU.