-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relay states #17
Comments
with automation rules you could check if actualTemperature < desiredTemperature -> relay is on. How did you do the configuration in home assistant? Can you share your config for the themostat? |
Good idea with automation rule, but I think this way we could use as fault verification only. |
I could see that being usefull. When the relay is on your home automation system triggers a ceiling fan, etc... |
Or simply for power consumption calculation. |
The MCU doesn't send the relay state. You would need to modify the board to hook the relay control pin on the MCU up to a gpio pin on the ESP. Then you'd need to modify the code as well. I have done this and it works well but I'm using my own custom firmware. Here is a pic of the board mod. I added a 10k/10k voltage divider to drop the MCU voltage from 5 to 2.5v. |
@bikemike mike, thanks, simple idea, simple solution. Can you provide code diff so we can check your changes? Or firmware file as @pmaster555 mentioned in post above? |
@bikemike, I join the @pmaster555 and @uls169 requests for changes (diff in code) or firmware. I hope to have your news soon .... |
I have some code that does this in my C17GH3 thermostat repository here: https://github.com/bikemike/C17GH3Thermostat/blob/master/src/main.cpp#L35 Search for PIN_RELAY_MONITOR and relayOn I'm adding support for my BHT-002-GBLW to that codebase but I haven't quite finished it yet. I'll post again when I get it working reasonably well with Home Assistant and the MQTT HVAC component. |
The device has no flag for relay working or not. I like the solution of bikemike. Maybe I will include the flag in my firmware also. At the tyua module are almost all IOs available, to use this for relay state is a good idea. |
I've added support for BHT-002-GBLW to my firmware now but be warned that it isn't very user friendly. It requires changing the timezone in code and compiling - both of which I haven't documented yet. https://github.com/bikemike/MikesThermostat |
Is there something we can do here that's purely software? i.e. some logic in the formware that works out target temperature, set point, whether heating schedule is active or manual mode is enabled and returns what is, in effect, the state of the relay? @bikemike, does your hardware modification allow for control of the relay, or is it simply state only? |
You could probably compute the state of the relay but I don't think the "deadzone temperature" setting is transmitted from the MCU so you would have to have an additional setting for that on the wifi module. For me it was just easier to solder a wire. If you want to control the relay then you would have to make additional hardware changes. I did this for another thermostat I have (C17GH3) so I could control two relays (for baseboard electric and a gas fireplace). I disconnected the MCU from the relay and rewired so the wifi module reads the state from the MCU and controls both relays. |
Does anyone can tell me where solder the voltage divider on the BHT-6000 thermostats? |
@valepe You will need to check which pin on J1 connects to the relay control. If it is like my board(bac-002-wifi), the second from the bottom is GND, and 4th from the bottom is the relay pin. |
Software solution for this hw modification is implemented now in 0.97 |
Can you elaborate more on this? Do you still need to do the hardware mod or is this all done in software now. |
Hi, ok to explain. This issue can not be solved by software only. The thermostat (MCU) definitily sends no state info of the heating relay. Please do the small modification that bikemike showed here: #17 (comment) |
@bikemike My board look like this. As you can see I have a J3Y on Q3 and Q4 as well as something on R9 and R10. How would I go about checking which connection point is needed to be made. Could i test is with a multimeter while turning on and off the relay by adjusting the temperature controls on the unit? Also what would I be looking for? Or could you tell me the correct way to approach this. Thanks |
It is a different setup indeed, though the board is the same, but your seems to have transistors where our version is left empty at Q3, Q4, only a 0 resistor on Q4: |
@ahmaddxb Could you let me know your exactly model? Does your model supports more function, like cooling/ventilation? And also, if the hw modification is also working at your model - I would wonder, if this would not work because layout is the same. |
Yes mine has heating cooling and ventilation modes, model is BAC-002ALW used for 2 Pipe 3 Speed Central Air conditioner. https://www.aliexpress.com/item/32913037607.html?spm=a2g0s.9042311.0.0.27424c4dqwOdze I haven't tried the hw mod yet i wanted to know a way to test if putting the wire in the same location as @bikemike if it could work on my model. Is there some test i could do with a multimeter while triggering the relay on and off with the unit by adjusting the temperature to above and below the desired temp. |
@ahmaddxb, yours probably has multiple relays so you will have to figure out which one is used for cooling and trace that back from the relay to the board. You'll have to disconnect the thermostat and use a multimeter to check continuity with the relay signal pin and the ribbon cable pins. |
For some reasons, I think in BHT-6000 heating and off state are swapped... OFF state: On State: |
I found the following place for heating state connection on BHT-6000. I used pads for the non-soldered Q4 and R9 parts, which simplified the task nicely, IMO. I had only 1206 resistors at hand; something smaller, like 0805 would be even better. |
Well, as I learned later, it would not. With Q4 track in place, the output of relay is connected to the thermocouple, causing it to report insanely high temperatures. So just scratch it away with a exacto knife or some other sharp object. |
Hi, |
Hi guys. I recently bought a Beca BHT-002 from Amazon. Now to the actual question: regards |
I bet the 0 Ohm resistors on Q5 and Q6 are the signals for valve open and close. You have to probe status for each. |
Have you tried to check the pin of J2 like here #17 (comment) |
OK, I have just taken the measurements... The relay status is really via the 0 Ohm resistors of Q5 & Q6. In this case, with this board revision, the signal from the resistor must be tapped via Q5 or from the corresponding pin of pin header J2. Thank you very much. |
Hello. I have exactly the same fee as you. Could you show me where and what to solder, I'm not good at this. |
Sorry - one stupid question: What is the difference of this hardware hack to the mqtt variables action (heating/idle) or state (heating/cooling)? I have a BHT-002 GALW flashed with fashberg firmware and using in this case action to show the state of the heater very well. Before I build in the wall thermostat I check by a lamp and per ear if the relay is working and is in line with action variable, And it is! |
How did you remove the original module? This turned out to be more challenging than it appears at first sight, but is a very attractive upgrade. |
Use a heat gun set to a temp of a little bit more than 260C. Before remove the LCD otherwise it will leave some black marks on the screen. |
I used Chipquik SMD solder removal kit (https://www.chipquik.com/store/product_info.php?products_id=210001), it helps tremendously. First I remove the maximum amount of original solder with solder wick, then add Chipquik to the contacts. Heat gun also helps, but it is not strictly necessary with this setup - component usualy falls off by itself. |
In case you find in other new devices (beside our beloved thermostats) as well new chips inside (like WB2S, WB3S, WB3, CB3S, CBU, ...) there is a good chance that it is already supported with OpenBeken (or OpenBK) firmware. May be worth to check before starting the chip transplantation ;-) And may be, somewhere in the future, someone is smart enough (and find the time) to develop based on this work a new firmware for the new Tuya chip thermostats? |
Actually they are not parallel but serial, making a voltage divider. |
Hello @rande83, could you get this to work ? |
Hi. Yes, it's working fine... 👍 |
The relay pin is dirven by the other microcontroller on the PCB and the two possible voltages are 5V or 0V All the thermostats I bought from MOES arrived with TYWE3S module which is based on ESP8266 according to its data sheet |
Thanks a lot - this is tremendously helpful. I also desoldered them but thought I'd need to completely replace them. I put an ESP 12s there instead... UPDATE: |
One additional question though: If the target temperature is set to 20 degrees and the current floor temperature is 16 degrees - then upon activating the thermostat it should start heating, right?! For some reason I have to set it to 24 degree for it to turn on. Is this "normal"/the same for you? |
The important thing is the room temperature and not the floor temperature. Have you already calibrated (set the offset) the thermostat correctly with the help of another accurate thermometer? |
Thanks for your reply. What sense does that make if I may ask? Wouldn't one want to set the target temperature for the floor given that most underfloor heating systems (for sure ours) are not meant to heat up the room but to provide comfort/warm feet? The original thermostat from AEG (that I replaced with the one from Moes) also operates around the floor temperature. But I guess this is internal to the tuya mcu and cannot be changed? How can I calibrate the thermostat? |
I think I found a solution - the thermostat luckily offers a "system function" menu through which internal settings can be accessed. One setting is about the internal and external temperature sensor. I've set that to "external only" and this seems to do the trick. |
Hi @rande83 do you have a picture how to solder it? |
Hi, of course underfloor heating is there to heat the room and not primarily to keep your feet warm. That is the basic function of underfloor heating. |
Hi. Unfortunately I'm a bit busy these days, but I'll try to disassemble the device in the next days to provide you a picture. |
@Andi-Coder here you have a picture of my device. |
Hi, do I understand well that I can't get status of relay with this firmware? I don't want to set it manually, but it is good to see when thermostat's relay is on or off back in home automation software (hass in my case).
Thanks.
The text was updated successfully, but these errors were encountered: